14 Building a scalable mobile app with concurrent functional programming

 

This chapter covers

  • Designing scalable, performant applications
  • Using the CQRS pattern with WebSocket notifications
  • Decoupling an ASP.NET Web API controller using Rx
  • Implementing a message bus

Leading up to this chapter, you learned about and mastered concurrent functional techniques and patterns for building highly performant and scalable applications. This chapter is the culmination and practical application of those techniques, where you use your knowledge of TPL tasks, asynchronous workflow, message-passing programming, and reactive programming with reactive extensions to develop a fully concurrent application.

The application you’re building in this chapter is based on a mobile interface that communicates with a Web API endpoint for real-time monitoring of the stock market. It includes the ability to send commands to buy and sell stocks and to maintain those orders using a long-running asynchronous operation on the server side. This operation reactively applies the trade actions when the stocks reach the desired price point.

Discussion points include architecture choice and explanation of how the functional paradigm fits well in both the server and client sides of a system when designing a scalable and responsive application. By the end of this chapter, you’ll know how to design optimal concurrent functional patterns and how to choose the most effective concurrent programming model.

14.1 Functional programming on the server in the real world

14.2 How to design a successful performant application

14.2.1 The secret sauce: ACD

14.2.2 A different asynchronous pattern: queuing work for later execution

14.3 Choosing the right concurrent programming model

14.3.1 Real-time communication with SignalR

14.4 Real-time trading: stock market high-level architecture

14.5 Essential elements for the stock market application

14.6 Let’s code the stock market trading application

14.6.1 Benchmark to measure the scalability of the stock ticker application

Summary