Tuesday, May 31, 2011

Database Vs In-memory data grid

Recently, I went through a session in Oracle Coherance. Oracle Coherance is an in-memory data grid solution that enables organizations to predictably scale mission-critical applications by providing fast access to frequently used data.

I was trying to do a comparison between an in-memory data grid solution and a database solution. Say, Oracle Coherance and Oracle database.

Oracle Coherance:
In simple terms, Oracle Coherance is a hash map approach. The primitive operations supported by a hash map are get, put and remove.

Oracle database:
The primitive operations supported are CRUD (Create, Read, Update, Delete) operations.

In essence, Oracle Coherance has the necessary primitive operations to handle all the primitive CRUD operations that can be performed by a database approach. But there is one significant area where there is a difference. When it comes to XA transaction management, Oracle Coherance has some limitations. That is, Oracle database is really great with respect to 2-phase commits in a distributed environment.

One of the common use cases that we deal with is the versioning of objects. This could mean both in the Data Tier and in the Mid Tier. That is, lets say we have a DB schema 1.0 with Mid Tier object 1.0 version is already deployed and up and running for some time. Now, we have version 2.0 DB schema and its equivalent Mid Tier objects for 2.0 version. We need to upgrade the already running server to version 2.0. Edition-Based Redefinition is a great way to achieve this. Oracle supports this.

We'll delve deeper into this with a later post.