DEV Community

Cover image for System Design: Stock Exchange
Daniel
Daniel

Posted on

11

System Design: Stock Exchange

How would you design a Stock Exchange meant to operate at scale?

Estimated Usage

  • 500 million order per day
  • Uniform usage throughout the day
  • 200 listed companies on the market
  • 1:1 Buy to Sell orders

Functional Requirements

  • Users should be able to put in orders to buy or sell
  • Users should be able to cancel orders
  • Buy orders should be matched to sell orders with the same price if they exist
  • User accounts have a balance where they have to preload funds in order to place a buy order
  • User should be able to check the current price

Nonfunctional Requirements

  • 99.999% reliability
  • Price checks need to be updated within 3000 milliseconds

Try to submit your solution on LeetDesign, share the link in the comments and I'll give you feedback on how you did!

An image of the problem

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (1)

Collapse
 
bigbeard profile image
ShinJustinHolly3317

No sharing here?😢

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay