postgresql
-
PostgreSQL과 mongoDB를 쓰면서 드는 고민DB 2022. 7. 31. 17:50
고민 되는 부분 현재 메인으로는 postgreSQL을 사용하고 sub로 monboDB를 사용하고 있으며 대부분의 data는 postgreSQL에 저장하고 log data나 사용자 action에 관한 data는 mongoDB에 저장해서 사용하고 있다. 여태까지 다 명확히 schema를 정의할 수 있고 수정여지가 적은 data에 대해서만 처리를 하고 있었는데 최근에 변경 될 가능성이 많고 명확하게 schema를 정의하기 힘든 data를 관리해야 할 필요가 생겨서 고민이 된다. data 조회 시 mongo와 SQL DB를 서버 단에서 혼합해서 사용해도 문제가 되지 않는가? 사실 mongo도 indexing을 잘 활용하면 조회가 빠르고 거의 read만 진행할 것이기 때문에 성능 상 문제는 없을 것이라고 생각된다..
-
Golang Server Base Code (graphQL, restAPI, mongoDB, postgresql)Golang 2022. 4. 22. 21:33
https://github.com/zzihyeon/golang-server GitHub - zzihyeon/golang-server: graphQL, restAPI, postgresql, mongoDB graphQL, restAPI, postgresql, mongoDB. Contribute to zzihyeon/golang-server development by creating an account on GitHub. github.com Golang 개발을 하고싶은데 처음 환경 setting이 어려운 사람들을 위해서 graphQL, restAPI, mongoDB, postgresql 관련 기본 setting을 한 base code를 push하였다.
-
Golang Postgresql SQLC 설정하기Golang 2022. 3. 21. 23:32
계기 SQL 문만 작성하면 자동으로 타입을 선언하고 메서드를 생성해주는 좋은 툴이 있어서 사용하게 되었다. 적용 단점: Postgresql sqlc 는 window에서 지원하지 않는다. 그래서 본인은 wsl(window subsystem for linux)를 사용하다가 너무 문제가 많아서 그냥 이 김에 맥북을 하나 장만했다. sqlc: kyleconroy/sqlc: Generate type-safe code from SQL (github.com) GitHub - kyleconroy/sqlc: Generate type-safe code from SQL Generate type-safe code from SQL. Contribute to kyleconroy/sqlc development by creating..
-
golang postgresql migrate 설정하기Golang 2022. 3. 21. 22:56
계기 개발 초기에 DB schema 변경이 잦고 이에 따라 Table을 drop 하고 create할 일이 많은데 이를 편하게 하기 위해 적용하게 되었다. 적용 우선 정상적으로 동작하는 postgresql DB 서버가 필요하다. 이는 그냥 docker로 간단하게 켜서 확인하면 된다. migrate CLI: migrate/cmd/migrate at master · golang-migrate/migrate (github.com) GitHub - golang-migrate/migrate: Database migrations. CLI and Golang library. Database migrations. CLI and Golang library. Contribute to golang-migrate/migrate..