distribution and replication in basexfiles.basex.org/publications/xmlprague/2013/dirk-kirsten... ·...

Post on 31-Jan-2018

220 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Dirk Kirsten

dk@basex.org

BaseX User Meeting

Pre-Conference Day, XML Prague 2013

Distribution and Replication in BaseXWhat to expect in the future

BaseX

Why do you need that?

● scale-out horizontally● easily (and cheaply) add more servers (commodity hardware)● manage large volumes of data● distribute the load faster execution→

● replication is de facto a must-have for any reliable application

● by scaling out and an increased number of servers failures become more likely and replication even more important

BaseX

● Distribution:– Nothing, really...

● Replication:– Built-in Backup Tool

– rsync to copy files to other server

What can you do nowadays?

BaseX

BaseX Distributed

BaseXd

BaseXd

BaseXd

BaseXd

BaseXd

XQuery

Cluster● routes read/write queries● balances data

BaseX

BaseX Distributed

BaseX

BaseX Distributed

BaseX

BaseX Distributed

BaseX

BaseX Distributed - config server

BaseXd

BaseXd

BaseXd

BaseXd

BaseXd

Cluster

C

C

C

BaseX

BaseX Distributed - config server

BaseXd

BaseXd

BaseXd

BaseXd

BaseXd

Cluster

C

C

C

● x Nodes elect a new leader● 3 nodes have to server as config server otherwise just read-only→

● no rebalancing● documents can still be read or write

BaseX

BaseX Distributed

for $doc in collection('webpage')

where starts-with(base-uri($doc), 'my-doc')

return $doc//p[@class = 'whatever']

BaseX

BaseX Distributed

for $p in dist:query( ('webpage', 'webpage2'),

for $i in $coll

return $i/my/node/now

)

return $p/content/text()

BaseX

Replication

BaseXd

BaseXd

BaseXdBaseXd

Cluster

C

C

C

BaseXd master

BaseXdslave

BaseXdslave

● traditional master/slave system● all writes are happening on the master● slaves automatically receive updates● failover management in case of failure of the master

Any questions, suggestions or use cases?Now or write to dk@basex.org

top related