Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

Lucas Dohmen ‣ From Cologne in Germany ‣ ArangoDB Core Team ‣ ArangoDB Foxx & Ruby Stuff ‣ Open Source Developer, Podcaster & CoderDojo Cologne Organizer 3 /\ (~( ) ) /\_/\ ( _-----_(@ @) ( \ / /|/--\|\ V " " " "

Slide 4

Slide 4 text

Also… ‣ I don’t speak Spanish :( ‣ Will start learning it with Duolingo now ‣ Thanks to the interpreters <3 4

Slide 5

Slide 5 text

Main Features 5 ‣ Open source and free ‣ Multi model database ‣ AQL ‣ Extendable through JS ‣ Replication & sharding ‣ High performance & space efficiency ‣ Powerful Admin Interface ‣ Ashikawa & Guacamole ‣ Started in Sep 2011 ‣ Current Version: 2.2

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

NoSQL is not “one thing” ‣ Almost all statements about ‘all NoSQL databases’ are probably wrong ‣ “NoSQL databases can’t do joins” ‣ “NoSQL databases don’t support transactions” ‣ A lot of different categories ‣ Graph Databases ‣ Data Structure Servers ‣ Aggregate Oriented Databases ‣ Time Series Databases ‣ … 7

Slide 8

Slide 8 text

Aggregate Oriented Database ‣ Martin Fowler’s Description of Key-Value, Document & Column Family ‣ Aggregate Oriented DB: Store an aggregate as one unit ‣ Aggregate: “A cluster of domain objects that can be treated as a single unit” ! ArangoDB ‣ Is an aggregate oriented database ‣ Allow to save documents with logical similarity in collections ‣ Automatic schema recognition for efficient memory handling 8

Slide 9

Slide 9 text

‣ Example: Computer Science Bibliography ! ! ! ! ! ArangoDB ‣ Is a graph database that supports property graphs ‣ Custom traversals and built-in graph algorithms Graph Database 9 Type: inproceeding Title: Finite Size Effects Type: proceeding Title: Neural Modeling Type: person Name: Anthony C. C. Coolen Label: written Label: published Pages: 99-120 Type: person Name: Snchez-Andrs Label: edited

Slide 10

Slide 10 text

Multi model database 10 I type: spaceshuttle v name: alice Ownership since: 2003

Slide 11

Slide 11 text

Why is that useful? 11 Entity Value Object Identified by… ID Value State is… Mutable Immutable Embed me! Add an edge to me!

Slide 12

Slide 12 text

AQL ‣ AQL is a relational algebra ‣ It features Joins ‣ Simple Example: FOR user IN users FILTER user.active == true RETURN { name: user.name } ‣ Other ways of querying: ‣ Query by Example ‣ Graph Traversals ‣ Foxx for extending your API 12

Slide 13

Slide 13 text

Why you may want a more expressive query language 13 Source: http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/ users friends commenter liker many many many many one one posts comments likes

Slide 14

Slide 14 text

users friends commenter liker many many many many one one posts comments likes Why you may want a more expressive query language 14 ‣ Model it as you would in a SQL database ‣ comments gets a commenter_id – then do a join

Slide 15

Slide 15 text

users friends commenter liker many many many many one one posts comments likes Why you may want a more expressive query language 15 ‣ Model it as you would in a document store ‣ posts embed comments as an array

Slide 16

Slide 16 text

users friends commenter liker many many many many one one posts comments likes Why you may want a more expressive query language 16 ‣ Model it as you would in a graph database ‣ users as nodes, friendships as edges

Slide 17

Slide 17 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) } 17

Slide 18

Slide 18 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 } 18

Slide 19

Slide 19 text

Extendable through JS ‣ JavaScript extends ArangoDB ‣ Multi Collection Transactions ‣ Extending the Web API ‣ Aggregate data from multiple queries into a single response ‣ Carry out data-intensive operations ‣ Individual Graph Traversals 19

Slide 20

Slide 20 text

‣ Single Page Web Applications ‣ Native Mobile Applications ‣ ext. Developer APIs ! ‣ ArangoDB has an HTTP API ‣ What if you could talk to the database directly? ‣ It would only need an HTTP API. ‣ What if we could define this API in JavaScript? HTTP APIs 20

Slide 21

Slide 21 text

ArangoDB Foxx 21 /\ (~( ) ) /\_/\ ( _-----_(@ @) ( \ / /|/--\|\ V " " " "

Slide 22

Slide 22 text

Foxx - Simple Example 22 Foxx = require("org/arangodb/foxx"); ! controller = new Foxx.Controller(appContext); ! controller.get("/users ", function(req, res) { res.json({ hello: }); }); req.params("name"); /:name

Slide 23

Slide 23 text

Foxx - More features ‣ Full access to ArangoDB‘s internal APIs: ‣ Simple Queries ‣ AQL ‣ Traversals ‣ … ‣ Automatic generation of interactive documentation ‣ Models and Repositories ‣ Central repository of Foxx apps for re-use and inspiration ‣ Background Worker ‣ Authentication Module (BasicAuth & OAuth 2.0) 23

Slide 24

Slide 24 text

FoxxGenerator ‣ Something I’m working on right now ‣ Build your REST API as a state machine ‣ REST as described by Fielding, not DHH ‣ If you are interested in this topic: Talk to me 24

Slide 25

Slide 25 text

Replication & Sharding ‣ Master/Slave Replication ✓ ‣ Sharding ✓ ‣ Get the whitepaper on our homepage ‣ Up Next: Auto-Failover 25

Slide 26

Slide 26 text

High performance & space efficiency ‣ ArangoDB supports automatic schema recognition, so it is one of the most space efficient document stores. ‣ Although ArangoDB has a wide range of functions, such as MVCC real ACID, schema recognition, etc., it can compete with popular document stores. 26

Slide 27

Slide 27 text

Powerful Admin Interface 27

Slide 28

Slide 28 text

gem 'guacamole' ‣ Can’t believe that gem name was still free ‣ It’s a Data Mapper ‣ http://guacamolegem.org ! ‣ It uses the ArangoDB Driver Ashikawa::Core 28

Slide 29

Slide 29 text

29 class PoniesCollection! include Guacamole::Collection! end! ! class Pony! include Guacamole::Model! ! attribute :name, String! attribute :color, String! ! validates :name, presence: true! end! ! pinkie = Pony.new(name: "Pinkie Pie")! PoniesCollection.save pinkie

Slide 30

Slide 30 text

Special Announcement 30 @horseconf (I’m @moonbeamlabs on Twitter, thanks!)