Reddit core functionality split across four Node processes talking over gRPC
Source Code
·
Report Bug
·
Request Feature
Reddit backend clone of core functionality, split across four Node processes that talk to each other over gRPC and Protocol Buffers. Written in October 2022 while learning gRPC, following Mano Sriram's walkthrough.
Worth being precise, because the repository name oversells it.
It is a working gRPC boundary: four Node services, .proto contracts between
them, and token verification delegated to the user service across that boundary
rather than repeated in each caller. That part is real and is the reason the
repository is worth reading.
It is not a microservice system. All four services share a single MongoDB and reference each other's collections directly, so no service owns its data and nothing here can be deployed, migrated or scaled on its own. The accurate name for that shape is a distributed monolith. Splitting the processes is the easy half; splitting the data is the half that makes it a microservice architecture, and this repository does not do it.
Kept public as a gRPC reference rather than as an architecture reference.
- Four Node processes with
.protocontracts between them - gRPC and Protocol Buffers for inter-service communication
- Token verification delegated to the user service over gRPC
- One shared MongoDB, so the services are not independently deployable
- Node JS
- gRPC
- MongoDB
These instructions will help you to setup your own copy of reddit-backend-microservices on your local machine for development and testing purposes.
- Node JS
- MongoDB
- Protoc
-
Clone the repo
git clone https://github.com/DeeshanSharma/reddit-backend-microservices.git
-
Go inside each service directory and install its dependencies
pnpm i # or npm i # or yarn
-
Go inside each service directory and start the service
pnpm start # or npm start # or yarn start
- @DeeshanSharma - Initial Work
"In real open source, you have the right to control your own destiny." - Linus Torvalds
Contributions are what make the open source community an amazing place. Any contributions you make are greatly appreciated.
Distributed under the MIT License. See LICENSE for more information.
