5. GigaSpaces Evolution Single space Load Balance Partition & Replication SLA container Event Container NG Application Server PaaS Cloud 2000 2003 2005 2006 2007 2008 2009
6.
7.
8. Today’s Reality – Tier Based Architecture Separate technology implementation Bottlenecks in all areas where state is stored, architecture can’t scale linearly! Separate technology implementation Separate technology implementation bottlenecks bottlenecks
9. Traditional Architecture - path to complexity… (marktplaats.nl) Auction Owner Auction Service Bid Service Trade Service Info Service Timer Service Auction Service Bid Service Trade Service Info Service Timer Service T Bidder Validate Result Process Bid Bid Accepted Bid Result Process Trade Get Bid Result Place bid
10.
11.
12. There is a huge gap between peak and average loads
29. Processing Unit – Scalability Unit Single Processing Unit Processing Unit - Scaled Involves Config Change No code changes!
30. Processing Unit – High-Availability Unit Sync Replication Primary - Processing Unit Business logic – Active mode Backup - Processing Unit Business logic – Standby mode
31. Database Integration - Async persistency Sync Replication Primary - Processing Unit Business logic – Active mode Backup - Processing Unit Business logic – Standby mode Mirror Process ORM Initial Load Async Replication Async Replication
41. The POJO Based Data Domain Model @SpaceClass(fifo=true) public class Data { … @SpaceId ( autoGenerate = true ) public String getId () { return id; } public String setId ( String id ) { this .id = id; } public void setProcessed ( boolean processed ) { this . processed = processed; } public boolean isProcessed ( boolean processed ) { return this . processed; } } SpaceClass indicate that this is a SpaceEntry – SpaceClass includes classlevel attributes such as FIFO,Persistent… SpaceId used to define the key for that entry.
42. Data Processor Service Bean @SpaceDataEvent to be called when an event is triggered. public class DataProcessor{ @SpaceDataEvent public Data processData ( Data data ) { … data . setProcessed ( true ) ; //updates the space return data; } } Updates the data in the Space.
43. Wiring Order Processor Service Bean through Spring <bean id=" dataProcessor “ class="com.gigaspaces.pu.example1.processor.DataProcessor" /> <os-events:polling-container id="dataProcessorPollingEventContainer" giga-space="gigaSpace"> <os-events:tx-support tx-manager="transactionManager"/> <os-core:template> <bean class="org.openspaces.example.data.common.Data"> <property name="processed" value="false"/> </bean> </os-core:template> <os-events:listener> <os-events:annotation-adapter> <os-events:delegate ref=" dataProcessor "/> </os-events:annotation-adapter> </os-events:listener> </os-events:polling-container> The event Template The event Listener
44. Data Feeder public class DataFeeder { public void feed(){ Data data = new Data(counter++); data.setProcessed( false ); //feed data gigaSpace.write(data); } } Feed Data
47. Remoting – IDataProcessor Service API public interface IDataProcessor { // Process a given Data object Data processData(Data data); }
48. Remoting - DataProcessor Service @RemotingService public class DataProcessor implements IDataProcessor { public Data processData(Data data) { … data.setProcessed( true ); return data; } }
49. Remoting - Order Feeder public class DataFeeder { private IDataProcessor dataProcessor; public void setDataProcessor(…) { this .dataProcessor = dataProcessor; } public Data feed(){ Data data = new Data(counter++); // remoting call return dataProcessor.process (data) } }
66. Dynamic repartitioning and load sharing I SLA Driven Container Indexed Notify / Query template Notify / Query template Partitioned Space Partitioned Space Partitioned Space
67. Dynamic repartitioning and load sharing II SLA Driven Container SLA Driven Container Partitioned Space Partitioned Space Partitioned Space
74. Dynamic Partitioning = Dynamic Capacity Growth VM 1 ,2G GSC VM 3 , 2G GSC VM 2 ,2G GSC Max Capacity=2G Max Capacity=4G Max Capacity=6G In some point VM 1 free memory is below 20 % - it about the time to increase the capacity – lets move Partitions 1 to another GSC and recover the data from the running backup! Later .. Partition 2 needs to move… After the move , data is recovered from the backup VM 5 , 4G GSC VM 4 ,4G GSC P - Primary B - Backup P P P B B B E F Partition 1 A B Partition 2 C D Partition 3 A B Partition 2 E F Partition 1 C D Partition 3
Solution 1: Stored Procedures (not the best in every case. . .) Pros: Place logic and data together Faster processing Simpler management Cons: Inflexible With 99.999% how often can you modify your schema? Question: How do I live without my database?
Trainer will provide handouts with the architectural blueprints.
You don’t want to see this in the papers, do you?
Linda model 1992 David Gelernter and Nicholas Carriero Java, Sun Microsystems released in 1995 Sun introduced Jini in July of 1998
Use this slide to explain the space model. The space can be used to provide variety of middleware services under simple set of 4 API’s Explain how the four API’s can be used for: Caching Messaging (why there is no need for different implementation for both scenarios), Describe how content based routing is achieved Parallel processing – don’t put too much emphasize on that part at this stage – there is a separate slide on that