85
A NEW PLATFORM FOR A NEW ERA

IMCSummit 2015 - 1 IT Business - The Evolution of Pivotal Gemfire

Embed Size (px)

Citation preview

Page 1: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

A NEW PLATFORM FOR A NEW ERA

Page 2: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

2 © Copyright 2015 Pivotal. All rights reserved. 2 © Copyright 2015 Pivotal. All rights reserved.

Evolution of Pivotal Gemfire Which way might the "Apache Way” take It?

Milind Bhandarkar [email protected] CEO, Ampool Inc. @techmilind

Roman Shaposhnik [email protected] Director of Open Source, Pivotal Inc. @rhatr

Page 3: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

3 © Copyright 2015 Pivotal. All rights reserved.

Topics

� GemFire history, architecture, and use cases

� Geode as the open source core of GemFire

� Requirements of the modern data infrastructure

� Butterfly architecture

� Geode as an engine for in-memory data exchange layer

Page 4: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

4 © Copyright 2015 Pivotal. All rights reserved.

It’s not the size of

DATAit’s how you use it!

Page 5: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

5 © Copyright 2015 Pivotal. All rights reserved.

2004 2008 2014

•  Massive increase in data volumes

•  Falling margins per transaction

•  Increasing cost of IT maintenance

•  Need for elasticity in systems

•  Financial Services Providers (every major Wall Street bank)

•  Department of Defense

•  Real Time response needs •  Time to market constraints •  Need for flexible data

models across enterprise •  Distributed development •  Persistence + In-memory

•  Global data visibility needs •  Fast Ingest needs for data •  Need to allow devices to

hook into enterprise data •  Always on

•  Largest travel Portal •  Airlines •  Trade clearing •  Online gambling

•  Largest Telcos •  Large mfrers •  Largest Payroll processor •  Auto insurance giants •  Largest rail systems on

earth

Our GemFire Journey Over The Years

Page 6: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

6 © Copyright 2015 Pivotal. All rights reserved.

Apps at Scale Have Unique Needs

Pivotal GemFire is the distributed, in-memory database for apps that need: 1.  Elastic scale-out performance

2.  High performance database capabilities in distributed systems

3.  Mission critical availability and resiliency

4.  Flexibility for developers to create unique applications

5.  Easy administration of distributed data grids

Page 7: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

7 © Copyright 2015 Pivotal. All rights reserved.

1. Elastic Scale-Out Performance

Nodes

Ops / Sec Linear scalability

Elastic capacity +/-

Latency-minimizing data distribution

China Railway Corporation

“The system is operating with solid performance and uptime. Now, we have a reliable, economically sound production system that supports record volumes and has room to grow” Dr. Jiansheng Zhu, Vice Director of China Academy of Railway Sciences

•  4.5 million ticket purchases & 20 million users per day.

•  Spikes of 15,000 tickets sold per minute, 40,000 visits per second.

Page 8: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

8 © Copyright 2015 Pivotal. All rights reserved.

2. High Performance Database Capabilities

Performance-optimized

persistence

Configurable consistency Partitioned Replicated Disabled

Distributed & continuous queries

Distributed transactions, indexing, archival

Newedge

“Our global deployment of Pivotal GemFire’s distributed cache gives me a single version of the trade – resolving hard-to-test-for synchronization issues that exist within any globally distributed business application architecture” Michael Benillouche, Global Head of Data Management

Page 9: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

9 © Copyright 2015 Pivotal. All rights reserved.

3. Mission Critical Availability and Resiliency

Cluster to cluster WAN connectivity

Cluster resilience & failover

XX Gire

“We can track and collect money at our 4,000+ kiosks and branches – even without a reliable Internet connection. GemFire provides the core data grid and a significant amount of related functionality to help us handle this unreliable network problem” Gustavo Valdez, Chief of Architecture and Development

•  19 million payment transactions per month

•  4000+ points of sale with intermittent Internet connectivity

Page 10: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

10 © Copyright 2015 Pivotal. All rights reserved.

4. Flexibility for Developers to Create Unique Apps •  Data Structures:

–  User-defined classes –  Documents (JSON)

•  Native language support: –  Java, C++, C#

•  API’s –  Java: Hashmap –  Memcache –  Spring Data GemFire –  C++ Serialization API’s

•  Embedded query authoring –  Object Query Language (OQL)

•  Publish & subscribe framework for continous query & reliable asynchronous event queues

•  App-server embedded functionality: –  Web app session state caching –  L2 Hibernate

Page 11: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

11 © Copyright 2015 Pivotal. All rights reserved.

What makes it fast? �  Design center is RAM not HDD

�  Really demanding customers

�  Avoid and minimize, particularly on the critical read/write paths: –  Network hops, copying data, contention, distributed locking, disk seeks, garbage

�  Lots and lots of testing –  Establish and monitor performance baselines –  Distributed systems testing is difficult!

Page 12: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

12 © Copyright 2015 Pivotal. All rights reserved.

Horizontal Scaling for GemFire (Geode) Reads With Consistent Latency and CPU

•  Scaled from 256 clients and 2 servers to 1280 clients and 10 servers •  Partitioned region with redundancy and 1K data size

0

2

4

6

8

10

12

14

16

18

0

1

2

3

4

5

6

2 4 6 8 10

Spee

dup

Server  Hosts

speedup

latency  (ms)

CPU  %

Page 13: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

13 © Copyright 2015 Pivotal. All rights reserved.

GemFire (Geode) 3.5-4.5X Faster Than Cassandra for YCSB

Page 14: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

14 © Copyright 2015 Pivotal. All rights reserved. 14 © Copyright 2015 Pivotal. All rights reserved.

Apache Geode (incubating) The open source core of GemFire

Page 15: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

15 © Copyright 2015 Pivotal. All rights reserved.

Geode Will Be A Significant Apache Project

�  Over a 1000 person years invested into cutting edge R&D

�  Thousands of production customers in very demanding verticals

�  Cutting edge use cases that have shaped product thinking

�  Tens of thousands of distributed , scaled up tests that can randomize every aspect of the product

�  A core technology team that has stayed together since founding

�  Performance differentiators that are baked into every aspect of the product

Page 16: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

16 © Copyright 2015 Pivotal. All rights reserved.

Geode or GemFire?

� Geode is a project, GemFire is a product

� We donated everything but the kitchen sink*

� More code drops imminent; going forward all development happens OSS-style (“The Apache Way”)

* Multi-site WAN replication, continuous queries, and native (C/C++) client driver

Page 17: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

17 © Copyright 2015 Pivotal. All rights reserved.

Page 18: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

18 © Copyright 2015 Pivotal. All rights reserved.

Why OSS? Why Now? Why Apache?

�  Open Source Software is fundamentally changing buying patterns –  Developers have to endorse product selection (No longer CIO handshake) –  Open source credentials attract the best developers –  Open Source has replaced standards

�  Align with the tides of history –  Customers increasingly asking to participate in product development –  Allow product development to happen with full transparency

�  Apache Way –  “Community over code” –  Use cases far beyond Pivotal Gemfire’s

Page 19: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

19 © Copyright 2015 Pivotal. All rights reserved. 19 © Copyright 2015 Pivotal. All rights reserved.

Beyond Gemfire’s core

Page 20: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

20 © Copyright 2015 Pivotal. All rights reserved.

Roadmap

� HDFS persistence

� Off-heap storage

� Lucene indexes

� Spark integration

� Cloud Foundry service

…and other ideas from the Geode community!

Page 21: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

21 © Copyright 2015 Pivotal. All rights reserved. 21 © Copyright 2015 Pivotal. All rights reserved.

Geode in modern data infrastructure

Page 22: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

22 © Copyright 2015 Pivotal. All rights reserved.

Infrastructure is increasingly Scale-Out

Page 23: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

23 © Copyright 2015 Pivotal. All rights reserved.

Memory throughput growth

Page 24: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

24 © Copyright 2015 Pivotal. All rights reserved.

Memory hierarchy getting deeper

Page 25: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

25 © Copyright 2015 Pivotal. All rights reserved.

One-size-fits-all Data Platform Era is Over

Page 26: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

26 © Copyright 2015 Pivotal. All rights reserved.

Analytics moving from Batch to Real-Time

Page 27: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

27 © Copyright 2015 Pivotal. All rights reserved. 27 © Copyright 2015 Pivotal. All rights reserved.

What happened?

Page 28: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

28 © Copyright 2015 Pivotal. All rights reserved.

Page 29: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

29 © Copyright 2015 Pivotal. All rights reserved.

Page 30: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

30 © Copyright 2015 Pivotal. All rights reserved.

Page 31: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

31 © Copyright 2015 Pivotal. All rights reserved.

Page 32: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

32 © Copyright 2015 Pivotal. All rights reserved.

Page 33: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

33 © Copyright 2015 Pivotal. All rights reserved.

Page 34: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

34 © Copyright 2015 Pivotal. All rights reserved.

And, then…

HDFS

ASF Projects FLOSS Projects Pivotal Products

MapReduce

Page 35: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

35 © Copyright 2015 Pivotal. All rights reserved.

In a blink of an eye…

HDFS

Pig

Sqoop Flume

Coordination and workflow management

Zookeeper

Ambari & Command Center GemFire XD

Oozie

MapReduce

Hive

Tez Giraph

Hadoop UI

Hue

SolrCloud Phoenix

HBase

Crunch Mahout

Spark

Shark

Streaming

MLib

GraphX

HAW

Q

SpringXD

MADlib Ham

ster

PivotalR

YARN

ASF Projects FLOSS Projects Pivotal Products

Page 36: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

36 © Copyright 2015 Pivotal. All rights reserved.

Data Lake 1.0

Page 37: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

37 © Copyright 2015 Pivotal. All rights reserved.

Page 38: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

38 © Copyright 2015 Pivotal. All rights reserved.

… and Now

Page 39: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

39 © Copyright 2015 Pivotal. All rights reserved.

Page 40: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

40 © Copyright 2015 Pivotal. All rights reserved.

Page 41: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

41 © Copyright 2015 Pivotal. All rights reserved.

Page 42: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

42 © Copyright 2015 Pivotal. All rights reserved. 42 © Copyright 2015 Pivotal. All rights reserved.

The missing building block

Page 43: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

43 © Copyright 2015 Pivotal. All rights reserved.

Sharing operational data at the speed of RAM

In-Memory Data Exchange Layer

HDFS Isilon …backend archival stores…

Spark HAWQ …frontend processing frameworks…

Page 44: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

44 © Copyright 2015 Pivotal. All rights reserved.

Spark’s view on how to lock you in

In-Memory Data Exchange Layer

HDFS Isilon …backend archival stores…

HAWQ …frontend processing frameworks… Spark

Spark

Page 45: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

45 © Copyright 2015 Pivotal. All rights reserved.

HDFS’s view on how to lock you in

In-Memory Data Exchange Layer

HDFS Isilon …backend archival stores…

HAWQ …frontend processing frameworks… Spark

HDFS

Page 46: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

46 © Copyright 2015 Pivotal. All rights reserved. 46 © Copyright 2015 Pivotal. All rights reserved.

How is open source solving this?

Page 47: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

47 © Copyright 2015 Pivotal. All rights reserved.

Short list of open source contenders

� Tachyon

�  Infinispan

� Apache Ignite (incubating)

� Apache Geode (incubating)

Page 48: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

48 © Copyright 2015 Pivotal. All rights reserved.

Short list of open source contenders

� Tachyon

�  Infinispan

� Apache Ignite (incubating)

� Apache Geode (incubating)

Page 49: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

49 © Copyright 2015 Pivotal. All rights reserved.

Geode’s secret sauce

� Community!

� Maturity

� Scalability

� Building blocks

Page 50: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

50 © Copyright 2015 Pivotal. All rights reserved. 50 © Copyright 2015 Pivotal. All rights reserved.

A few key building blocks •  PDX Serialization •  Asynchronous Events

Page 51: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

51 © Copyright 2015 Pivotal. All rights reserved.

Fixed or flexible schema?

id name age pet_id

{ id : 1, name : “Fred”, age : 42, pet : { name : “Barney”, type : “dino” } }

OR

Page 52: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

52 © Copyright 2015 Pivotal. All rights reserved.

But how to serialize data?

http://blog.pivotal.io/pivotal/products/data-serialization-how-to-run-multiple-big-data-apps-at-once-with-gemfire

Page 53: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

53 © Copyright 2015 Pivotal. All rights reserved.

Portable Data eXchange

C#, C++, Java, JSON

| header | data | | pdx | length | dsid | typeId | fields | offsets |

Page 54: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

54 © Copyright 2015 Pivotal. All rights reserved.

Efficient for queries

SELECT p.name from /Person p WHERE p.pet.type = “dino”

{ id : 1, name : “Fred”, age : 42, pet : { name : “Barney”, type : “dino” } }

single field deserialization

Page 55: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

55 © Copyright 2015 Pivotal. All rights reserved.

Easy to use

� Access from Java, C#, C++, JSON

� Domain objects not required

� Automatic type definition –  No IDL compiler or schema required –  No hand-coded read/write methods

Page 56: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

56 © Copyright 2015 Pivotal. All rights reserved.

Asynchronous Events – Design Goals

� High availability

� Low latency, high throughput

� Deliver events to a receiver without impacting the write path

Page 57: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

57 © Copyright 2015 Pivotal. All rights reserved.

Questions?

� http://geode.incubator.apache.org

� [email protected]

� [email protected]

� http://github.com/apache/incubator-geode

Page 58: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

58 © Copyright 2015 Pivotal. All rights reserved. 58 © Copyright 2013 Pivotal. All rights reserved.

Page 59: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

59 © Copyright 2015 Pivotal. All rights reserved. 59 © Copyright 2013 Pivotal. All rights reserved.

Bonus Content

Page 60: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

60 © Copyright 2015 Pivotal. All rights reserved. 60 © Copyright 2013 Pivotal. All rights reserved.

PDX

Page 61: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

61 © Copyright 2015 Pivotal. All rights reserved.

Distributed type registry

Member A Member B

Distributed Type Definitions

Person p1 = … region.put(“Fred”, p1);

Page 62: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

62 © Copyright 2015 Pivotal. All rights reserved.

Distributed type registry

Member A Member B

Distributed Type Definitions

Person p1 = … region.put(“Fred”, p1);

automatic definition

Page 63: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

63 © Copyright 2015 Pivotal. All rights reserved.

Distributed type registry

Member A Member B

Distributed Type Definitions

Person p1 = … region.put(“Fred”, p1);

automatic definition

Page 64: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

64 © Copyright 2015 Pivotal. All rights reserved.

Distributed type registry

Member A Member B

Distributed Type Definitions

Person p1 = … region.put(“Fred”, p1);

automatic definition

replicate serialized data containing typeId

Page 65: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

65 © Copyright 2015 Pivotal. All rights reserved.

Schema evolution

PDX provides forwards and backwards compatibility, no code required

Member A Member B

Distributed Type Definitions

v1 v2

Application #2

Application #1

v2 objects preserve data from missing fields

v1 objects use default values to fill in new fields

Page 66: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

66 © Copyright 2015 Pivotal. All rights reserved. 66 © Copyright 2013 Pivotal. All rights reserved.

Asynchronous Events

Page 67: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

67 © Copyright 2015 Pivotal. All rights reserved.

Member 3

Member 1

Serial Queues

Member 2

LOL!! put

Primary Queue

Secondary Queue

Enqueue

sup LOL!!

sup sup

LOL!!

Replicate

Page 68: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

68 © Copyright 2015 Pivotal. All rights reserved.

Member 3

Member 1

Member 2

Serial Queues

sup LOL!!

sup LOL!!

AsyncEventListener  {        processBatch()  }  

LOL!!

sup

Dispatch Events from Primary

Page 69: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

69 © Copyright 2015 Pivotal. All rights reserved.

put

Secondary Queue (Partition 1)

LOL!!

sup

sup LOL!!

Primary Queue (Partition 2)

Parallel Queues Primary Queue

(Partition 1)

LOL!!

sup

sup LOL!!

Word

Word

Page 70: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

70 © Copyright 2015 Pivotal. All rights reserved.

LOL!!

sup

sup LOL!!

Parallel Queues

LOL!!

sup

sup LOL!!

Word

Word AsyncEventListener  {        processBatch()  }  

AsyncEventListener  {        processBatch()  }  

Parallel Dispatch

Page 71: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

71 © Copyright 2015 Pivotal. All rights reserved.

“There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors.”

– the internet

Page 72: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

72 © Copyright 2015 Pivotal. All rights reserved.

Client driver

�  Intelligent – understands data distribution for single hop network access

� Caching – can be configured to locally cache data for even faster access

� Events – registerInterest() in keys to receive push notifications

Page 73: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

73 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

� Useful for refreshing client cache, pushing events (“topics”) to multiple clients

� Highly available & scalable via in-memory replicated queues

� Events are ordered, at-least-once delivery

� Durable subscriptions, conflation optional

Page 74: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

74 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

Member A Member B

region.registerInterest(“Fred”);

Client

Client

Page 75: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

75 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

Member A Member B

Person p1 = … region.put(“Fred”, p1);

region.registerInterest(“Fred”);

Client

Client

Page 76: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

76 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

Member A Member B

Person p1 = … region.put(“Fred”, p1);

region.registerInterest(“Fred”);

Client

Client

Page 77: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

77 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

Member A Member B

Person p1 = … region.put(“Fred”, p1);

region.registerInterest(“Fred”);

Client

Client

Page 78: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

78 © Copyright 2015 Pivotal. All rights reserved.

Client subscriptions

Member A Member B

Person p1 = … region.put(“Fred”, p1);

region.registerInterest(“Fred”);

Client

Client

Page 79: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

79 © Copyright 2015 Pivotal. All rights reserved. 79 © Copyright 2013 Pivotal. All rights reserved.

Use cases and patterns

Page 80: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

80 © Copyright 2015 Pivotal. All rights reserved.

“Low touch” Usage Patterns Simple template for TCServer, TC, App servers

Shared nothing persistence, Global session state HTTP Session management

Set Cache in hibernate.cfg.xml Support for query and entity caching

Hibernate L2 Cache plugin

Servers understand the memcached wire protocol

Use any memcached client Memcached protocol

<bean id="cacheManager" class="org.springframework.data.gemfire.support.GemfireCacheManager" Spring Cache Abstraction

Page 81: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

81 © Copyright 2015 Pivotal. All rights reserved.

Application Patterns

� Caching for speed and scale –  Read-through, Write-through, Write-behind

� Geode as the OLTP system of record –  Data in-memory for low latency, on disk for durability

� Parallel compute engine

� Real-time analytics

Page 82: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

82 © Copyright 2015 Pivotal. All rights reserved.

Development Patterns

� Configure the cluster programmatically or declaratively using cache.xml, gfsh, or SpringDataGemFire

   <cache>      <region  name="turbineSensorData"  refid="PARTITION_PERSISTENT">          <partition-­‐attributes  redundant-­‐copies="1"  total-­‐num-­‐buckets="43"/>      </region>  </cache>  

Page 83: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

83 © Copyright 2015 Pivotal. All rights reserved.

Development Patterns

� Write key-value data into a Region using { create | put | putAll | remove }

–  The value can be flat data, nested objects, JSON, …  Region  sensorData  =  cache.getRegion("TurbineSensorData");      SensorKey  key  =  new  SensorKey(31415926,  "2013-­‐05-­‐19T19:22Z");  //  turbineId,  timestamp  sensorData.put(key,  new  TurbineReading()          .setAmbientTemp(75)          .setOperatingTemp(80)          .setWindDirection(0)          .setWindSpeed(30)          .setPowerOutput(5000)          .setRPM(5));  

Page 84: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

84 © Copyright 2015 Pivotal. All rights reserved.

Development Patterns

� Read values from a Region by key using { get | getAll }            TurbineReading  data  =  sensorData.get(new  SensorKey(31415926,"2013-­‐05-­‐19T19:22Z")); � Query values using OQL          //  finds  all  sensor  readings  for  the  given  turbine          SELECT  *  from  /TurbineSensorData.entrySet  WHERE  key.turbineId  =  31415926            //  finds  all  sensor  readings  where  the  operating  temp  exceeds  a  threshold          SELECT  *  from  /TurbineSensorData.entrySet  WHERE  value.operatingTemp  >  120  

� Apply indexes to optimize queries

Page 85: IMCSummit 2015 - 1 IT Business  - The Evolution of Pivotal Gemfire

85 © Copyright 2015 Pivotal. All rights reserved.

Development Patterns

� Execute functions to operate on local data in parallel

� Respond to updates using CacheListeners and Events � Automatic redundancy, partitioning, distribution, consistency,

network partition detection & recovery, load balancing, …