Space-Based Architecture: Linear scalability? High throughput? Low latency? Pedro Rodrigues – firstname.lastname@example.org
2AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Agenda Space-Based Architecture (SBA) intro: ▫ Main concepts & a bit of history SBA in practice ▫ Lessons learned SBA live ▫ Linear scalability: demo
3AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 What is SBA? “Space-Based Architecture (SBA) is a software architecture pattern for achieving linear scalability of stateful, high-performance applications using the tuple space paradigm.” @wikipedia
4AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Linear scalability “scalability: scalability is the ability to grow an application to meet growing demand, without changing the code, and without sacrificing the data affinity and service levels demanded by your users.” “linear scalability: the ability to grow as much as needed, at a fixed price per capacity unit” @The Scalability Revolution: From Dead End to Open Road
5AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Tuple Space Distributed memory model for interprocess coordination/communication. Memory contents: tuples ▫ e.g. (“Pedro”, “Sogyo”, 5) Memory is associative ▫ retrieval through template matching (e.g. (“Pedro”, ?Employer, ?YearsOfService))
6AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Tuple Space Operations available: ▫ in – atomic read and remove ▫ rd – atomic read ▫ out – write tuple into space ▫ eval – create new processes to evaluate tuples and write the results to the space
7AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013
SBA: A bit of history 1983 – Linda programming model, Tuple Space. – David Gelernter and Nicholas Carriero at Yale University 1998 – Jini, JavaSpaces – Sun Microsystems 2000 – GigaSpaces provides first commercial implementation of JavaSpaces 2000-2003 – SBA is born @GigaSpaces 2013 – GigaSpaces XAP 9.6.0
Linear scalability using Tuple Space: how? AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 8
9AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013
SBA: processing unit Processing Unit Service Service B Service A C Notify Take Write Messa ges Data Space
10 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013
SBA: linear scalability processing unit replication + sharding Processing Unit Processing Unit Processing Unit Processing Unit Service Processing Unit Service Service Service B Service A Service Service B Service C Service A Service B Service C Service A Service B C Service A B C Service A C Messa Spa Client ges Messa Messa ce Application Data ges Messa Data ges Pro Messa Space Data ges xy Space Data ges Space DataSpace Space
11 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013
SBA: fault tolerance primary and backup processing units Primary Processing Unit Backup Processing Unit Service Service Service Service B Service B Service A C A C Messa Messa ges ges Data Data Space Space
SBA in practice AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 13
14 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 SBA in practice: a project Disclaimer ▫ For secrecy reasons, no detailed information about the project can be provided.
15 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 SBA in practice: a project Client: ▫ Dutch governamental organisation Goal: ▫ Proof of concept of a system that extracts information in “real time” from data coming in from a large set of disparate data sources. Constraints: ▫ Number of data sources and the amount of incoming data is due to increase at a large pace in the near future.
16 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 SBA in practice: a project Team: ▫ @ful -time ▫ 1 architect ▫ 1 project manager ▫ 3 experienced developers with (almost) no previous experience with SBA ▫ @part-time ▫ 1 consultant with experience in SBA Duration: ▫ 7 months
17 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 SBA in practice: a project End Result: ▫ A working PoC ▫ … and guidelines to guarantee high-performance of the system to be built upon the deliverables of the PoC.
18 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 The project: lessons learned SBA is not difficult to grasp Involve people with SBA experience Keep learning Partitioning data is key ▫ do it badly and you’ll pay the price Size matters (when objects reach the mil ions) ▫ E.g. Calendar vs long, 432 bytes vs 8 bytes Perform (automatic?) integration tests in a cluster from the start
19 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 The project: lessons learned II Only write to disk if necessary If you have to write to disk, do it asynchronously (and in batches) Garbage Collection remains a challenge.
20 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 SBA Linear scalability: a demo
21 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013
SBA: demo Takes every message written into the space and writes back a new object. Processing Unit Can process a maximum of 1000 messages per second. MessageProcessor Client Spa Applicati ce Take Write on Pro xy 1. Writes a maximum Space of 30000 messages per second into the space. 2. Reads the number of messages processed after 10 seconds.
22 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Conclusion SBA offers a simplified programming model to build high-performance distributed systems SBA simplifies administration/monitoring SBA itself does not guarantee high-performance ▫ Linear scalability, low latency, high throughput can be achieved but only with care Beware: ▫ It remains a challenge to introduce SBA in an organisation used to work mainly with tier based solutions
23 AGILE SOFTWARE ARCHITECTURE SYMPOSIUM 2013 Take Home Message Give SBA a try if you’re dealing with data flood “write once, scale anywhere” seems more than a slogan