This document discusses trends in transaction systems and proposes more flexible data models for the future. It summarizes concepts in VMware GemFire/SQLFire and proposes techniques like entity grouping and object columns with dynamic attributes to enable more flexible schemas that can scale for transaction workloads. The document suggests that future systems may support objects, SQL and JSON in a single distributed data store.
Unlocking the Potential of the Cloud for IBM Power Systems
High Performance Transaction Systems Flexible Data Models
1. High Performance Transaction Systems, 2011, Asilomar, CA
Flexible OLTP Data models in the
future
Jags Ramnarayan
Disclaimer:
Any positions expressed here are my own and do not
necessarily reflect the positions of my employer VMWare.
Confidential
2. Agenda
Perspective on some trends
Basic concepts in VMWare GemFire/SQLFire
Beyond key based partitioning
Beyond the SQL Data model
2 Confidential
3. Trends, Observations
High demand for low/predicable latency, handle huge
load spikes, in-memory on commodity, big data
Input is streaming in nature
• High, bursty rates ... structured and unstructured
• continuous correlations and derived events
Increasingly data is bi-temporal in nature
• very high ingest rates that tend to be bursty
• optimizations for inserts and mass migration of historical
data to data warehouse.
• occasional joins across in-memory and data warehouse
3 Confidential
4. Trends, Observations
DB schema rapidly evolving
• Services are added/changed every week... DB model cannot be
rigid
• programmer drives the change
• DBA only for operational support?
DB Instance is ACID but nothing ACID across the
enterprise
• many silos and data duplicated across independent databases
• Cleansing, de-duplication is fact of life and will never go
away
So, why is ACID so important for most use cases?
• Folks want deterministic outcome not ACID
4 Confidential
5. VMWare offering - vFabric GemFire (GA), SQLFire (in beta)
GemFire: Distributed, memory oriented, Object (KV)
data management
SQLFire: Similar but SQL is the interface
Target market today
• OLTP upto few TB range (all in memory)
• real-time, low latency, very high concurrent load
• Not focused on “big data” batch analytics
5 Confidential
8. Beyond Key based Hash Partitioning
• We all know Hash partitioning provides uniform load balance
• List, range, or using custom application expression
• Exploit OLTP characteristics for partitioning
• Often it is the number of entities that grows over time and not the size
of the entity.
• Customer count perpetually grows, not the size of the
customer info
• Most often access is very restricted to a few entities
• given a FlightID, fetch flightAvailability records
• given a customerID, add/remove orders, shipment records
• Root entity frequently fetched with its immediate children
8 Confidential
9. Grouping entities
• Related entities share a "entity group" key and are colocated
• Grouping based on foreign key relationships: look for FK in the
compound PK
• advantage here is that not all entities in group have to share the same key
Entity Groups
FlightID is the
entity group Key
CreateTable FlightAvailability(..) partitioned by FlightID colocated with Flights
9 Confidential
10. Why does this scale?
• requests pruned to a single node or subset of cluster
• Transactional "write set" is mostly confined to a single entity
group
• Unit of serializability now confined to a single "primary" member
managing the entity group
• Common query joins: across tables that belong to the same
group
• If all concurrent access were to be uniformly distributed across
the "entity group" set then you can linearly scale with cluster
size
10 Confidential
11. Invariably, access patterns are more complex
• Scalable joins when entity grouping is not possible
• Reference tables
• M-M relationships
• Distributed joins impedes scaling significantly
• pipelining intermediate data sets impacts other concurrent activity
• Answer today:
• Use replicated tables for reference data
• one side in the M-M
• Assumptions
• update rate on reference data is low
• one side of the M-M related tables is small and infrequently
changing
11 Confidential
12. It doesn’t end here
• realizing a "partition aware" design is difficult
• 80-20 rule: 80% of access at a point in time is on 20% of the data
• lumpy distribution causes hotspots
• hash partitioning solves this but doesn't help range
searches
• some help: Multi-attribute Grid declustering
• rebalancing may not help as the entity group (the lump) is
a unit of redistribution
• Static grouping vs dynamic grouping
• e.g online gaming: multiple players that all have to be
grouped together lasts only for a game
(http://www.cs.ucsb.edu/~sudipto/papers/socc10-das.pdf)
12 Confidential
13. “Good enough” scalable transactions
• Assumptions
• Small in duration and “write set”
• Conflicts are rare
• Single row operations always atomic and isolated
• No statement level read consistency for queries
• Writers almost never block readers
• Single phase commit protocol
• Eagerly “write lock(local)” on each cohort.
• “Fail fast” if lock cannot be acquired
• Transaction isolation at commit time is guaranteed on "write
set" in a single partition
13 Confidential
14. Rough thoughts on “Schema flexibility”
• New generation of developers don’t seem to like Schemas
• Drivers
• Many source of data: it is semi-structured and changing rapidly
• DB model changes are frequent
• Adding UDTs and altering tables seen as "rigid“
• E.g.
• E-commerce app introduces a few products with a stable schema
Source:
http://www.nosqldatabases.com/main/2011/4/11/augmen
ting-rdbms-with-mongodb-for-ecommerce.html
14 Confidential
15. “Schema free”, “Schema less”, etc
• Then, keeps adding support for new products
• Or, keeps removing products
• XML datatypes or UDTs or organizing tables in a hierarchy is
unnatural and complex
• JSON is considered fat free alternative to XML
15 Confidential
16. The “Polyglot” Data store
• Current thinking
Single OLTP data store for:
1. complex, obese, perpetually changing object graphs
session state, workflow state
2. Highly structured, transactional data
sourced from enterprise DBs
3. semi-structured, self describing, rapidly evolving
data
syndicated content, etc
Distributed data store that supports Objects, SQL and JSON ?
16 Confidential
17. Object columns with dynamic attributes
• Extend SQL with dynamic, self describing attributes
contained in Object columns
• Object columns are containers for self describing K-V
pairs (think JSON)
• values can be objects themselves supporting nesting
(composition)
• Can contain collections
• Very easy in most object environments
• Reflection provides dynamic type under the covers
• And, hence the object fields become queriable. For
interoperability, the type system could be JSON
17 Confidential
18. Some Examples with Object columns
1. Session State- Object tables easily integrate with
session state modules in popular app servers
create table sessionState (key String, value
Object) hash partitioned redundancy level 1;
2. Semi-structured docs
create table myDocuments (key varchar,
documentID varchar, creationTime date, doc
Object, tags Object) hash partitioned redundancy
level 1;
- doc could be a JSON object with each row having different
attributes in the object
- tags is a collection of strings
18 Confidential
19. More information at
http://communities.vmware.com/community/vmtn/appplatform/v
fabric_sqlfire
Q&A
19 Confidential