Skip to content

Design Principles

mjpt777 edited this page Nov 2, 2014 · 20 revisions

To achieve low-latency with minimal variance, while achieving high throughput, it is important to define a set of design principles that guide the development. When a trade off is required then the design principles help guide the decision in choosing between competing alternatives.

Many design principles come to bear on any implementation. Not all design principles require trade-offs but many do. The following set of design principles are key to the design of Aeron and the likely to drive most trade-offs. When two or more design principles conflict with each other then the one with the highest rank wins.

  1. Garbage free in steady state running
  2. Apply Smart Batching in the message path
  3. Wait-free algorithms in the message path
  4. Non-blocking IO in the message path
  5. No exceptional cases in the message path
  6. Apply the Single Writer Principle
  7. Prefer unshared state
  8. Strict Separation of Concerns
  9. Avoid unnecessary data copies

When talking about the "message path" we are referring to the path taken through Aeron by data messages sent from a publisher to a subscriber, and not any internal messages Aeron may use for it operational purposes.

Garbage free in steady state running

Garbage collection pauses are one of the biggest causes of latency in a virtual machine. The best cases for these pauses are just under a millisecond which is a significantly longer duration than the round trip time being two computers over a local area network. Aeron should not contribute to GC pauses and thus makes it a candidate to be included in an application that carefully manages its own allocation.

Apply Smart Batching in the message path

Communications traffic tends to be very bursty in nature. To mitigate the queuing latency introduced by burst traffic then Smart Batching should be employed to amortise the expensive costs within an algorithm.

Wait-free algorithms in the message path

Stuff

Non-blocking IO in the message path

Stuff

No exceptional cases in the message path

Stuff

Apply the Single Writer Principle

Stuff

Prefer unshared state

Stuff

Strict Separation of Concerns

Stuff

Avoid unnecessary data copies

Stuff