I built a real time notification microservice with NestJS, Redis, PostgreSQL, and Docker.
When you are building a system that needs to deliver notifications instantly, a simple REST API is not enough. You need a system that is fast, reliable, and does not collapse when traffic spikes. That is the problem this microservice solves.
The foundation is NestJS with TypeScript. Everything is modular, everything has a clear responsibility, and the codebase scales without becoming a mess.
The first serious architectural decision was Redis. In this system, Redis powers the job queue through Bull. When a notification request comes in, it does not get processed immediately. It goes into a queue stored in Redis and a processor picks it up and handles it. The API responds instantly, the system never gets overwhelmed, and every notification gets processed without anything getting lost. Redis is not just a cache. In this system it is the backbone of the entire asynchronous processing layer.
The notifications are stored permanently in PostgreSQL. Every notification has a type, a read status, a timestamp, and belongs to a specific user. You can filter by read status, filter by notification type, and get an unread count, all from a well structured database.






