개발 블로깅/Server&DataBase 개념
-
데이터베이스 인덱스는 왜 'B-Tree'를 선택하였는가개발 블로깅/Server&DataBase 개념 2020. 10. 25. 13:17
데이터베이스의 탐색 성능을 좌우하는 인덱스. 인덱스는 데이터 저장, 수정, 삭제에 대한 성능을 희생시켜 탐색에 대한 성능을 대폭 상승하는 방식이라 볼 수 있다. DB의 인덱스는 B-tree 자료구조를 이용하여 테이블의 요소를 빠르게 탐색하도록 설계되어있다. 그러면 인덱스는 그 많은 자료구조 중에 왜 하필 'B-tree'를 사용하는 것일까? 참고로 해당 글에서는 데이터베이스의 인덱스가 무엇인지에 대해서는 다루지 않는다. 하지만 인덱스에 대해 잘 몰라도 이 글을 읽는 것에 큰 어려움이 없을 것이다. DB를 직접 다루는 개발자가 아니더라도 SW 성능에 관심이 많거나 자료구조, 알고리즘 공부를 하는 사람이라면 관심을 가지고 읽어볼 만한 글이 될 것 같다. 인덱스가 B-Tree를 이용하는 이유에 대해 알기 위해,..
-
[2020.05.24] Infrastructure as Code란?개발 블로깅/Server&DataBase 개념 2020. 5. 24. 17:37
Infrastructure as Code 인프라 구성을 소프트웨어 코딩을 하는 것처럼 처리하는 방식을 말한다. 애플리케이션을 작업하는 방식과, 애플리케이션을 실행하는 환경을 구현하는 작업이 유사한 것. Infrastructure as Code의 장점 가상 시스템에 대한 프로그래밍 방식의 관리를 지원하기 때문에, 개별 하드웨어를 수동으로 구성하고 업데이트할 필요가 없음. 즉, 인프라의 '유연성', '반복성','확장성'을 부여 예시 AWS의 EC2 instance의 성능을 높이기 위해, type을 small에서 large로 업그레이드를 하려고 할 때, AWS 콘솔 웹에서 일일이 변경하지 않고 code로 간단히 변경할 수 있다. 번외 # IaaS (Infrastructure as a Service) 인프라를 ..
-
[2020.05.24] Docker 기초 - React을 Docker로 배포하기개발 블로깅/Server&DataBase 개념 2020. 5. 24. 15:35
작년 쯤 도커 개념과 컨테이너 실행 정도만 공부하고 블로깅 했었는데, 이번에 컨테이너 기반으로 다루는 기술의 중요성을 많이 깨닫고 Docker부터 다시 공부해보려고 한다. #도커라이징 현재 프로젝트 및 개발환경을 도커 이미지로 생성하는 작업이다. 우선 이와 같이 가볍게 express 서버를 하나 생성한다. 해당 서버 및 환경을 도커 이미지로 변경하기 위해서는 도커 파일을 생성하여 실행시켜야 한다. # 리액트 프로젝트 생성 리액트를 써본 개발자들에게 매우 익숙한 create-react-app을 이용해서 리액트 프로젝트를 하나 생성한다. $ create-reate-app react-docker // 도커 컨테이너로 올릴 리액트 프로젝트 생성 # Docker파일 생성 리액트 프로젝트 환경을 구성했으면, 해당 ..
-
[2019.10.29] PostgreSQL - psql: could not connect to server: No such file or directory is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?개발 블로깅/Server&DataBase 개념 2019. 10. 29. 22:55
어제까지 잘 써왔던 Postgrsql 디비가 오늘 아침에 갑자기 접속이 안되었다... psql 접속을 할 수 없다고 하고, 포트번호를 확인하라고 한다. postico로도 접속을 할 수 없었다. 일시적인 에러인지 pc를 껐다 켜보았지만 여전하다.. PostgreSQL - psql: could not connect to server: No such file or directory is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? # 원인 pc 내부 프로세스의 일시적인 충돌로 인해 발생한 PostgreSQL서버 오류. # 해결 방법 터미널에 아래 명령어를 입력하면 된다. $ brew..
-
[2019.09.01] PostgreSQL 설치 및 여러가지 사용법개발 블로깅/Server&DataBase 개념 2019. 9. 1. 19:52
객체-관계형 데이터베이스 종류 중 하나이다. (DB의 자세한 설명은 생략) # PostgreSQL 설치 패키지 관리자 homebrew 설치 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 위 명령어를 복사 붙여넣기 하면 homebrew가 설치된다. postgreSQL 설치 $ brew install postgresql homebrew를 이용하여 postgreSQL을 설치한다. postgreSQL 버전 확인 $ /usr/local/opt/postgresql/bin/postgres --version 'postgresql설치경로'/bin/postgres --version 으로 p..
-
[2019.06.22] Serverless란?개발 블로깅/Server&DataBase 개념 2019. 6. 22. 14:37
서버리스는 우리말로 직역하면 '서버가 없다'라는 뜻이다. 근데 사실 진짜 서버가 없는 것이 아니고, 단지, 특정 기능을 수행하는데 서버를 사용하지 않는 형식의 아키텍처로 구성이 되어 있기 때문에 '서버리스'라고 부른다. # Monolithic Archtecture 과 Serverless Archtecture 위 사진은 일반적으로 서비스 개발을 구현할 때 사용되는 아키텍쳐이다. 왼쪽 클라이언트와 오른쪽 데이터베이스 사이에 징검다리 형식으로 서버가 존재하며, 이 서버 안에는 특정 작업을 수행할 수 있는 모든 함수들이 종속적으로 내장되어 있다. 이 함수들을 사용하기 위해서는 서버가 활성화 되어야 하며, 서버가 활성화가 되면 빈번하게 사용되지 않는 모든 함수들까지 항상 활성화가 된다. 위 사진은 서버리스 아키텍..
-
[2019.06.10] Serverless framework를 이용하여 lambda 배포하는 법개발 블로깅/Server&DataBase 개념 2019. 6. 11. 01:41
AWS에서 제공하는 lambda를 serverless framework를 이용하여 배포하는 법을 알아보자. serverless란 lambda를 AWS에 배포하는 작업을 더욱 쉽게 작업할 수 있도록 도와주는 프레임워크이다. #서버리스 모듈 설치 $ npm i -g serverless lambda를 이용하기 위해서는 AWS에서 IAM 계정을 연동해줘야 한다. AWS 사이트에서 IAM계정을 생성한다. # IAM 계정 생성하는 법 '서비스 찾기'에서 IAM를 검색하면 바로 나온다. 'IAM 리소스' 중 '사용자'를 선택한다. '사용자 추가'를 선택한다. IAM 계정에 등록할 사용자 이름을 자유롭게 입력한다. 하위의 액세스 유형을 체크하고 '다음:권한' 버튼을 클릭한다. 상단의 세 개의 탭 중 마지막 탭인 '기존..
-
[2019.05.11] Express환경에서 mongoDB 사용하기개발 블로깅/Server&DataBase 개념 2019. 5. 11. 09:55
# mongoDB 개념 및 설치, 실행방법 mongoDB의 개념과 설치, 실행 방법은 이전에 블로깅 한 내용이 있어서 링크로 대체! https://helloinyong.tistory.com/42 [2019.03.26] NoSQL MongoDB 기초 MongoDB는 NoSQL의 종류 중 하나이다. NoSQL은 빅데이터 기반의 데이터베이스로, 정해진 칼럼이 아니라 컬렉션에 document가 계속 추가되는 방식이다. # MySQL과의 비교 mysql은 database를 새로 만들어주고 tabl.. helloinyong.tistory.com # express에서 MongoDB 사용법 express 안에서 mongoDB를 사용하기 위해서는 mongoose 모듈을 설치해야 한다. npm i -D mongoose n..