---
title: "Full bộ Source code Microservices NESTJS - Simple Bento Social Network."
description: ""
canonical: "https://200lab.io/blog/full-bo-source-code-microservices-nestjs-simple-bento-social-network"
published: "2024-11-21T03:38:08Z"
updated: "2026-08-21T07:17:46Z"
authors: ["Việt Trần"]
tags: ["Backend", "Frontend", "Showcase"]
reading_minutes: 1
access: "public"
---

### 📦 Bộ source code bao gồm:

- Microservices (NEST): Post, User (Authentication & Authorization), Comment, Notification.
- API Gateway: Tyk/Nginx.
- Database: Postgres (sử dụng Prisma ORM).
- Pub/Sub: Redis.
- Frontend: NEXT React.

Vì để đơn giản hoá phần deploy cho showcase này, 200Lab đã xây dựng kiến trúc Microservices dưới dạng Modular Hexagonal với NESTJS. Các modules sẽ độc lập và giao tiếp thông qua RPC-HTTP và Redis Pub/Sub.

## Đọc thêm

- [Consistent hashing là gì? Thêm server mà không phải xáo lại toàn bộ cache](https://200lab.io/blog/consistent-hashing-la-gi.md): Consistent hashing đặt key và node lên hash ring để thêm node ít xáo trộn cache. Demo Go: mod N chuyển 79,7% key, ring 100 virtual node chỉ chuyển 21,2%.
- [Cache stampede: khi cache hết hạn và hàng loạt request dồn xuống database](https://200lab.io/blog/cache-stampede-la-gi.md): Cache stampede xảy ra khi key hết hạn và nhiều request cùng gọi xuống database. singleflight gộp lời gọi trong một process, TTL jitter rải thời điểm hết hạn.
- [Connection pool là gì, vì sao service Go treo dù database còn rảnh](https://200lab.io/blog/connection-pool-la-gi.md): Service Go timeout hàng loạt trong khi database vẫn rảnh? Bài này giúp bạn hiểu connection pool trong Go hoạt động ra sao và cách chỉnh pool cho đúng tải.
- [Outbox pattern: ghi database và gửi message mà không mất đơn](https://200lab.io/blog/outbox-pattern-la-gi.md): Outbox pattern là gì: ghi đơn và event trong cùng một transaction, rồi relay gửi sau; demo PostgreSQL cho thấy dual-write làm mất message khi service restart.
- [Retry với backoff và jitter: gọi lại API lỗi mà không làm sập server](https://200lab.io/blog/retry-la-gi.md): Retry là gì: gọi lại khi lỗi tạm dễ thành thundering herd; exponential backoff chưa đủ, cần jitter để lệch nhịp và đo đỉnh request theo giây.
- [Mọi bài viết chủ đề Backend](https://200lab.io/blog/tags/backend.md)

Toàn bộ nội dung: https://200lab.io/llms.txt
