This app allows users to share their thoughts and comment on posts. It includes a robust content moderation system to ensure the platform is used appropriately and safely.
This project implements a microservices architecture using Node.js and Express, orchestrated with Kubernetes (K8s) and managed with Skaffold. It utilizes an event-driven approach for communication between services. This architecture provides flexibility, scalability, and fault tolerance through asynchronous event-driven communication, suitable for modern cloud-native applications.
- Post Service: Manages creation and listing of posts.
- Comment Service: Handles creation and listing of comments associated with posts.
- Moderation Service: Responsible for moderating comments (pending, approved, rejected).
- Query Service: Aggregates data from Post and Comment services for efficient querying.
An event bus facilitates asynchronous communication between microservices:
- Implementation: Custom event-bus using Express to emit and listen for events.
- Integration: Each service emits events on actions (e.g., new post, new comment) which are consumed by the Query Service for data aggregation.
- Initial State: Posts and comments are stored in respective databases (SQL/NoSQL) per service.
- Event Store: Events are persisted in the event bus data store for later processing in case of service failures.
- Dockerization: Containerized microservices and client applications using Docker for consistency across environments.
- Kubernetes: Deployed microservices on Kubernetes for orchestration, utilizing Ingress Nginx for external access and Skaffold for automated builds and deployments.
- Service Dependencies: Minimized through asynchronous communication via the event bus.
- Fault Tolerance: Event store ensures events are not lost, allowing services to catch up on missed events during downtime.
- Local Development: Use Skaffold for local development, ensuring changes are reflected in Docker containers and Kubernetes pods.
- Deployment: Deploy using Kubernetes YAML files and Helm charts, managing resources and scaling rules.