906bc
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: 모헤윰 --- # 백엔드 기술 스택 선정 ## 백엔드 프레임워크 ### nest.js 프레임워크가 틀을 잡아주기 때문에 자유도는 떨어지지만 여러 사람이 참여하는 프로젝트 구조를 파악하는 데에는 자원이 덜 들어감 - 코드의 일관성 유지 측면에서 이점 데코레이터, DI에 대한 학습이 필요 데코레이터 - custom decorator대신 기존 있는 데코레이터를 주 사용 함으로 큰 공부는 필요 없을듯...? => 다만 이미 만들어진 decorator 사용을 어떻게 하는 예시를 보면 큰 도움 될듯 합니다. #### using express vs fastify? 커뮤니티의 규모는 express가 훨씬 많은듯? ### express 자유도 높음 ### 결론 자유로운 Express는 오히려 뉴비 개발자로 하여금 더 혼란스럽게 할 요소 다분. 4명 전원이 백엔드를 할 수도 있는 상황이고 의사소통 비용 최소화를 위해, 또한 Spring-like 프레임워크 경험을 위해 Nest.JS를 써보는 것으로 결정. ## Language Nest.js 이므로 TS 자동 ## ORM or QueryBuilder ### ORM을 꼭 써야 하는가? [[TypeOrm]ORM을 프로젝트에 도입할 때 주의할점](https://itchallenger.tistory.com/494) ORM은 DBMS를 쉽게 써주게 하는 마법의 도구가 아니다. 분명한 Trade-off가 있다. Pros 1. 어플리케이션 모델 설계와 DB 설계를 통일할 수 있음 2. DBMS 종속성을 제거할 수 있음 Cons 1. DB와 ORM을 모두 이해해야 하기 때문에 학습량이 많다. 1. 이때문에 SQL만으로 작성하는 것을 먼저 배우고 이게 익숙해지면 그 뒤에 ORM을 배우라고 권장하는 경우도 있음. 2. 성능 문제 쿼리를 사용 언어(JS)에 맞게 쓰려면 쿼리 빌더를 쓰면 되는데 굳이 ORM을 쓰는 이유는, ORM의 객체 지향 성격이 Nest.js에 부합한다고 생각하기 때문 ![](https://i.imgur.com/9e2ZGaK.png) https://npmtrends.com/@mikro-orm/core-vs-knex-vs-objection-vs-prisma-vs-sequelize-vs-typeorm 후보군 - TypeORM - Prisma - TypeORM보다 느림 - MikroORM - Sequelize - Objection - Knex (QB) ### 결론 Prisma로... (써본 캠퍼들의 '재밌게 썼다' 라는 의견) ## DBMS - SQL ### MySQL Community 써야 함. MySQL 8로 넘어가면서 성능 면에서도 많이 좋아졌음. ### MariaDB Prisma 때문에 사용할 수 없음. ### PostgreSQL 복잡한 쿼리(해쉬 조인?) 및 대규모 어플리케이션에 적합함. ### 결론 [PostgreSQL의 장점: PostgreSQL 사용의 이점](https://www.prisma.io/dataguide/postgresql/benefits-of-postgresql) PSQL 사용 ## DBMS - NoSQL ### Redis (STUCK) 어디다 Redis를 쓸까? ### MongoDB Prisma가 지원하는 DBMS https://www.prisma.io/docs/reference/database-reference/supported-databases Prisma와 같이 쓸거면 DocumentDB 는 MongoDB가 유일. (STUCK)Prisma 없이 쓴다면 다른 DocumentDB도..? ## Container? 도커, 도커 오케스트레이션(돈 없어서 못해요) Docker, k8s ### 결론 도커까진 해보자 ## IaC? Ansible? IaC를 적용할만큼 많은 인스턴스를 사용하는 프로젝트가 아님. 이런 것도 있구나 정도로 넘어가면? (연습하려고 해도 돈이 없음.. => 우재님이 보태주시면... ?; ## 상태 유지 ### Cookie based Session 어드민 페이지는 무조건 Session (보안 이슈) ### JWT 일반 유저 https://boostcampwm7-me.slack.com/archives/C0406B4KGP9/p1664944708235789 ## nginx 사용 (API Gateway?) ## logger (STUCK) - Nest.js Built-in logger - Winston 치명적인 Error 발생 시 이를 어디에 전송? - 멤버십 슬랙 API는 제공 안해줄듯..? - 별도의 슬랙을 따로 파는것도 뭔가 좀.. - 이메일..? ## 저장소 ### 첨부파일 - NCloud - Object Storage - Archieve Storage - CDN - 고려하지 않음 ### Logger (STUCK) NAS? ## 어드민 대시보드 (STUCK) 별도의 백엔드 서버로 분리해야 하는가? 아니면 하나의 서버에서 다 다뤄야 하는가? 어드민 계정 DB는 분리하는 것을 가정함. - 하나의 서버에서 - 중복 구현을 막을 수 있음 - 하나의 서버에 너무 많은 구현 - 별도의 서버에서 - 관심사 분리 - ## 설계 ```mermaid classDiagram Hosting --|> Container Container --|> API_Gateway Container --|> ProcessManager API_Gateway --|> BackendFramework ProcessManager --|> BackendFramework BackendFramework --|> ORM BackendFramework --|> SessionStore : 세션 BackendFramework --|> AttachmentStorage : 첨부파일 접근<br/>접근 권한 확인 필요 ORM --|> SQL : 멤버, 그룹,<br/> 그룹 내 게시글, 알림 ORM --|> 게시글NoSQL : 단일 게시글 SQL --|> 게시글NoSQL : 콜렉션 구분을 그룹 ID로 SQL --|> 첨부파일NoSQL : 첨부파일 넘버 첨부파일NoSQL --|> AttachmentStorage : 첨부파일 보관 BackendFramework --|> SearchEngine : 게시글 검색 BackendFramework --|> SearchEngine : 멤버 검색 (자동 완성?) SearchEngine --|> ArticleCommentDataPipeline : 게시글 검색을 위한 데이터 사전 처리 SearchEngine --|> MemberDataPipeline : 멘션 검색을 위한 데이터 사전 처리 ArticleCommentDataPipeline --|> 게시글NoSQL : 게시글 데이터 획득 MemberDataPipeline --|> SQL : 그룹 내 멤버 데이터 획득 class BackendFramework { Nest.js-Express } class ORM { Prisma } class SQL { PostgreSQL } class 게시글NoSQL { MongoDB } class 첨부파일NoSQL { MongoDB } class AttachmentStorage { NCloud Object Storage-Private ? Server Internal Storage ? CDN } class SearchEngine { ElasticSearch } class MemberDataPipeline { Logstash } class ArticleCommentDataPipeline { ? Monstache ? Mongoosastic } class API_Gateway { NGINX } class Container { Docker } class Hosting { NCloud server } class Cache { Redis } class SessionStore { Redis } class ProcessManager { PM2 } class Logger { ? } ```

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully