This document contains the technical documentation for the Task application. This document provides an overview of the architectural choices and design principles followed throughout the development of this project.
Technology stack:
- Chosen over REST because gRPC offers a more efficient, binary protocol with better support for streaming and handling high-throughput communication. Given the requirement for thousands of tasks per second, gRPC's performance and built-in support for protobuf serialization made it the optimal choice.
- Reasoning: gRPC's low-latency and high-performance nature make it well-suited for microservices where real-time task processing and high-throughput are required.
- Reasoning: PostgreSQL’s ACID properties and transaction support made it the most suitable choice for ensuring that tasks are not lost and are persisted even if the consumer fails. Its support for complex queries also allows for flexible task management (e.g., retrieving tasks by state).
- Chosen over other alternatives due to
- ** Structured Logging
- ** Performance
- ** Compatibility with Observability Tools
- ** Simple and Flexible Configuration
- ** Wide Adoption and Support
- Reasoning
- Provides seemless and easy integration via library
- Has a cli tool if desired
- Protocol buffers as single source of truth. Proto files can be found under the
proto/
folder. - SQLC for type-safe code from SQL.