Chapter 11. Building Real-Time Apps and Services

Throughout the book we have been looking at various ways microservices accept input and produce output. We’ve seen the traditional RESTful services and we’ve seen services that consume and produce messages in queues.

Users of modern web and mobile applications often demand more than the eventual consistency we discussed in Chapter 6 (ES/CQRS). They want to know about things that are important to them, and they want to know about them immediately.

This brings us to the topic of this chapter: real-time services. This chapter will discuss what the phrase “real-time” means and the types of applications most consumers consider to be within that category. Then we’ll look at websockets and how traditional websocket programming models fall short in the cloud, and build a sample real-time application that demonstrates the power of adding real-time messaging to an event-sourced system.

Real-Time Applications Defined

Before we can define a real-time application we need to define real-time. Just like the term microservices, real-time is overloaded, overused, and usually has at least two different meanings for every person in the room discussing it.

Definithing.com defines it as:

A term used to describe computer systems that update information at the same rate as they receive data.

Other definitions of real-time suggest that something is real-time if it can process input and produce output within a few milliseconds. To me this seems like ...

Get Building Microservices with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.