Reader small image

You're reading from  Building Low Latency Applications with C++

Product typeBook
Published inJul 2023
PublisherPackt
ISBN-139781837639359
Edition1st Edition
Right arrow
Author (1)
Sourav Ghosh
Sourav Ghosh
author image
Sourav Ghosh

Sourav Ghosh has worked in several proprietary, high-frequency algorithmic trading firms over the last decade. He has built and deployed extremely low latency, high-throughput automated trading systems for trading exchanges around the world, across multiple asset classes. He specializes in statistical arbitrage market-making and pairs trading strategies with the most liquid global futures contracts. He is currently the vice president at an investment bank based in São Paulo, Brazil. He holds a master's in computer science from the University of Southern California. His areas of interest include computer architecture, FinTech, probability theory and stochastic processes, statistical learning and inference methods, and natural language processing.
Read more about Sourav Ghosh

Right arrow

Designing Some Common Low Latency Applications in C++

In this chapter, we will look at some applications in different fields from video streaming, online gaming, real-time data analysis, and electronic trading. We will understand their behavior, and what features need to be executed in real time under extremely low-latency considerations. We will introduce the electronic trading ecosystem, since we will use that as a case study in the rest of the book, and build a system from scratch in C++, with a focus on understanding and using low latency ideas.

In this chapter, we will cover the following topics:

  • Understanding low latency performance in live video streaming applications
  • Understanding which low latency constraints matter in gaming applications
  • Discussing the design of Internet-of-Things (IoT) and retail analytics systems
  • Exploring low latency electronic trading

This chapter’s goal is to dig into some of the technical aspects of low latency applications...

Understanding low latency performance in live video streaming applications

In this section, we will first discuss the details behind low latency performance in the context of video streaming applications. We will define the important concepts and terms relevant to live video streaming to build an understanding of the field and business use cases. We will understand what causes latencies in these applications and the business impact of those. Finally, we will discuss technologies, platforms, and solutions to build and support low latency video streaming applications.

Defining important concepts in low latency streaming

Here, we will first define a few important concepts and terms when it comes to low latency streaming applications. Let us get started with a few basics and build up from there into more complex concepts.

Latency in video streaming

Video streaming is defined as audio-video content delivered in real time or near real time. Latency in general refers to the time...

Understanding what low latency constraints matter in gaming applications

Video gaming has evolved greatly since it was first born in the 1960s and, these days, video games are not about playing alone or even playing along with or against the person physically next to you. These days, gaming involves many players all over the globe, and even the quality and complexity of these games have increased tremendously. It is no surprise that ultra-low latency and high scalability are non-negotiable requirements when it comes to modern gaming applications. With new technologies such as AR and VR, this only further increases the need for ultra-low latency performance. Additionally, with the advent of mobile gaming combined with online gaming, complex gaming applications have been ported to smartphones and need ultra-low latency content delivery systems, multiplayer systems, and super-fast processing speeds.

In the previous section, we discussed low latency real-time video streaming applications...

Discussing the design of IoT and retail analytics systems

In the previous chapter, we discussed IoT and retail analytics and many of the different use cases that they create. Our focus in this section will be to have a brief discussion about the technologies being used to achieve low latency performance for these applications and use cases. Note that IoT is a technology space that is still actively growing and evolving, so there are going to be a lot of breakthroughs and advancements in the coming years. Let us quickly recap some important use cases of IoT and retail data analytics. A lot of these new applications and future possibilities are fueled by the research and advancements in 5G wireless technology, edge computing, and artificial intelligence (AI). We will look at those aspects in the next section, along with other technologies that facilitate applications using low latency IoT and retail data analytics.

A lot of applications fall under the remote inspection/analysis category...

Exploring low latency electronic trading

The final example of low latency applications is the applications used in low latency electronic trading and ultra-low latency electronic trading, also known as HFT. We will build a full end-to-end low latency electronic trading system from scratch in C++ in the rest of this book. So, in this section, we will briefly discuss the important considerations for electronic trading applications to achieve low latency performance and then build out the low-level details in the remaining chapters. Developing High-Frequency Trading Systems by Sebastian Donadio, Sourav Ghosh, and Romain Rossier would be an excellent book for understanding low latency electronic trading systems in greater detail for interested readers. Our focus in this book will be to design and build each component from scratch in C++ to learn about low latency application development, but that book can be used as a good reference for the additional theory behind the HFT business.

...

Summary

In this chapter, we looked at different low latency applications in different business areas. The goals were to understand how low latency applications impact businesses in different areas and the similarities that some of these applications share, such as the hardware requirements and optimization, software design, performance optimization, and different revolutionary technologies being used to achieve these performance requirements.

The first applications we looked at in detail were real-time, low latency, online video streaming applications. We discussed different concepts and investigated where high latencies come from, and how that affects performance and businesses. Finally, we discussed different technologies and solutions, and platforms that facilitate low latency video streaming applications to be a success.

The next applications we looked at had a lot of overlap with video streaming applications – offline and online video gaming applications. We introduced...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Building Low Latency Applications with C++
Published in: Jul 2023Publisher: PacktISBN-13: 9781837639359
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Sourav Ghosh

Sourav Ghosh has worked in several proprietary, high-frequency algorithmic trading firms over the last decade. He has built and deployed extremely low latency, high-throughput automated trading systems for trading exchanges around the world, across multiple asset classes. He specializes in statistical arbitrage market-making and pairs trading strategies with the most liquid global futures contracts. He is currently the vice president at an investment bank based in São Paulo, Brazil. He holds a master's in computer science from the University of Southern California. His areas of interest include computer architecture, FinTech, probability theory and stochastic processes, statistical learning and inference methods, and natural language processing.
Read more about Sourav Ghosh