Data Grids & CAP

May 15, 2013

Data Grid, NOSQL

How does the CAP Theorem apply to JBoss Data Grid (JDG)?

CAP Theorem

The CAP theorem asserts that any net­worked shared-data system can have only two of three desirable properties.

  • Consistent
  • Available
  • Partition Tolerant

Partitions come in two flavors: hard partitions and soft partitions. A hard partition results in one or more disconnected nodes. It is the result of a network failure. For example, a faulty switch. A soft partition results in one or more unresponsive nodes. It is the result of an OS / application event. For example, garbage collection.

In the absence of a partition, JDG is CA. It is both consistent and available.

In the presence of a hard partition, JDG is AP. It is both available and partition tolerant. It sacrifices consistency for availability.

In the presence of a soft partition…

With synchronous communication, JDG is CP. It is both consistent and partition tolerant. It sacrifices availability in that it waits for a response.

With asynchronous communication, JDG is AP. It is both available and partition tolerance. It sacrifices consistency in that it does NOT wait for a response.

Summary

In the traditional sense, JDG is AP as opposed to CP. However, the CAP properties of a distributed system depend on both the configuration and the state of the distributed system itself. As such, they may vary from one implementation to another if not fluctuate.

It’s worth noting that JDG is NOT eventually consistent, yet (link). Vector clocks? Read repair? A quorum? We’ll see.


On Deck

ACID v CAP
CAP and CAP (The other CAP)
The NoSQL / Data Grid Bridge

About Shane K Johnson

Technical Marketing Manager, Red Hat Inc.

View all posts by Shane K Johnson

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 115 other followers

%d bloggers like this: