orientdb distributed architecture v2.0
DESCRIPTION
OrientDB Distributed Architecture OverviewTRANSCRIPT
![Page 1: OrientDB Distributed Architecture v2.0](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/1.jpg)
Distributed DBMS
![Page 2: OrientDB Distributed Architecture v2.0](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/2.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/3.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/4.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/5.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/6.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/7.jpg)
Copyright (c) - Orient Technologies LTD 7
Master Node
Auto-Discovery
I’m the only one!
C
![Page 8: OrientDB Distributed Architecture v2.0](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/8.jpg)
Copyright (c) - Orient Technologies LTD 8
Auto-Discovery
Master Node
Master Node
Connected!
C
![Page 9: OrientDB Distributed Architecture v2.0](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/9.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/10.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/11.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/14.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/15.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/16.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/17.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/19.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/20.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/21.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/22.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022013018/547caf19b4af9f635b8b46ac/html5/thumbnails/23.jpg)
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