This document summarizes a live demo that shows how to achieve fault tolerance in JEE/Spring applications using GigaSpaces components. The demo uses a standard web application stack with an in-memory data grid to boost performance, reduce database load, and isolate database failures. It demonstrates how data is still available even when the database is disconnected by adding new owner data to the grid, then shows the data is not persisted until the database is reconnected and healed.
7. Isolation of DB failureIn-Memory Data Grid Network Load-Balancer Database (Commodity, Background) Web Container/ App Server
8. How to Experience Database Failover? Step 1 – Deploy the demo on the cloud Step 2 – Add some data Step 3 – Experience database failure Step 4 – Witness system healing from data crash
12. Add a Pet Owner Click View PetClinic(allow pop-ups if necessary) Click Find Owner Click Add OwnerFill in the details of your imaginary pet owner
13. Validate Addition of Pet Owner Click HomeClick Find Owner Click Find Owners button Validate the addition of the new pet owner
14. Validate Data Persistency Click Database(follow plug-in instructions) When MySQL opens, type: select * from owners; Ensure the new pet owner is listed
15. Step 2 Recap The new pet owner is added to: The In-Memory Data Grid The Database
17. Database Connection Failure Disconnecting the database does not affect the end-user experience In-Memory Data Grid Network Load-Balancer Database (Commodity, Background) Web Container/ App Server See it for yourself! Instructions are next…
18. Disconnect Database (Simulating Failure) Locate the Database machine Click the Block Network button (located to the right) The machine is rebooted and data connections are blocked!
19. Add a Pet Owner Click HomeClick Find Owner Click Add OwnerFill in the details of yet another pet owner A new owner was added to the IMDG, but NOT to the database! (database is disconnected)
20. Validate Data Availability Despite DB Failure Click HomeClick Find Owner Click Find Owners button Validate the addition of the new pet owner
21. Validate Owner Data Was NOT Persisted Make sure 30 seconds have passed since blocking network, to give the database machine time to reboot. Re-open the MySQL windowand type: select * from owners; Ensure the new pet owner does NOT exist
22. Step 3 Recap Disconnected database Added a new owner Entry was added to the In-Memory Data Grid, but NOT to the database! Application runs as usual despite database failure!
23. STEP 4 – WITNESS SYSTEM RECOVERY FROM DATABASE FAILURE
24. Restoring Database Connection Restoring database connection and data persistency is initiated automatically In-Memory Data Grid Network Load-Balancer Database (Commodity, Background) Web Container/ App Server Instructions are next…
25. Restore Database Locate the Database machine.Click the Unblock Network button. Wait a few seconds for the database to be updated.
26. Validate Data Persistency Switch to MySQL and type: select * from owners; Ensure the new pet owner is listed
27. What Did this Demonstration Show? A standard web application that maintained availability despite a database failure The application was not affected by either the database failure OR restoration
28. Thank you! Download the demo source code to run on your machine:http://www.openspaces.org/display/DAE/GigaSpaces+PetClinic