geode introduction

41
Introduction Swapnil Bawaskar @sbawaskar (incubating)

Upload: swapnil-bawaskar

Post on 15-Apr-2017

47 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Geode introduction

Introduction

Swapnil Bawaskar@sbawaskar

(incubating)

Page 2: Geode introduction

• Introduction• What?• Who?• Why?• How?• DEBS• Roadmap

• Q&A

Agenda

Page 3: Geode introduction

Introduction

Page 4: Geode introduction

A distributed, memory-based data management platform for data oriented apps that need:• high performance, scalability, resiliency and continuous

availability• fast access to critical data set• location aware distributed data processing• event driven data architecture

Introduction

Page 5: Geode introduction

• 1000+ systems in production (real customers)• Cutting edge use cases

Incubating… but rock solid

Page 6: Geode introduction

• 17 billion records in memory • GE Power & Water's Remote Monitoring & Diagnostics Center

• 3 TB operational data in-memory, 400 TB archived • China Railways

• 4.6 Million transactions a day / 40K transactions a second • China Railways

• 120,000 Concurrent Users• Indian Railways

Incubating… but rock solid

Page 7: Geode introduction

World: ~7,349,000,000~36% of the world population

Population: 1,251,695,6161,401,586,609

China RailwayCorporation Indian Railways

Page 8: Geode introduction

Incubating… but rock solid

A Re

ads

A Up

date

s

B Re

ads

B Up

date

s

C Re

ads

D In

serts

D Re

ads

F Re

ads

F Up

date

s0

200000

400000

600000

800000

1000000

Cassandra Geode

YCSB Workloads

oper

atio

ns p

er s

econ

d

Page 9: Geode introduction

Horizontal scaling for reads, consistent latency and CPU

2 4 6 8 100

1.25

2.5

3.75

5

6.25

0

4.5

9

13.5

18

speeduplatency (ms)CPU %

Server Hosts

Spee

dup

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

Page 10: Geode introduction

What makes it go fast?

• Minimize copying

• Minimize contention points

• Run user code in-process

• Partitioning and parallelism

• Avoid disk seeks

• Automated benchmarks

Page 11: Geode introduction

• Clone & Build

Hands-on: Build & run

git clone https://github.com/apache/incubator-geodecd incubator-geode./gradlew build -Dskip.tests=true• Start a servercd gemfire-assembly/build/install/apache-geode ./bin/gfsh gfsh> start locator --name=locator gfsh> start server --name=server gfsh> create region --name=myRegion --type=REPLICATE

$ docker run -it apachegeode/geode:1.0.0-incubating.M1 gfsh

• Docker

Page 12: Geode introduction

Hands on

Page 13: Geode introduction

• Cache• Region• Member• Client Cache• Functions• Listeners• High Availability• Serialization

Concepts

Page 14: Geode introduction

• Cache• In-memory storage and

management for your data• Configurable through XML,

Java API or CLI• Collection of Region

Concepts

Page 15: Geode introduction

• Region • Distributed java.util.Map on

steroids (Key/Value)• Consistent API regardless of where

or how data is stored• Observable (reactive) • Highly available, redundant on

cache Member (s).

Concepts

Page 16: Geode introduction

• Region• Local, Replicated or Partitioned• In-memory or persistent• Redundant• LRU • Overflow

Concepts

LOCALLOCAL_HEAP_LRULOCAL_OVERFLOWLOCAL_PERSISTENTLOCAL_PERSISTENT_OVERFLOWPARTITIONPARTITION_HEAP_LRUPARTITION_OVERFLOWPARTITION_PERSISTENTPARTITION_PERSISTENT_OVERFLOWPARTITION_PROXYPARTITION_PROXY_REDUNDANTPARTITION_REDUNDANTPARTITION_REDUNDANT_HEAP_LRUPARTITION_REDUNDANT_OVERFLOWPARTITION_REDUNDANT_PERSISTENTPARTITION_REDUNDANT_PERSISTENT_OVERFLOWREPLICATEREPLICATE_HEAP_LRUREPLICATE_OVERFLOWREPLICATE_PERSISTENTREPLICATE_PERSISTENT_OVERFLOWREPLICATE_PROXY

Page 17: Geode introduction

• Persistent Regions• Durability• WAL for efficient writing• Consistent recovery• Compaction

Concepts

Server 1 Server N

Page 18: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

Page 19: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

Page 20: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

Page 21: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

Page 22: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

Page 23: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

B3

B2

Server 1 waits for others when it starts

Page 24: Geode introduction

Persistence - Shared Nothing

Server 3Server 2Server 1

B1

B3

B2

B1

B3

B2Primary

Secondary

Fetches missed operations on restart

Page 25: Geode introduction

Persistence - Operational Logs

Create k1->v1

Create k2->v2

Modifyk1->v3

Create k4->v4

Modify k1->v5

Create k6->v6

Member 1Put k6->v6

Oplog2.crf

Oplog1.crf

Append to operation log

Page 26: Geode introduction

Persistence - Operational Logs - Compaction

Create k1->v1

Create k2->v2

Modifyk1->v3

Create k4->v4

Modify k1->v5

Create k6->v6

Member 1Put k6->v6

Oplog2.crf

Oplog1.crf

Append to operation log

Copy live data forward

Page 27: Geode introduction

• Member• A process that has a connection to

the system• A process that has created a cache• Embeddable within your

application

Concepts

Client

Locator

Server

Page 28: Geode introduction

• Client cache• A process connected to the Geode

server(s)• Can have a local copy of the data

• Run OQL queries on local data• Can be notified about events on

the servers

Concepts

Page 29: Geode introduction

• Client Notifications• Register Interest

• Individual Keys OR RegEx for Keys• Updates Local Copy

• Examples:• region.registerInterest(“key-1”);• region1.registerInterestRegex(“[a-z]+“);

• Continuous Query• Receive Notification when Query condition

met on server• Example:

• SELECT * FROM /tradeOrder t WHERE t.price > 100.00 • Can be DURABLE

Concepts

Page 30: Geode introduction

• Functions• Used for distributed concurrent processing

(Map/Reduce, stored procedure)• Highly available• Data oriented• Member oriented

Concepts

Page 31: Geode introduction

Concepts

• Functions

Page 32: Geode introduction

• Listeners• CacheWriter / CacheListener• AsyncEventListener (queue / batch)

• Parallel or Serial• Conflation

Concepts

Page 33: Geode introduction

Concepts - HA

Page 34: Geode introduction

Fixed or flexible schema?

id name age pet_id

or

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

Page 35: Geode introduction

C#, C++, Java, JSON

No IDL, no schemas, no hand-codingSchema evolution (Forward and Backward Compatible)

* domain object classes not required

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

Portable Data eXchange

Page 36: Geode introduction

Efficient for queries

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

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

single fielddeserialization

Page 37: Geode introduction

But how to serialize data?

Benchmark: https://github.com/eishay/jvm-serializers

Page 38: Geode introduction

Schema evolutionMember A Member B

Distributed Type Definitions

v2v1

Application #1

Application #2

v2 objects preserve datafrom missing fields

v1 objects use default values tofill in new fields

PDX provides forwards and backwardscompatibility, no code required

Page 39: Geode introduction

Adapters

Page 40: Geode introduction

• write-through as opposed to cache-aside

• Stale Cache• Inconsistent Cache• Thundering Heards

memcached

Page 41: Geode introduction

• Scalable Data-Structures• Use All Cores• WAN Replication

Redis