GigaSpaces pet clinic demo

Preview:

DESCRIPTION

GigaSpaces pet clinic demo ..

Citation preview

Live Demo

Achieving Fault Tolerance in Your JEE/Spring App

In this Demo

How GigaSpaces XAP guarantees continuous

High Availability even under Database Failure

Use of a popular standard web application

stack

GigaSpaces Components:

•Load balancer agent

•Web container

•In-Memory Data Grid

Application High Level Architecture

Database (Commodity, Background)

Network Load-Balancer

Web Container/ App Server

In-MemoryData Grid

Data Grid used for:

- Performance boost- Reduction of DB

load- Isolation of DB

failure

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

STEP 1 – DEPLOY THE DEMO ON THE CLOUD

Deploy The Pet Clinic

1. Click Deploy

2. Wait until application status:

Expected waiting time: ~7 min

Deployed

STEP 2 – ADD SOME DATA

Add a Pet Owner

1. Click View PetClinic(allow pop-ups if necessary)

2. Click Find Owner

3. Click Add OwnerFill in the details of your

imaginary pet owner

Validate Addition of Pet Owner

1. Click HomeClick Find Owner

2. Click Find Owners button

3. Validate the addition of the new pet owner

Validate Data Persistency

1. Click Database(follow plug-in instructions)

2. When MySQL opens, type:

select * from owners;

Ensure the new pet owner is listed

Ensure the new pet owner is listed

Step 2 Recap

The new pet owner is added to: – The In-Memory Data Grid

– The Database

STEP 3 – EXPERIENCE DATABASE FAILURE

Database Connection Failure

Database (Commodity, Background)

Network Load-Balancer

Web Container/ App Server

In-MemoryData Grid

Disconnecting the database does not affect the end-user experience

Disconnecting the database does not affect the end-user experience

See it for yourself!Instructions are next…

Disconnect Database (Simulating Failure)

1. Locate the Database

machine

2. Click the Block Network

button (located to the right)

The machine is rebooted and data connections are blocked!

The machine is rebooted and data connections are blocked!

Add a Pet Owner

1. Click Home

Click Find Owner

2. 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)

Validate Data Availability Despite DB Failure

1. Click HomeClick Find Owner

2. Click Find Owners button

3. Validate the addition of the new pet owner

Validate Owner Data Was NOT Persisted

1. Make sure 30 seconds have passed since blocking network, to give the database machine time to reboot.

2. Re-open the MySQL windowand type: select * from owners;

Ensure the new pet owner does NOT exist

Ensure the new pet owner does NOT exist

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!

STEP 4 – WITNESS SYSTEM RECOVERY FROM DATABASE FAILURE

Restoring Database Connection

Database (Commodity, Background)

Network Load-Balancer

Web Container/ App Server

In-MemoryData Grid

Restoring database connection and data persistency is initiated automatically

Instructions are next…

Restore Database

1. Locate the Database machine.

Click the Unblock Network button.

2. Wait a few seconds for the database

to be updated.

Validate Data Persistency

3. Switch to MySQL and type:

select * from owners;

Ensure the new pet owner is listed

Ensure the new pet owner is listed

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

THANK YOU!

Download the demo source code to run on your machine: http://www.openspaces.org/display/DAE/GigaSpaces+PetClinic

Download the demo source code to run on your machine: http://www.openspaces.org/display/DAE/GigaSpaces+PetClinic

Recommended