Ultra low latency Event Store

Overview


There are two basic libraries for managing data in Java, JDBC (for connecting to database) and JMS (for messaging). For some use cases you ideally want both, and you want it to be very fast.

History

This is a redevelopment of a previous project HugeCollections The project is still on hold because its too complex IMHO for what it does. This library is lower level and much simpler to understand. It may become the basis for the higher level HugeCollections library.

The Java Chronicle Library

This library attempts to provide ultra low latency, high throughput, persisted, messaging and event driven in memory database with random access to previous messages) The typical latency is as low as 80 nanoseconds (between processes), supporting throughputs of 5-20 million messages per second.

Technical Features

  • It uses almost no heap with trivial GC impact regardless of size, 
  • It can be much larger than your physical memory size (only limited by the size of your disk). and can be shared *between processes* with better than 1/10th latency of using Sockets over loop back. 
  • You can attach any number of readers, including tools to see the exact state of the data externally. e.g. I use; od -t cx1 {file} to see the current state. 

It can change the way you design your system because it allows you to have independent processes which can be running or not at the same time (as no messages are lost) This is useful for restarting services and testing your services from canned data. e.g. like sub-microsecond durable messaging. 

Modes of use

The library can be used in two modes. You can use it as an event driven persisted journal but polling when new excepts are added, or as a re-writable random access store but accessing it randomly and changing what you want. If you want both, you need two chronicles, one to be updated with the latest values and one to notify events.
The main limitations are that it only designed for one writer, and "extracts" or records cannot be made larger once they are written.

Download or Browse the Java Chronicle Library

Comments

  1. Peter,

    The Chronicle library looks very interesting indeed. I look forward to trying it one day (hopefully some time soon).

    P.S. Are you planning to attend QCon London this year?

    ReplyDelete
  2. QCon London, would have been nice. By the time I have made my mind up for conferences, the tickets are gone. ;) As it is this week will be very busy for me so perhaps it will be for the best.

    ReplyDelete
  3. @aix, I am going to the LJC Meeting at QCon on Thursday evening.

    ReplyDelete
  4. Hi Peter,

    This is fantastic piece of code.

    I want to understand the internals of "Java Chronicle" but I'm not a Java fan (nor expert).

    From where I can start please? Is there any detailed explanations somewhere?
    Do you think I can re-implement its core in Python?

    Thx
    Mica

    ReplyDelete

Post a Comment

Popular posts from this blog

Java is Very Fast, If You Don’t Create Many Objects

Low Latency Microservices, A Retrospective

Unusual Java: StackTrace Extends Throwable