An event-driven microservices-based distributed e-commerce example application written in Golang. (mouthful)
This project was originally built as an experiment with event-driven architecture. But I hope it can future serve as a beneficial demonstration of utilising the architecture and exemplify the implementation of some other miscellaneous microservice patterns.
Any ideas, suggestions or direct contributions to better conform with general and evolving industry practices are welcome and will be greatly appreciated, as I'd like for this project to evolve to the stage of being somewhat a reflection of a production-ready enterprise application.
- Monorepository layout
- Microservice architecture
- Event-driven architecture
- Interfacing with services using gRPC
- User-facing RESTful HTTP APIs with gRPC-Gateway
- Distributed tracing with OpenTelemetry
- Transactional outbox pattern with Debezium
- API gateway pattern using Envoy
- Distributed transactions utilising the saga pattern
As this project is licensed under the GNU Affero General Public License v3, copying, templating or referencing code from this project may violate international copyright law unless your project is using a compatible open-source license. Please ensure any implementation in your own projects is original and complies with applicable licenses and laws.
In the nature of open-source software, please consider contributing and giving back to the project to help make it better for the greater community, especially if you see it as a useful learning resource.
-
API Tooling
-
Client Libraries
-
Protobuf Libraries
-
Tools
-
Miscellaneous
- Message Brokers
- Databases
- Miscellaneous
- Provisioning and Deployment
- Docker and Docker Compose
Name | gRPC (w/ Gateway) | Produces Events | Consumes Events |
---|---|---|---|
auth | ✔️ | ❌ | ✔️ |
order | ✔️ | ✔️ | ✔️ |
payment | ✔️ | ✔️ | ✔️ |
product | ✔️ | ✔️ | ✔️ |
shipping | ✔️ | ✔️ | ✔️ |
user | ✔️ | ✔️ | ❌ |
warehouse | ✔️ | ✔️ | ✔️ |
Each service is prepared by a service-init
container; a deployment responsible for performing any database migrations and configuring Debezium outbox connectors for that service.
The events are schemed and serialised using protocol buffers. They are dispatched using the transactional outbox pattern, with Debezium used as a relay to read and publish events from database outbox tables to the message broker.
Further documentation on the events can be found at /docs/EVENTS.md
The application can be deployed using Docker Compose (with the compose files located in /deploy/docker/
). Ensure the correct configuration is in place by copying and removing .example
from the end of the example environment files located in /deploy/configs/
.
Deploy using the following command: docker compose -f deploy/docker/compose.yaml -f deploy/docker/compose.override.yaml up --build
If you like this project then please leave a ⭐ to show your support. All forms of feedback and contributions are welcome and greatly appreciated!
Have any ideas for improvements? Please don't hesistate to open an issue to discuss, or a pull request with enhancements.
This project is licensed under the GNU Affero General Public License v3.