Building a Microservices Ecosystem: Stock Brokerage Simulator (My Broker B3)

Published: (March 13, 2026 at 09:46 PM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Hello, everyone!

I’m starting a series of articles to document the development of My Broker B3. This personal project applies advanced software engineering concepts, distributed systems, and messaging to simulate the real‑world operations of a stock brokerage. The main objective is to create an ecosystem that handles challenges such as data consistency, low latency, and asynchronous communication, while integrating a simplified matching engine.

System Architecture

The project follows a microservices approach, using a hybrid stack to leverage the strengths of each ecosystem:

  • Core Backend (Java/Spring Boot 3) – Provides the order (broker-order-api), wallet (broker-wallet-api), and asset management (broker-asset-api) APIs.
  • Market Data (Python) – An integrator (broker-market-data-api) that manages market‑data ingestion via scheduled tasks.
  • Matching Engine (Java) – A B3 simulator (b3-matching-engine-api) that processes the execution of orders sent by the brokerage.

Data Flow and Technologies

A hybrid communication strategy ensures resilience and scalability.

Synchronous (REST)

Used for critical real‑time validations, such as verifying the wallet balance before allowing an order to be sent.

Asynchronous (Event‑Driven)

  • Apache Kafka – Acts as an internal event bus for distributing market quotes and asset‑related events.
  • RabbitMQ – Manages the communication between the Broker and the B3 Simulator through dedicated queues.

Persistence and Caching

Each service uses the data store that best fits its purpose.

TechnologyUse Case
MySQL / PostgreSQLTransactional data, orders, and wallet history.
MongoDBMarket quotes history (time‑series data) within the Market Data API.
Redis“Hot” cache for market prices to ensure ultra‑high‑speed queries.

Technical Draw

Technical diagram of the microservices ecosystem

What’s Next?

This post is just the kickoff. Upcoming articles will detail:

  • Infrastructure – Deploying all resources on AWS (Free Tier).
  • Messaging – Deep dive into Kafka and RabbitMQ configurations.
  • Technical Challenges – Handling eventual consistency and the matching engine’s processing logic.

Feel free to leave your feedback or questions in the comments!

0 views
Back to Blog

Related posts

Read more »

Travigo

Travel as fast as you speak with Gemini! Where live agents meet immersive storytelling & 3D navigation. This project was created for entering the Gemini Live Ag...

Micro games

Hey Gamers! 👾 As part of the Rapid Games Prototyping module, we are tasked with reviewing a peer's game. The challenge is to analyse a prototype built in just...