The purpose of this project is to practice the development of distributed systems
For this project, I'll create an ecommerce platform. This platform will allow users to purchase goods that are maintained by us. This is not a two sided marketplace with our users being both companies and consumers -- at least for now. To simplify, we'll centrally define the products.
- Users should be able to make purchases using card payments
- Users should be able to see available products, including their remaining stock
- Users should be able to sort and filter products
- Should be designed to handle >10M users per day
- Should have 99.9% uptime
- Should allow for concurrent development from a large distributed team
-
We will use Golang as the primary backend language.
-
We will provide an internal CP db optimized for writes in postgres
- This db will be exposed to our systems through a REST API
-
Implementing a psudo CQRS (Command Query Responsibility Segregation)
- "Psudo" here because we really just want to segregrate the most read heavy users (customers) to a separate db and api optimized for their needs
- This customer read db will be updated through a service that reads from a Kafka queue
- API Gateway: Not Implemented
- Products: A REST API with a postgres db. It allows sellers to manage their products and product collections. This service publishes writes to a kafka queue.
- Product Search: A GraphQL API with mongodb. It allows customers to query the current products and collections. It reads updates from kafka to update the mongodb database.
- Inventory: A gRPC API with redis. It is intended to maintain the most up-to-date state of product inventory. It reads updates to product inventory made by sellers from kafka, and also writes updates to the product inventory made by customers through purchases.
- Orders: Not Implemented Orchestrator for Payments, Fufillment, and Notifications, state management with kafka
- Order Recovery: Not Implemented
- Ensure that you have cloned the following repositories into the same directory so that they are parallel in your local filesystem:
git clone https://github.com/DistributedPlayground/productsgit clone https://github.com/DistributedPlayground/product-migrationsgit clone https://github.com/DistributedPlayground/product-searchgit clone https://github.com/DistributedPlayground/inventorygit clone https://github.com/DistributedPlayground/infra- Follow the instructions detailed in the infra repository to set up and run the services.