Slide 1

Slide 1 text

1 Lucas Dohmen @moonbeamlabs ! the multi-purpose NoSQL Database ! www.arangodb.org

Slide 2

Slide 2 text

Lucas Dohmen ‣ ArangoDB Core Team ‣ ArangoDB Foxx & Ruby Adapter ‣ Student on the master branch ‣ hacken.in & nerdkun.de ‣ Guest on Ruby Rogues \o/ 2 /\ (~( ) ) /\_/\ ( _-----_(@ @) ( \ / /|/--\|\ V " " " "

Slide 3

Slide 3 text

Main Features 3 ‣ Open source and free ‣ Multi model database ‣ Convenient querying ‣ Extendable through JS ‣ High performance & space efficiency ‣ Easy to use ‣ Started in Sep 2011 ‣ Current Version: 1.4

Slide 4

Slide 4 text

Why did we start ArangoDB? ‣ Experienced team building NoSQL DBs for more than 15 years ‣ Second Generation NoSQL DB ‣ Unique feature set ‣ Solves some problems of other NoSQL DBs 4

Slide 5

Slide 5 text

Free and Open Source ‣ Apache 2 License ‣ On Github ‣ Do what you want with it ‣ ... and don‘t pay a dime!

Slide 6

Slide 6 text

Multi model database 6 Key/Value Store Document Store Graph Database Source: Andrew Carol Polyglot Persistence

Slide 7

Slide 7 text

Key-Value Store ‣ Map value data to unique string keys (identifiers) ‣ Treat data as opaque (data has no structure) ‣ Can implement scaling and partitioning easily due to simplistic data model ‣ Key-value can be seen as a special case of documents. For many applications this is sufficient, but not for all cases.

Slide 8

Slide 8 text

Document Store ‣ Normally based on key-value stores (each document still has a unique key) ‣ Allow to save documents with logical similarity in „collections“ ‣ Treat data records as attribute-structured documents (data is no longer opaque) ‣ Often allows querying and indexing document attributes

Slide 9

Slide 9 text

‣ Custom traversals and built-in graph algorithms ‣ Mostly Property Graphs ‣ Example: Computer Science Bibliography Graph Store

Slide 10

Slide 10 text

*) Source: Martin Fowler, http://martinfowler.com/articles/nosql-intro.pdf Reporting RDBMS User activity log Cassandra Product Catalog MongoDB Analytics Cassandra Shopping Cart Riak Recommendations Neo4J Financial Data RDBMS User Sessions Redis Polyglot Persistence Example*
 Polyglot Persistence with ArangoDB Reporting RDBMS User activity log Cassandra Product Catalog ArangoDB Analytics Cassandra Shopping Cart ArangoDB Recommendations ArangoDB Financial Data ArangoDB User Sessions ArangoDB

Slide 11

Slide 11 text

Convenient querying Different scenarios require different access methods: ‣ Query a document by its unique id / key: GET /_api/document/users/12345 ‣ Query by providing an example document: PUT /_api/simple/by-example { "name": "Jan", "age": 38 } ‣ Query via AQL: FOR user IN users FILTER user.active == true RETURN { name: user.name } ‣ Graph Traversals und JS for your own traversals ‣ JS Actions for “intelligent” DB request

Slide 12

Slide 12 text

Other Document Stores ‣ MongoDB uses JSON/BSON ‣ Limited ‣ Hard to read & write for more complex queries ‣ Complex queries, joins and transactions not possible ‣ CouchDB uses Map/Reduces ‣ It‘s not a relational algebra, and therefore hard to generate ‣ Not easy to learn (depending on where you’re coming from) ‣ Complex queries, cross collection joins and transactions not possible

Slide 13

Slide 13 text

Why you may want a more expressive query language

Slide 14

Slide 14 text

Why you may want a more expressive query language

Slide 15

Slide 15 text

Why you may want a more expressive query language

Slide 16

Slide 16 text

Why you may want a more expressive query language

Slide 17

Slide 17 text

ArangoDB Query Language (AQL)

Slide 18

Slide 18 text

Example for Aggregation ‣ Retrieve cities with the number of users: FOR u IN users COLLECT city = u.city INTO g RETURN { "city" : city, "numUsersInCity": LENGTH(g) }

Slide 19

Slide 19 text

Example for Graph Query ‣ Paths: FOR u IN users LET userRelations = ( FOR p IN PATHS( users, relations, "OUTBOUND" ) FILTER p._from == u._id RETURN p ) RETURN { "user" : u, "relations" : userRelations }

Slide 20

Slide 20 text

Extendable through JavaScript ‣ Integrated JavaScript via Google’s V8 ‣ Multi Collection Transactions ‣ Building small and efficient Apps - Foxx App Framework ‣ Individually Graph Traversals ‣ Cascading deletes/updates ‣ Assign permissions to actions ‣ Aggregate data from multiple queries into a single response ‣ Carry out data-intensive operations

Slide 21

Slide 21 text

Action Server Some kind of Application Server ‣ Extend the HTTP based API of ArangoDB ‣ In ArangoDB you can extend the API of the database ‣ Write your own JavaScript functions (“actions”) that will be executed server-side ‣ Includes a permission system ‣ A framework called Foxx makes this simple ‣ You can even deactivate the normal API and talk to the database directly from the client

Slide 22

Slide 22 text

High performance & space efficiency ‣ Automatic schema recognition ‣ Performance oriented architecture with a C database core, a C++ communication layer, JS and C++ for additional functionality ‣ Performance critical points can be transformed to C oder C++ ‣ Let’s look at some stats

Slide 23

Slide 23 text

Space Efficiency ‣ Measure the space on disk of different data sets ‣ First in the standard config, then with some optimisation ‣ We measured a bunch of different tasks

Slide 24

Slide 24 text

Store 50,000 Wiki Articles

Slide 25

Slide 25 text

3,459,421 AOL Search Queries

Slide 26

Slide 26 text

Performance: Disclaimer ‣ Always take performance tests with a grain of salt ‣ Performance is very dependent on a lot of factors including the specific task at hand ‣ This is just to give you a glimpse at the performance ‣ Always do your own performance tests (and if you do, report back to us :) ) ‣ But now: Let‘s see some numbers

Slide 27

Slide 27 text

Execution Time: Bulk Insert of 10,000,000 documents

Slide 28

Slide 28 text

Conclusion from Tests ‣ ArangoDB is really space efficient ‣ ArangoDB is “fast enough” ‣ Please test it for your own use case

Slide 29

Slide 29 text

Admin Frontend Graph Explorer

Slide 30

Slide 30 text

ArangoDB & Ruby ‣ Ashikawa::Core is the low level driver for ArangoDB ‣ https://github.com/triagens/ashikawa-core ‣ Guacamole will be the ODM for Rails ‣ https://github.com/triagens/guacamole ‣ In an early stage

Slide 31

Slide 31 text

ArangoDB.explain() { "type": "2nd generation NoSQL database", "model": [ "document", "graph", "key-value" ], "openSource": true, "license“: "apache 2", "version": [ "1.3 stable", "1.4 alpha" ], "builtWith": [ "C", "C++", "JS" ], "uses": [ "Google V8" ], "mainFeatures": [ "Multi-Collection-Transaction", "Foxx API Framework", "ArangoDB Query Language", "Various Indexes", "API Server", "Automatic Schema Recognition" ] }