|
1 | | -# Repository Overview |
2 | | -This repository showcases a robust microservices architecture comprising three distinct services: **Department**, **User**, and **Point**. The project emphasizes code reusability through a common container that initializes essential components such as logging, database connections, and environment variables. |
| 1 | +# Distributed Microservices Demo in Go |
3 | 2 |
|
| 3 | +A cloud-native, production-ready demonstration of a distributed system built with Go. This project features three containerized microservices (REST & gRPC) communicating over a network, backed by PostgreSQL, deployed via CI/CD to AWS ECS, and fully monitored with Prometheus and Grafana. |
4 | 4 |
|
5 | | -### API Services |
6 | | -- Department Service: |
7 | | - Exposes a **REST** API endpoint: `/api/departments/v1/departments` for retrieving department data. |
8 | | -- User Service: |
9 | | - Provides a **REST** API endpoint: `/api/users/v1/users` for accessing user information. |
10 | | -- Point Service: |
11 | | - Utilizes **gRPC** to deliver user point data, which is consumed by the User service, effectively demonstrating inter-service communication. |
| 5 | +# Demo |
| 6 | +**Run Locally:** |
| 7 | +```bash |
| 8 | +make run_docker |
| 9 | +``` |
| 10 | +Prerequisites: Docker and Docker Compose must be installed on your machine. |
12 | 11 |
|
13 | 12 |
|
14 | | -## Key Features |
15 | | - |
16 | | -### Architectural Patterns & Design Choices |
| 13 | +# Architecture Overview |
| 14 | + |
| 15 | +```mermaid |
| 16 | +graph TB |
| 17 | + subgraph AWS ECS / Docker Compose |
| 18 | + A[Client] --> B[API Gateway] |
| 19 | + B --> C[User Service] |
| 20 | + C --> E[(User DB)] |
| 21 | + C -- gRPC --> G[Point Service] |
| 22 | + G --> H[(Point DB)] |
| 23 | + C --> I[Prometheus] |
| 24 | + D --> I[Prometheus] |
| 25 | + G --> I[Prometheus] |
| 26 | + I --> J[Grafana] |
| 27 | + B --> D[Department Service] |
| 28 | + D --> F[(Department DB)] |
| 29 | + end |
| 30 | +``` |
| 31 | + |
| 32 | +# Technology Stack |
| 33 | +Go, PostgreSQL, Docker, gRPC, Prometheus, Grafana, GitHub Action |
| 34 | + |
| 35 | +# Key Features |
| 36 | + |
| 37 | +### 🏗️ Architecture & Design Patterns |
| 38 | +This project is a textbook example of practical software engineering patterns in Go: |
17 | 39 | * **Concurrency Pattern:** |
18 | 40 | * Utilized in [service/user_service/user/user_service](https://github.com/syedomair/backend-microservices/blob/main/service/user_service/user/user_service.go) to execute multiple database queries and gRPC calls concurrently using Go's `errgroup`. |
19 | 41 | * Enhances the performance of the `GetAllUserStatistics` method by leveraging parallel processing. |
@@ -57,14 +79,7 @@ This repository showcases a robust microservices architecture comprising three d |
57 | 79 | * **RESTful APIs:** JSON over HTTP for `user-service` (`/users`) and `department-service` (`/departments`). |
58 | 80 | * **gRPC:** High-performance RPC for internal communication between `user-service` and `point-service`. |
59 | 81 |
|
60 | | -- **Unit Testing**: |
61 | | - Comprehensive unit tests cover all code components, ensuring high code quality and reliability. Each service is rigorously tested to validate functionality and catch potential issues early in the development cycle. |
62 | | ---- |
63 | | -## Conclusion |
64 | | -This microservices architecture not only demonstrates best practices in software design but also incorporates essential features for modern application development, such as CI/CD, performance monitoring, and robust testing frameworks. By leveraging these technologies, developers can build scalable, maintainable, and high-performing applications. |
65 | 82 | --- |
66 | 83 |
|
67 | | ---- |
68 | | - |
69 | | - |
70 | | - |
| 84 | +# Conclusion |
| 85 | +This microservices architecture not only demonstrates best practices in software design but also incorporates essential features for modern application development, such as CI/CD, performance monitoring, and robust testing frameworks. By leveraging these technologies, developers can build scalable, maintainable, and high-performing applications. |
0 commit comments