8 things i like about datomic

31
Tuesday 28.08 BIGDATA.BE

Upload: datablend

Post on 06-May-2015

3.220 views

Category:

Technology


3 download

DESCRIPTION

Introduction to Datomic that highlights its core feature set. Intorudction to FluxGraph, a temporal Graph Database implemented on top of Datomic.

TRANSCRIPT

Page 1: 8 things I like about Datomic

Tuesday

28.08 BIGD

ATA.

BE

Page 2: 8 things I like about Datomic

8 Things I like about Datomic

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

+ something about temporal graph databases

Page 3: 8 things I like about Datomic

About me

➡ Working as an it lead / software architect @ Janssen Diagnostics• Dealing with big scientific data sets

• Hands-on expertise in Big Data and NoSQL technologies

Who am I ...

Davy Suvee@DSUVEE

➡ Founder of datablend• Provide Big Data and NoSQL consultancy

• Share practical knowledge and Big Data use cases via blog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Page 4: 8 things I like about Datomic

1 - Data Immutability

Datom [ 10 ‘:name’ ‘datablend’ ]

entity attribute value

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Page 5: 8 things I like about Datomic

1 - Data Immutability

Datom [ 10 ‘:name’ ‘datablend’ ]

entity attribute value

‘dataother’

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Page 6: 8 things I like about Datomic

1 - Data Immutability

Datom [ 10 ‘:name’ ‘datablend‘ ]

entity attribute value

[ 10 ‘:name’ ‘DATAOTHER‘ ]

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

defines time

1

2

tx tx

Page 7: 8 things I like about Datomic

2 - Schema-Less kind of ...

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Util.map(":db/id", Peer.tempid(":db.part/db"),         ":db/ident", ":name",         ":db/valueType", ":db.type/string",         ":db/cardinality", ":db.cardinality/one",         ":db/doc", "The name of an entity",         ":db.install/_attribute", ":db.part/db"));

attribute definition

Page 8: 8 things I like about Datomic

3 - Everything is a Datom

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:tel’ ‘01234566789‘ ]

[ 11 ‘:name’ ‘Davy Suvee‘ ][ 11 ‘:knows’ ‘java‘ ][ 11 ‘:knows’ ‘NoSQL‘ ][ 11 ‘:founded’ 10 ]

[ 99 ‘:db/ident’ ‘:name’ ][ 99 ‘:db/valueType’ ‘:db.type/string’ ][ 99 ‘:db/cardinality’ ‘:db.cardinality/one’ ][ 99 ‘:db/doc’ ‘The name of an entity’ ][ 99 ‘:db.install/_attribute’ ‘:db.part/db’ ]

Page 9: 8 things I like about Datomic

3 - Everything Is A Datom

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[ 10 ‘:name’ ‘datablend‘ 251]

transaction

Page 10: 8 things I like about Datomic

3 - Everything Is A Datom

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[ 10 ‘:name’ ‘datablend‘ 251]

transaction

[ 251 ‘:db/txInstant’ ‘35454920495’ ] timestamp

Page 11: 8 things I like about Datomic

3 - Everything Is A Datom

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[ 10 ‘:name’ ‘datablend‘ 251]

transaction

[ 251 ‘:db/txInstant’ ‘35454920495’ ] timestamp

[ 251 ‘:source’ ‘:external’ ][ 251 ‘:url’ ‘bigdata.be’ ]

meta-data

Page 12: 8 things I like about Datomic

4 - Datalog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

logic programming for your datoms

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:tel’ ‘01234566789‘ ]

[ 11 ‘:name’ ‘Davy Suvee‘ ][ 11 ‘:knows’ ‘java‘ ][ 11 ‘:knows’ ‘NoSQL‘ ][ 11 ‘:founded’ 10 ]

[:find ?entity ?name :where [?entity :name ?name]]

(10 ‘datablend‘)(11 ‘Davy Suvee‘)

Page 13: 8 things I like about Datomic

4 - Datalog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

logic programming for your datoms

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:tel’ ‘01234566789‘ ]

[ 11 ‘:name’ ‘Davy Suvee‘ ][ 11 ‘:knows’ ‘java‘ ][ 11 ‘:knows’ ‘NoSQL‘ ][ 11 ‘:founded’ 10 ]

[:find ?name :where [?person :name ?name] [?person :knows ‘java’]]

(‘Davy Suvee‘)

Page 14: 8 things I like about Datomic

4 - Datalog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

logic programming for your datoms

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:tel’ ‘01234566789‘ ]

[ 11 ‘:name’ ‘Davy Suvee‘ ][ 11 ‘:knows’ ‘java‘ ][ 11 ‘:knows’ ‘NoSQL‘ ][ 11 ‘:founded’ 10 ]

[:find ?name :where [?com :name ?name] [?person :knows ‘java’] [?person :founded ?com]]

(‘datablend‘)

Page 15: 8 things I like about Datomic

4 - Datalog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

... and as everything is a datom ...

[:find ?attribute :where [?attribute :db/valueType :db.type/string]]

Page 16: 8 things I like about Datomic

4 - Datalog

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

... and as everything is a datom ...

[:find ?attribute :where [?attribute :db/valueType :db.type/string]]

[:find ?entity ?url :where [?entity :name “datablend” ?tx] [?tx :source :external] [?tx :url ?url]]

Page 17: 8 things I like about Datomic

5 - Power your queries

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[:find ?tech :where [_ :knows ?tech] [(.startsWith ?tech “J”)]]

any valid Java expression

Page 18: 8 things I like about Datomic

5 - Power your queries

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

[:find ?tech :where [_ :knows ?tech] [(.startsWith ?tech “J”)]]

any valid Java expression

[[(ancestor ?person ?ancestor) [?person :person/parent ?ancestor]] [(ancestor ?person ?ancestor) [?person :person/parent ?parent]                               (ancestor ?parent ?ancestor)]]]

recursive rules

Page 19: 8 things I like about Datomic

6 - Travel through time

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Peer.q(query, conn.db());

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:name’ ‘DATAOTHER‘ ]tx

tx 12

(‘dataother’)

String query = “[:find ?name :where [10 :name ?name]]”;

Page 20: 8 things I like about Datomic

6 - Travel through time

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Peer.q(query, conn.db());

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:name’ ‘DATAOTHER‘ ]tx

tx 12

(‘dataother’)

Peer.q(query, conn.db().asOf(tx1)); (‘datablend’)

String query = “[:find ?name :where [10 :name ?name]]”;

Page 21: 8 things I like about Datomic

6 - Travel through time

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

Peer.q(query, conn.db());

[ 10 ‘:name’ ‘datablend‘ ][ 10 ‘:name’ ‘DATAOTHER‘ ]tx

tx 12

(‘dataother’)

Peer.q(query, conn.db().asOf(tx1)); (‘datablend’)

String query = “[:find ?name :where [10 :name ?name]]”;

Peer.q(query, conn.db().with(futuretx)); (‘datamix’)

[ 10 ‘:name’ ‘datamix‘ ]

Page 23: 8 things I like about Datomic

8 - Pluggable data stores

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

➡ In memory (dev mode)

➡ SQL Database

➡ DYNAMO DB

➡ INFINISPAN

➡ Switch transparently and migration tools available

Page 25: 8 things I like about Datomic

FluxGraph

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

➡ Blueprints implementation on top of Datomic

Page 26: 8 things I like about Datomic

FluxGraph

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

➡ Blueprints implementation on top of Datomic

public void setTime(Date checkpoint);➡ Graph Time Travel

Page 27: 8 things I like about Datomic

FluxGraph

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

➡ Blueprints implementation on top of Datomic

public void setTime(Date checkpoint);

➡ Time-scoped iteration of vertices and edges

public Vertex getPreviousVersion();public Iterable<Edge> getNextVersions();public Iterable<Edge> getNextVersions(Filter filter);

➡ Graph Time Travel

Page 29: 8 things I like about Datomic

GraphConnect

www.datablend.be [email protected] 0499/05.00.89 Diepestraat 23 - heist-op-den-berg

“The use of Temporal Graph Databases to ease the analysis of longitudinal patient data”

Page 30: 8 things I like about Datomic

Questions?