Overview
PeerNet is a scalable networking platform designed to deconstruct high-throughput event meshes. It leverages Kafka for distributed event processing and Redis for websocket synchronization, ensuring resilient real-time communication for social interactions.
The problem
Messages, likes and presence updates are high-frequency and have to reach every connected user quickly, even when those users are spread across different server instances.
The approach
Every interaction is an immutable event on Kafka. A Redis-backed Socket.IO adapter keeps connection state in sync across instances, so users on different nodes communicate as if they were on one.
- Kafka event sourcing
- Events are durable and replayable, so nothing is lost during traffic spikes.
- Redis socket orchestration
- Redis Pub/Sub lets Socket.IO scale horizontally across server instances.
- Async feed generation
- Consumers pre-compute feeds into Redis instead of running heavy join queries on read.
- Guaranteed delivery
- The event backbone keeps message delivery eventual and reliable even when the database lags.
Architecture
- Client
- Socket Layer
- Redis Adapter
- Kafka Events
- Consumers
- Event Propagation
- Distributed Sync
- Async Notifications
Features
- Realtime messaging infrastructure
- Kafka event-driven architecture
- Redis socket scaling
- Responsive social feed system
- Async notification processing
- Premium motion-based UI/UX
Challenges
- Scalable realtime synchronization
- Distributed event consistency
- Async message delivery architecture
Stack
- React
- TypeScript
- Node.js
- Socket.IO
- Kafka
- Redis
- MongoDB
Demonstrates
- Product Engineering
- Realtime Systems
- Event-Driven Architecture
- Backend Scalability