Demonstrates real-world backend architecture using multiple databases in a single system
A single Express.js API powered by multiple databases, each chosen deliberately based on its strengths.
Built to understand database design decisions from first principles, not just syntax.
Different problems require different data models.
Instead of forcing one database to do everything, this system uses polyglot persistence —
choosing the right database for each use case.
| Database | Responsibility | Why |
|---|---|---|
| PostgreSQL | Users, Orders, Payments | ACID transactions, strong consistency |
| MongoDB | Product Catalog | Flexible schema |
| Redis | Sessions, Caching | TTL-based expiry, ultra-fast |
| Cassandra | Activity Logs | High write throughput |
| Neo4j | Recommendations | Graph traversal |
"What are your access patterns?"
- Transactions → PostgreSQL
- Flexible data → MongoDB
- Speed → Redis
- High writes → Cassandra
- Relationships → Neo4j
| Endpoint | Database | Description |
|---|---|---|
| POST /auth/login | Redis | Session with TTL |
| GET /users/:id | PostgreSQL | Indexed read |
| GET /products | MongoDB | Flexible schema |
| POST /orders | Multi-DB | Transaction + logs + graph |
| POST /activity | Cassandra | Event logging |
| GET /recommend/:userId | Neo4j | Graph traversal |
When placing an order:
- PostgreSQL → transaction
- Cassandra → logging
- Neo4j → relationship update
Explore complete API flows, screenshots, and explanations:
This project was built in phases — each database explored in depth:
- 🔗 https://satyam-dev-7.vercel.app/blog/why-i-built-one-app-with-six-databases
- 🔗 https://satyam-dev-7.vercel.app/blog/postgresql-indexes-deep-dive-polyglotdb-phase-1
- 🔗 https://satyam-dev-7.vercel.app/blog/acid-transactions-postgresql-polyglotdb-phase-1
- 🔗 https://satyam-dev-7.vercel.app/blog/redis-is-not-a-database-its-a-decision
- 🔗 https://satyam-dev-7.vercel.app/blog/why-mongodb-exists-and-when-its-the-wrong-choice
- 🔗 https://satyam-dev-7.vercel.app/blog/cassandra-thinking-in-queries-not-tables-polyglotdb
docker compose up -d
node src/index.js



