orientdb distributed architecture v2.0

23
Distributed DBMS

Upload: orient-technologies

Post on 02-Dec-2014

1.428 views

Category:

Technology


7 download

DESCRIPTION

OrientDB Distributed Architecture Overview

TRANSCRIPT

Page 1: OrientDB Distributed Architecture v2.0

Distributed DBMS

Page 2: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 2

Short history !

In 2012, we had a Master/Slave replication !

While it scaled up well on reads, users complained of a single Master node bottleneck

It’s quite easy to scale up reads, the hard part is to scale up both reads and writes

Page 3: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD

How Master/Slave works

3

Master Node

CC C

Slave Node

Slave Node

Writes

Master node is the bottleneck

Page 4: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 4

Master/Slave !

PROS: - Relatively easy to develop !

CONS: - The master is the bottleneck for writes - No matter how many servers you have, the

throughput is limited by the Master node

Page 5: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 5

What happened to OrientDB's M/S architecture?

This is the old MASTER/SLAVE replication

Page 6: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 6

2012: new architectural goals

Multi-Master: all the nodes must accept writes

Sharding: split data in multiple partitions

Better Fail-Over

Simplified configuration with Auto-Discovery

Page 7: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 7

Master Node

Auto-Discovery

I’m the only one!

C

Page 8: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 8

Auto-Discovery

Master Node

Master Node

Connected!

C

Page 9: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 9

Master Node

Master Node

C

updated distributed configuration is broadcasted to

all the connected clients

Clients see the distributed configuration

Page 10: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 1010

Master Node

Master Node

CC

Master Node

Auto-reconnect in case of failure

In case of failure, the clients auto-reconnect to

the available nodes

Page 11: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 1111

Master Node

Master Node

C

DB are automatically deployed

to the new joining nodes

DB DB

Auto-deploy of databases

CC

C

Page 12: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 12

Customer

customer

Classes rely on Cluster to store records

By default 1 class -> 1 cluster Class

Cluster

Page 13: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 13

Classes can be split into more clusters

13

Customer

customer_usa

customer_europe

customer_china

Class

Cluster

ClusterCluster

Define multiple clusters

and assign them to each node

Page 14: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 14

Assign 1 cluster per Node

1414

customer_usa customer_europe customer_china

Master Node

Master Node

Master Node

Customer

Page 15: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD

What about sharing + replication?

!

We used a solution similar to RAID for HardDrives

15

Page 16: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 16

RAID for databases

161616

customer_usa customer_europe customer_china

Master Node

Master Node

Master Node

Customer

customer_europecustomer_usacustomer_china

Replica factor = 2

Page 17: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 17

RAID for databases

17171717

customer_usa customer_europe customer_china

Master Node

Master Node

Master Node

Replica factor = 3

customer_usa customer_europecustomer_china

customer_usacustomer_europe customer_china

Each node owns all customers

Page 18: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 18

Replication: under the hood Client sends an INSERT request

1818181818

Master Node

Master Node

Master Node

HZ Queue

HZ Queue

HZ Queue

C

INSERT

Requests

Page 19: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 19191919191919

Master Node

Master Node

Master Node

HZ Queue

HZ Queue

HZ Queue

C

HZ Queue

HZ Queue

HZ Queue

Replication: under the hood Response handling

WriteQuorum = 2

Sends OK

OK

Requests

Responses

Page 20: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 20

Replication: under the hood Fix the unaligned node

20202020202020

Master Node

Master Node

Master Node

HZ Queue

HZ Queue

HZ Queue

HZ Queue

HZ Queue

HZ Queue

Requests

Responses

Fix

Page 21: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 21

Master Node

Master Node

CC

C

CC

C Master Node

CC

C

Master Node

CC

C

Master Node

CC

C

Master Node

CC

C

Master Node

C

C

Linear and Elastic scalability on both read & writes!

Page 22: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 22

Hazelcast’s role

Auto-Discovering (Multicast/TCP-IP/Amazon)

Queues for requests and responses

Store metadata in distributed Maps

Distributed Locks

2222

Page 23: OrientDB Distributed Architecture v2.0

Copyright (c) - Orient Technologies LTD 23

OrientDB 2.0 (Sept 2014) has even better performance: +300% improvement on all the distributed operations

Pluggable conflict resolution strategy

Auto-discovery also by Clients

OrientDB’s Future Roadmap