Staff Writer

Engineering at the Speed of Markets: Lessons from Building a High-Scale Trading Platform

In the world of broking applications, milliseconds matter. Whether it's delivering real-time stock prices or processing millions of trades, speed and reliability are paramount. At AngelOne, one of India's leading brokerage platforms, engineering excellence is at the core of enabling seamless, high-scale equity trading for its 22 million customers. In a recent talk at GIDS, Jyotiswarup Pai Raiturkar, CTO at AngelOne, shared key insights into the design patterns, architecture choices, and technical strategies that drive their platform.

The Scale of the Challenge

AngelOne's trading platform operates at breathtaking scale:

  • 3 million requests per second during peak trading times.
  • 10 million orders processed daily.
  • A million new customers onboarded every month.

With such high stakes, the platform must deliver real-time prices, maintain high availability, and withstand unpredictable challenges such as network failures or even natural disasters. "We operate in an environment where delays are unacceptable, and resilience is non-negotiable," said Jyotiswarup.

Design Patterns for High Availability and Performance

To meet these demands, AngelOne employs three critical design patterns that ensure scalability, reliability, and a seamless user experience.

1. Eggs and Baskets: Cell-Based Architecture

AngelOne’s platform uses a cell-based architecture, commonly known as sharding, to ensure scalability and fault isolation.

  • How It Works: Services are grouped into shards, replicated across multiple data centers. Users are mapped to specific shards, and this mapping is dynamic, updated daily to balance load and prevent hotspots.
  • Key Benefits:
    • Horizontal Scalability: New hardware can be added to handle a growing customer base.
    • Reduced Blast Radius: Failures in one shard affect only a subset of users.
    • Controlled Deployments: Canary deployments and blue-green strategies are easier to execute, minimizing risk.

“We can move a shard from one data center to another instead of migrating all 22 million users at once,” Jyotiswarup explained.

2. Always-On Availability

AngelOne’s trading app maintains functionality even in adverse conditions like network failures or spotty connectivity.

  • Client-Side Compute: By leveraging the phone’s local storage and compute capabilities, most data processing happens on the app itself.
  • Smart Caching: Decisions such as whether to show cached data or refresh it from the backend are made intelligently. For example, static data like a user’s position at the end of the trading day can be served locally.
  • Frameworks Used:
    • MVVM Architecture: Ensures clean separation of logic and UI.
    • Room (SQLite): Provides robust persistent storage for app data.

“Even if you’re driving through a tunnel, the app stays responsive. The front end and back end work in sync to create a delightful experience,” said Jyotiswarup.

3. External Distrust

Given its dependence on external exchanges and services, AngelOne assumes potential failures in third-party systems.

  • Per-Dependency Thread Pools: Isolate failures in external dependencies to prevent them from clogging the entire system.
  • Calculated Thread Pool Sizing: Thread pools are sized based on TPS (transactions per second) and SLAs of dependencies, ensuring efficient resource usage without overloading.
  • Key Principle: “Do the math. Don’t make the thread pool fat,” Jyotiswarup emphasized.

Strategic Choices in Technology

1. Language Selection

  • Go (Golang): AngelOne’s go-to language for back-end systems, chosen for:
    • Runtime efficiency.
    • Excellent concurrency support.
    • Predictable performance.
    • As an example, a Go routine stack is just 2 KB, allowing millions of routines in limited memory, compared to heavier threads in other languages.
  • Python: Used for batch processing and analytical tasks, leveraging its rich ecosystem for libraries like NumPy and Pandas.

2. Database Philosophy

AngelOne favors plain old SQL databases for their simplicity, transactional guarantees, and modern features like columnar indexing. “Engineers must justify why they can’t use SQL before exploring alternatives,” Jyotiswarup quipped.

3. Cross-Platform UI Development

  • AngelOne uses Svelte with WebView for cross-platform UI components, citing the advantages of server-side rendering for fast page loads.
  • Native code is reserved for performance-critical features on mobile.

Engineering for Resilience

Regulation adds another layer of complexity to AngelOne’s operations. As a regulated entity, the platform undergoes quarterly disaster recovery (DR) drills, where systems are intentionally disrupted to test their resilience. “We have to demonstrate to regulators that the system works even if wires are unplugged or entire servers fail,” Jyotiswarup said.

Lessons for Engineers

From his talk, several actionable takeaways emerged for engineering leaders:

  • Embrace Scalability with Design Patterns: Cell-based architecture and shard replication allow for horizontal scaling while maintaining fault isolation.
  • Optimize for the Edge: Use client-side compute and smart caching to enhance user experience, even under adverse conditions.
  • Distrust Dependencies: Assume external systems can fail and design your architecture to isolate these failures.
  • Use the Right Tools for the Job: Prioritize languages and databases that simplify concurrency and provide predictable performance.

Final Thoughts

Jyotiswarup Pai Raiturkar’s insights offer a blueprint for building high-scale, high-reliability systems in domains where performance is mission-critical. At AngelOne, engineering excellence is not just about speed; it’s about delivering a seamless and resilient experience in the face of extreme challenges.

For organizations looking to scale their platforms or build robust systems, AngelOne’s practices serve as a compelling example of how thoughtful design, smart technology choices, and operational discipline can make the difference.

As Jyotiswarup succinctly put it, “In equity trading, you have to be smart and fast. And engineering is all about making both happen.”

See Highlights

Hear What Attendees Say

PwC

“Once again Saltmarch has knocked it out of the park with interesting speakers, engaging content and challenging ideas. No jetlag fog at all, which counts for how interesting the whole thing was."

Cybersecurity Lead, PwC

Intuit

“Very much looking forward to next year. I will be keeping my eye out for the date so I can make sure I lock it in my calendar."

Software Engineering Specialist, Intuit

GroupOn

“Best conference I have ever been to with lots of insights and information on next generation technologies and those that are the need of the hour."

Software Architect, GroupOn

Hear What Speakers & Sponsors Say

Scott Davis

“Happy to meet everyone who came from near and far. Glad to know you've discovered some great lessons here, and glad you joined us for all the discoveries great and small."

Web Architect & Principal Engineer, Scott Davis

Dr. Venkat Subramaniam

“Wonderful set of conferences, well organized, fantastic speakers, and an amazingly interactive set of audience. Thanks for having me at the events!"

Founder of Agile Developer Inc., Dr. Venkat Subramaniam

Oracle Corp.

“What a buzz! The events have been instrumental in bringing the whole software community together. There has been something for everyone from developers to architects to business to vendors. Thanks everyone!"

Voltaire Yap, Global Events Manager, Oracle Corp.