multi-model databases and node.js
TRANSCRIPT
Multi-model databases andnode.js
Max Neunhöffer
Node.js Club SF, 23 March 2015
www.arangodb.com
triAGENS(mother company of ArangoDB GmbH)
15 years of experience in building specialized databases
We care about database technology!
In 2012, we wanted to create a databasesuch that YOU can build such services.
Document storeA document store stores a set of documents, which meansJSON data, these sets are called collections. The databasehas access to the contents of the documents.
schema-lessvery versatile
Key/value storeOpaque values, only key lookup without secondary indexes:
=⇒ high performance and perfect scalability
more restricted queries— better scalability
Graph databaseA graph database stores a labelled graph. Vertices andedges can be documents.Graphs are good to model relations.
“graphy queries” like traversals are crucial
Polyglot Persistence
IdeaUse the right data model for each part of a system.
Take scalability needs into account!
A typical Use Case— an Online Shop
We need to holdcustomer data: usually homogeneous, but still variationsMySQLproduct data: even for a specialised business quiteinhomogeneousshopping carts: need very fast lookup by session keyorder and sales data: relate customers and productsrecommendation engine data: links between different entities
Polyglot Persistence is nice, but . . .
DisadvantagesConsequence:One needs multiple database systems in the persis-tence layer of a single project!
Wouldn’t it be nice, . . .. . . to enjoy the benefits without the disadvantages?
The Multi-Model Approach
Multi-model databaseA multi-model database combines a document store with agraph database and is at the same time a key/value store,with a common query language for all three data models.
Important:is able to compete with specialised products on their turfallows for polyglot persistence using a single database
Use case: Aircraft fleet management
is a multi-model database (document store & graph database),is open source and free (Apache 2 license),offers convenient queries (via HTTP/REST and AQL),including joins between different collections,configurable consistency guarantees using transactionsmemory efficient by shape detection,uses JavaScript throughout (Google’s V8 built into server),API extensible by JS code in the Foxx Microservice Framework,offers many drivers for a wide range of languages,is easy to use with web front end and good documentation,and enjoys good community as well as professional support.
Extensible through JavaScript
The Foxx Microservice FrameworkAllows you to extend the HTTP/REST API by your ownroutes, which you implement in JavaScript running on thedatabase server, with direct access to the C++ DB engine.
Unprecedented possibilities for data centric services:custom-made complex queries or authorizationsschema-validationpush feeds, etc.
Links
https://www.arangodb.com
https://github.com/ArangoDB/guesser