After introducing to you space based architecture in my previous post, it is now time for some general principles of this approach.
Ready? Let's start with a visualization…
• Data maintained in reliable memory
• Condense messaging and data layers into ONE
• Business logic becomes loosely-coupled services that interact and share data through the Space
• Co-locate data, messaging, business logic
Figure 1. Processing unit a self sufficient unit of work
Processing unit is the basic unit of work in SBA architecture.
Processing unit includes messaging, data and business logic collocated under the same process.
The diagram above outlines how these components interact with each other:
Incoming feeds/user-requests come through the messaging component – the messaging component queues those requests to ensure a FIFO-based order of execution. A, B and C are the business logic components which are written as loosely coupled services and represent a workflow, i.e. each feed/request needs to go through stage A first followed by B and C. An example of such a workflow would be A-parsing (formatting of the incoming feed from its original format to an optimized format, in trading application this would be parsing and validation of fixed messages into binary objects), B-Matching – (this is where the order needs to match the existing trade) and C-Routing (this is how the result is communicated to the backend systems and to the end user.) In analytics applications A-would normally represent the ETL (Extract, Transfer and Load) stage, B-Analytics process, C-Generation of the output report. The state (Context) of execution is stored in the IMDG (In-Memory Data Grid) – The IMDG takes an equivalent role as the database. However the fact that it can be collocated and In-memory ensures that it will be highly scalable and efficient. The nice thing with IMDG is that it can still be synchronized with external and existing database systems and basically act as a high-performance front-end to those systems.
Scaling it out…
Figure 2. Partition and virtualize the entire application stack
The scaling-out works simply by adding processing units as needed. Since each unit is self sufficient there is no contention between the units and therefore if one unit can handle 1000 orders/sec two can handle 2000 and so forth.
Simple, isn't it? In my next post I'll present to you some FAQs about the SBA model.