The Sequencer Architecture and Why Financial Firms Love It

CoralSequencer implements the sequencer architecture, a messaging architecture widely used by financial firms to build deterministic distributed systems. Its core idea is simple: all nodes read all messages in the exact same order, always. From that single rule, the system gets consistency, replayability, high availability, and a clean way to evolve many independent services without losing a single authoritative timeline. Continue reading

Why Manual Failover for the Sequencer is a Design Choice?

The CoralSequencer architecture uses manual failover for the primary sequencer by design. That choice is not an omission and it is not a limitation. It is a deliberate trade-off. It keeps the normal message path as fast, simple, and deterministic as possible, and handle the rare leader failure with an informed operational decision, rather than with something that adds coordination cost to every message. In this article we’ll explain why manual failover can be preferable to automatic leader election for the high-performance primary sequencer. Continue reading

On-Premises and Cloud Infrastructure with CoralSequencer

CoralSequencer supports multiple transport protocols, offering flexibility when building on-premises and cloud infrastructures. You can use UDP, multicast or unicast, TCP, or a combination of both to design your infrastructure in the way that best fits your needs, whether on-premises, in the cloud, or across both. Continue reading

HotSpot, JIT, AOT and Warm-Up

The HotSpot JVM takes some time to profile a running Java application for hot spots in the code and then optimizes by compiling (to assembly) and inlining (when possible) these hot spot methods. That’s great because the JIT (just-in-time) compiler can surgically and aggressively optimize the parts of your application that matter the most instead of taking the AOT (ahead-of-time) approach of compiling and trying to optimize the whole thing beforehand. Continue reading

Exploring the Sequencer Architecture through our SimSequencer

SimSequencer is a framework that lets you simulate through code the majority of the aspects of the sequencer architecture without any networking involved. It can be very useful for prototyping, testing and learning purposes. With SimSequencer you can code your nodes to test all the moving parts of your application as they were running and interacting in a real distributed system. And it has the same API of CoralSequencer. Continue reading

Writing a C++ CoralSequencer Node

Writing some C++ code that gets called by your Java code is trivial through shared libraries but a more interesting project is to do the inverse: to call Java code from a C++ system. In this article we write a C++ CoralSequencer node to perform a latency benchmark test. Continue reading

Performance Analysis: comparing C++ and Java

In this article we write two equivalent programs in C++ and in Java, in exactly the same way to do exactly the same thing: the (in)famous bubble sort algorithm. Then we proceed to measure the latency. On this experiment, Java was faster than C++ even with the -O3 compiler option. Continue reading

Shared Memory Transport x Multicast Transport

A CPU core is a scarce resource in high demand from all the different process running on a computer machine. When you are choosing how to allocate your nodes to available CPU cores, CoralSequencer gives you the option to run several nodes inside the same NioReactor thread, which in turn will be pinned to an isolated CPU core. As the number of nodes inside the same CPU core grows, fan-out might become an issue affecting latency, as now the thread has to cycle through all nodes as it reads multicast messages from the event-stream. In this article we explain (with diagrams) how you can deal with that scenario by choosing CoralSequencer’s shared-memory transport instead of multicast at the node machine level. Continue reading

CoralSequencer’s structured data serialization framework (Version 2.0)

CoralSequencer uses its own binary and garbage-free serialization framework to read and write its internal messages. For your application messages, you are free to use any serialization library or binary data model you choose. The fact that CoralSequencer is message agnostic gives you total flexibility in that decision. But you can also consider using CoralSequencer’s native serialization framework described in this article. Continue reading

Building a first-class exchange architecture with CoralSequencer

In this article we will explore an architecture employed by some of the most sophisticated electronic exchanges, the ones that need to handle millions of orders per day with ultra-low-latency and high-availability. Most of the exchange main architecture components will be presented as CoralSequencer nodes and discussed through diagrams. The goal of this article is to demonstrate how a total-ordered messaging middleware such as CoralSequencer naturally enables the implementation and control of complex distributed system through a tight integration of all its moving parts. This article doesn’t mention specifics about any exchange’s internal systems and instead talks about the big picture and the general concepts, which will vary from exchange to exchange. Continue reading