Pages

Friday, May 10, 2019

Space Based Architecture





Like CQRS (Command Query Responsibility Segregation), this architecture is used for high scalability and performance.
In a typical setup there is usually a client, an application server and a database. Whenever load increases, we can increase the number servers handling the client requests, once we fix that we soon find that the application server handing all the business logic is now the bottleneck. Once we scale that up we are pass the bottleneck on to the database.
Unlike the previous layers, scaling up the database is very tough. Databases are not really meant to be scaled. Sure, there are solutions out there which try to address this, but it’s difficult and expensive.
This pattern tries to address that bottleneck – the database. In this architecture, there are 5 components:
  1. Processing Unit
  2. Middle ware
    1. Message grid
    2. Data Grid
    3. Processing Grid
    4. Deployment Manager
The processing unit is the component which houses the business application. Its complete with it’s own persistence store (the database) and is self sufficient.
Message Grid is responsible for orchestrating the various requests from client to the different processing units.
Data Grid: It’s responsible for keeping the data in sync within all the individual persistence stores in the processing units.
Processing Grid: Often the request is split between multiple processing units to get even better throughput. Processing grid is responsible for this.
Deployment Manager: As the load increases, it’s responsible for spawning up more processing units. Similarly when the load decreases, it’s responsible for getting the number of processing units down.
The reason why this architecture effectively solves the database bottleneck problem is that in this solution there is no common repository. Every processing unit has it’s persistence store. So the database never becomes a bottleneck here.
Also, as the load increases/decreases, the system scales accordingly.
So, both CQRS and Space Based Architecture support scalability by having multiple instances of the databases. The Space Based Architecture scales the system dynamically based on the load, however, with this additional power comes the additional complexity. If the load fluctuates a lot, then Space Based Architecture is the better option.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.