Chronicle Queue - Fastest Way to Pass Messages Between Two JVMs

Author: Shazin Sadakath


Chronicle Queue is similar to a low latency broker less durable/persisted JVM topic. The Latency is usually less than 100 Microseconds.

Chronicle Queue is a distributed unbounded persisted queue. Chronicle Queue:

Chronicle Queue is a Java project focused on building a persisted low-latency messaging framework for high performance and critical applications.

At first glance Chronicle Queue can be seen as simply another queue implementation. However, it has major design choices that should be emphasised.

Using non-heap storage options (RandomAccessFile), Chronicle Queue provides a processing environment where applications do not suffer from Garbage Collection (GC). When implementing high-performance and memory-intensive applications (you heard the fancy term "bigdata"?) in Java, one of the biggest problems is garbage collection.

Garbage collection may slow down your critical operations non-deterministically at any time. In order to avoid non-determinism, and escape from garbage collection delays, off-heap memory solutions are ideal. The main idea is to manage your memory manually so it does not suffer from garbage collection. Chronicle Queue behaves like a management interface over off-heap memory so you can build your own solutions over it.

Chronicle Queue uses RandomAccessFiles while managing memory and this choice brings lots of possibilities. RandomAccessFiles permit non-sequential, or random, access to a file’s contents. To access a file randomly, you open the file, seek a particular location, and read from or write to that file. RandomAccessFiles can be seen as "large" C-type byte arrays that you can access at any random index "directly" using pointers. File portions can be used as ByteBuffers if the portion is mapped into memory.

This memory mapped file is also used for exceptionally fast interprocess communication (IPC) without affecting your system performance. There is no garbage collection as everything is done off-heap.

Source Github



Tags: ChronicleQueue JVM Message
Views: 1341
Register for more exciting articles

Comments

Please login or register to post a comment.


There are currently no comments.