Working with a data grid is different than working with a database because our objects are distributed. The centralized nature of data in a database has bred some bad habits that work against us when building scalable software.
When we query a database table, we query a complete set of data. That query runs in the database query engine and returns matching rows. One query runs against one database instance. An IMDG presents many partitions on many boxes.
Our goal in running a distributed system is workload isolation. Based on object key, we know which partition holds a particular object. We get that object directly with an ObjectMap#get(key)
or EntityManager#find(class, id)
call. This is analogous to querying a single database table by primary key only.
Obviously, all database queries are not confined to a single table using its primary key. A user login, for example, doesn't require the user to enter the primary key of the row that corresponds to their...