Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project logo

reddit-backend-microservices

Reddit core functionality split across four Node processes talking over gRPC
Source Code · Report Bug · Request Feature

Status GitHub issues GitHub forks GitHub stars GitHub pull requests GitHub license



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.

⚠️ What this is, and what it is not

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.

💡Features

  1. Four Node processes with .proto contracts between them
  2. gRPC and Protocol Buffers for inter-service communication
  3. Token verification delegated to the user service over gRPC
  4. One shared MongoDB, so the services are not independently deployable

⛏️Built with

  • Node JS
  • gRPC
  • MongoDB

🏁Getting Started

These instructions will help you to setup your own copy of reddit-backend-microservices on your local machine for development and testing purposes.

📚Prerequisite

🧰Installation

  1. Clone the repo

    git clone https://github.com/DeeshanSharma/reddit-backend-microservices.git
  2. Go inside each service directory and install its dependencies

    pnpm i
    # or
    npm i
    # or
    yarn
  3. Go inside each service directory and start the service

    pnpm start
    # or
    npm start
    # or
    yarn start

✍️Authors

📖Contributing

"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.

📢Contributors

💳License

Distributed under the MIT License. See LICENSE for more information.

🧬Resources

🎉Acknowledgement

About

Four-process Reddit backend over gRPC and Protocol Buffers. One shared MongoDB, so a distributed monolith.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages