Back to Case Studies
Microservices 09/2024 — 11/2024 • Lead Project Developer

Stock Watch Platform — Microservices & Real-Time Streaming

Event-driven real-time stock monitoring architecture with Kafka & Keycloak

Executive Summary

Built a personal microservices platform focused on real-time stock price streaming, distributed caching, and Keycloak OAuth2 security.

The Problem

High-frequency price feed updates flooded primary databases and delayed user notifications during volatile market periods.

The Solution

Architected separate API and data microservices using Spring Boot, streaming price updates with Apache Kafka, caching active ticks in Redis, and pushing updates via WebSockets.

Architecture Specification

Spring Boot microservices, Kafka event bus, Redis memory cache, MongoDB document store, PostgreSQL relational ledger, Keycloak OAuth2 authentication server, and WebSockets.

Technical Decisions & Trade-offs

Applied Redis Cache Layer for Frequently Accessed Ticks
Rationale: Reduced database query load by 30% while serving sub-millisecond price lookups.
Implemented WebSockets for Real-Time Price Broadcasts
Rationale: Eliminated HTTP client polling overhead, pushing price changes to clients in real-time.

Business Impact & Results

  • Reduced database load by 30% using Redis caching.
  • Delivered instant sub-100ms real-time price updates via WebSockets.
  • Successfully implemented central OAuth2 authentication with Keycloak.

Lessons Learned

Separating API and data services allows event streaming pipelines to scale independently from authentication and user management.

TECHNOLOGY STACK
JavaSpring BootApache KafkaRedisMongoDBPostgreSQLKeycloakDockerWebSockets