Overview
Plamatio is a production-ready E-commerce store focused on Llama-inspired products. This e-commerce store was built as part of my portfolio projects for demonstration of some cutting-edge technologies in building a highly performant, scalable, and resilient backend that composes of a robust Go-lang written REST API with PostgreSQL databases, Kafka-based real-time data streaming, Redis cache system, backend system monitoring and observability through Grafana, and more.
Primary Features
- Distributed REST API: Plamatio backend consists of multiple distributed modularized REST API services, each with its Redis cache and PostgreSQL database. This distributed architecture allows for maximal scalability, reduced development and maintenance complexity, and increased productivity in fixing issues and releasing feature updates.
- PostgreSQL Database + Redis Cache: Low-latency request processing pipeline architected with a robust PostgreSQL database (with special indexes) and a distributed, responsive and scalable Redis-based cache for frequently accessed API endpoints.
- API-key Authenticated Endpoints: Simple API-key based authentication for most of the endpoints, reducing overhead and request processing time for both frontends and the backend, without compromise on security.
- Kafka-powered Real-time Data Streaming: Using Confluent-based Kafka services for architecting a real-time data streaming pipeline to not only provide a scalable solution for real-time updates on data mutations but also to enhance capturing of interactions and events on any number of frontends.
- Grafana: Using Grafana Cloud for enchanced monitoring and observability going beyond basic logging, metrics collection and analysis, and API request tracing.
- Encore Cloud: Using Encore Cloud for hosting backend application, secrets management, PostgreSQL database hosting, Redis hosting, and resource provisioning.
Below image provides a high level overview of the primary components of the Plamatio Backend Infrastructure.
Project Structure
Plamatio backend is built using the Encore.go Backend Framework.
Project is structured in a way that reduces complexity and increases productivity. Since, Encore enables you to build distributed API services, dependency between each service is minimal.
There are five key services that Plamatio Backend exposes: Products, Categories, Cart, Orders, Users.
For each of these services, there are four key folders:
api
: contains the core REST API endpoints defintions and code.
db
: contains and abstracts methods required to interact with the required table(s) in the PostgreSQL database.