<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Datablend &#187; datomic</title>
	<atom:link href="http://datablend.be/?cat=34&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://datablend.be</link>
	<description>Big Data Simplified</description>
	<lastBuildDate>Mon, 07 Sep 2015 09:04:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6.1</generator>
		<item>
		<title>8 things I like about Datomic</title>
		<link>http://datablend.be/?p=273</link>
		<comments>http://datablend.be/?p=273#comments</comments>
		<pubDate>Wed, 29 Aug 2012 09:56:11 +0000</pubDate>
		<dc:creator>Davy Suvee</dc:creator>
				<category><![CDATA[BigData.be]]></category>
		<category><![CDATA[datomic]]></category>
		<category><![CDATA[fluxgraph]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://datablend22.lin3.nucleus.be/?p=273</guid>
		<description><![CDATA[Yesterday evening, the 9th BigData.be MeetUp was organised at the offices of NGDATA in Ghent. With 45 people showing up, this was our best attended MeetUp till know, illustrating the growing popularity of Big Data in Belgium. The meeting had a line-up of three presentations: Kenny Helsens, who presented a wrap-up of the zimmo.be project<p><a href="http://datablend.be/?p=273">Continue Reading →</a></p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Yesterday evening, the <a href="http://www.meetup.com/bigdatabe/events/63141522" target='_blank'>9th BigData.be MeetUp</a> was organised at the offices of <a href="http://www.ngdata.com" target='_blank'>NGDATA</a> in Ghent. With 45 people showing up, this was our best attended MeetUp till know, illustrating the growing popularity of Big Data in Belgium.  The meeting had a line-up of three presentations:</p>
<ol>
<li>Kenny Helsens, who presented a wrap-up of the zimmo.be project</li>
<li>Gabriel Reid, who gave an introduction to <a href="http://incubator.apache.org/projects/crunch.html" target='_blank'>Apache Crunch</a>, of which is is a committer</li>
<li>Myself, giving a presentation on <a href="http://www.datomic.com" target='_blank'>Datomic</a> and <a href="http://github.com/datablend/blueprints" target='_blank'>FluxGraph</a></li>
</ol>
<p style="text-align: justify;">
<p style="text-align: justify;">The presentation highlights various aspects that, to my opinion, set Datomic apart from other types of noSQL databases. At the end of the presentation, I introduced <a href="http://github.com/datablend/blueprints" target='_blank'>FluxGraph</a>, a distributed, temporal graph database implemented on top of Datomic. FluxGraph implements the <a href="http://github.com/tinkerpop/blueprints" target='_blank'>Tinkerpop Blueprints API</a> and allows users to perform queries against a specific version of the graph in the past.  </p>
<p>Already looking forward to the next BigData.be MeetUp!<br />
<br />
<center><iframe src="http://www.slideshare.net/slideshow/embed_code/14102514" width="600" height="489" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></center></p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://datablend.be/?feed=rss2&#038;p=273</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphs, Graphs, Graphs, &#8230;</title>
		<link>http://datablend.be/?p=271</link>
		<comments>http://datablend.be/?p=271#comments</comments>
		<pubDate>Tue, 24 Jul 2012 09:54:22 +0000</pubDate>
		<dc:creator>Davy Suvee</dc:creator>
				<category><![CDATA[blueprints]]></category>
		<category><![CDATA[datomic]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[tinkerpop]]></category>

		<guid isPermaLink="false">http://datablend22.lin3.nucleus.be/?p=271</guid>
		<description><![CDATA[Last week, Datablend open-sourced two new Tinkerpop Blueprints implementations: blueprints-mongodb-graph and blueprints-datomic-graph. Tinkerpop is an open source project that provides an entire stack of technologies within the Graph Database space. At the core of this stack is the Blueprints framework. Blueprints can be considered as the JDBC of Graph Databases. By providing a collection of<p><a href="http://datablend.be/?p=271">Continue Reading →</a></p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Last week, Datablend open-sourced two new <a href="http://www.tinkerpop.com/" target="_blank">Tinkerpop</a> <a href="https://github.com/tinkerpop/blueprints/wiki" target="_blank">Blueprints</a> implementations: <a href="https://github.com/datablend/blueprints-mongodb" target="_blank">blueprints-mongodb-graph</a> and <a href="https://github.com/datablend/blueprints" target="_blank">blueprints-datomic-graph</a>. Tinkerpop is an open source project that provides an entire stack of technologies within the Graph Database space. At the core of this stack is the Blueprints framework. Blueprints can be considered as the <span class="highlight">JDBC</span> of Graph Databases. By providing a collection of generic interfaces, it allows to develop graph-based applications without introducing explicit dependencies on concrete Graph Database implementations. Additionally, Blueprints provides concrete bindings for the <a href="http://neo4j.org" target="_blank">Neo4J</a>, <a href=" http://www.orientechnologies.com" target="_blank">OrientDB</a> and <a href=" http://www.sparsity-technologies.com/dex" target="_blank">Dex</a> Graph Databases. On top of Blueprints, the Tinkerpop team developed an entire range of graph technologies, including <a href="https://github.com/tinkerpop/gremlin/wiki" target="_blank">Gremlin</a>, a powerful, domain-specific language designed for traversing graphs. Hence, once a Blueprints binding is available for a particular Graph Database, an entire range of technologies can be leveraged.</p>
<p>&nbsp;</p>
<h3>1. mongoDB Graph</h3>
<p style="text-align: justify;">The <a href="http://www.mongodb.org/" target="_blank">mongoDB</a> Blueprints implementation provides users with a <span class="highlight"><em>scalable</span>, <span class="highlight">distributed</em></span> Graph Database implementation.  mongoDB graph does not require any information on the underlying physical mongoDB setup, so read/write scalability can easily be achieved through mongoDB&#8217;s natively supported <span class="highlight"><em>replication</em></span> and <span class="highlight"><em>sharding</em></span> functionalities. Some initial benchmarks (writing/reading 100.000 vertices where each 2 vertices are connected through an edge) on a single mongoDB node shows the following performance:</p>
<script src="https://gist.github.com/3169096.js"></script>
<p style="text-align: justify;">Not too shabby for running it on a single mongoDB instance. Currently, each write is executed as a singular commit to the mongoDB store. Although this process could be improved by performing writes through optimized <span class="highlight"><em>batches</em></span>,  we need to ensure that the transactional semantics of the Blueprints stack are still respected. Further performance optimizations will be released soon, so keep an eye on the <a href="https://github.com/datablend/blueprints-mongodb" target="_blank">blueprints-mongodb-graph </a>github project.</p>
<p>&nbsp;</p>
<h3>2. Datomic Graph</h3>
<p style="text-align: justify;"><a href="http://datomic.com" target='_blank'>Datomic</a> is a novel distributed database system designed to enable scalable, flexible and intelligent applications, running on next-generation cloud architectures. Datomic employs a powerful data model (based upon the concept of <span class="highlight"><em>Datoms</em></span>) and an expressive query language (based upon the concept of <span class="highlight"><em>Datalog</em></span>. Additionally, it introduces an explicit notion of <span class="highlight"><em>time</em></span>, which allows for the execution of queries against both the <span class="highlight"><em>previous</em></span> and <span class="highlight"><em>future states</em></span> of the database. The RDF and SPARQL feel of the Datomic data model and query approach makes it an ideal target for implementing a property graph. Hence, the <a href="https://github.com/datablend/blueprints" target="_blank">blueprints-datomic-graph</a> Blueprints implementation.</p>
<p style="text-align: justify;">Clever use the time-aware nature of the Datomic datastore, makes Datomic Graph the very first <span class="highlight"><em>distributed</em></span>, <span class="highlight"><em>temporal graph database</em></span>: users can perform queries against a specific version of the graph in the past. The code sample below illustrates how a time-aware social graph can be created, stored and queried through the Datomic Graph implementation.</p>
<script src="https://gist.github.com/3169442.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">As one would expect, this outputs the following information:</p>
<script src="https://gist.github.com/3169500.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">Datomic Graph does not only support versioning of the vertices and edges, but also on the properties of individual vertices/edges. Pretty slick, not? We are currently enhancing the implementation with additional time-based operations, including the <span class="highlight"><em>easy comparison of subgraphs</em></span> over time. So stay tuned!</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://datablend.be/?feed=rss2&#038;p=271</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back To The Future with Datomic</title>
		<link>http://datablend.be/?p=269</link>
		<comments>http://datablend.be/?p=269#comments</comments>
		<pubDate>Thu, 12 Apr 2012 09:52:47 +0000</pubDate>
		<dc:creator>Davy Suvee</dc:creator>
				<category><![CDATA[datomic]]></category>

		<guid isPermaLink="false">http://datablend22.lin3.nucleus.be/?p=269</guid>
		<description><![CDATA[At the beginning of March, Rich Hickey and his team released Datomic. Datomic is a novel distributed database system designed to enable scalable, flexible and intelligent applications, running on next-generation cloud architectures. Its launch was surrounded with quite some buzz and skepticism, mainly related to its rather disruptive architectural proposal. Instead of trying to recapitulate<p><a href="http://datablend.be/?p=269">Continue Reading →</a></p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">At the beginning of March, Rich Hickey and his team released <a href="http://datomic.com" target='_blank'>Datomic</a>. Datomic is a novel distributed database system designed to enable scalable, flexible and intelligent applications, running on next-generation cloud architectures. Its launch was surrounded with quite some buzz and <a href="http://nosql.mypopescu.com/post/19310504456/thoughts-about-datomic" target='_blank'>skepticism</a>, mainly related to its rather disruptive architectural proposal. Instead of trying to recapitulate the various pros and cons of its architectural approach, I will try to focus on the other innovation it introduces, namely its powerful data model (based upon the concept of <span class="highlight"><em>Datoms</em></span>) and its expressive query language (based upon the concept of <span class="highlight"><em>Datalog</em></span>). The remainder of this article will describe how to store facts and query them through Datalog expressions and rules. Additionally, I will show how Datomic introduces an explicit notion of <span class="highlight"><em>time</em></span>, which allows for the execution of queries against both the <span class="highlight"><em>previous</em></span> and <span class="highlight"><em>future states</em></span> of the database. As an example, I will use a very simple data model that is able to describe genealogical information. As always, the complete source code can be found on the <a target='_blank' href="https://github.com/datablend/datomic-back-to-the-future">Datablend public GitHub repository</a>.</p>
<p>&nbsp;</p>
<h3>1. The Datomic data model</h3>
<p style="text-align: justify;">Datomic stores facts (i.e. your data points) as <span class="highlight"><em>datoms</em></span>. A datom represents the addition (or retraction) of a relation between an <span class="highlight"><em>entity</em></span>, an <span class="highlight"><em>attribute</em></span>, a <span class="highlight"><em>value</em></span>, and a <span class="highlight"><em>transaction</em></span>. The datom concept is closely related to the concept of a <span class="highlight"><em>RDF triple</em></span>, where each triple is a statement about a particular resource in the form of a <span class="highlight"><em>subject-predicate-object</em></span> expression. Datomic adds the notion of <span class="highlight"><em>time</em></span> by explicitly <span class="highlight"><em>tagging</em></span> a datom with a transaction identifier (i.e. the exact time-point at which the fact was persisted into the Datomic database). This allows Datomic to promote <span class="highlight"><em>data immutability</em></span>: updates are not changing your existing facts; they are merely creating new datoms that are tagged with a more recent transaction. Hence, the system keeps track of all the facts, forever.</p>
<p style="text-align: justify;">Datomic does <span class="highlight"><em>not enforce an explicit entity schema</em></span>; it&#8217;s up to the user to decide what type of attributes he/she want to store for a particular entity. Attributes are part of the Datomic meta model, which specifies the characteristics (i.e. attributes) of the attributes themselves. Our genealogical example data model stores information about persons and their ancestors. For this, we will require two attributes: <span class="highlight"><em>name</em></span> and <span class="highlight"><em>parent</em></span>. An attribute is basically an entity, expressed in terms of the <span class="highlight"><em>built-in system attributes</em></span> such as <em>cardinality</em>, <em>value type</em> and <em>attribute description</em>.</p>
<script src="https://gist.github.com/2366683.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">All entities in a Datomic database need to have an internal key, called the <span class="highlight"><em>entity id</em></span>. In our case, we generate a temporary id through the <code>tempid</code> utility method. All entities are stored within a specific <span class="highlight"><em>database partition</em></span> that groups together logically related entities. Attribute definitions need to reside in the <code>:db.part/db</code> partition, a dedicated system partition employed exclusively for storing system entities and schema definitions. <code>:person/name</code> is a single-valued attribute of value type <code>string</code>. <code>:person/parent</code> is a multi-valued attribute of value type <code>ref</code>. The value of a reference attribute points to (the id) of another entity stored within the Datomic database. Once our attribute schema is persisted, we can start populating our database with concrete person entities.</p>
<script src="https://gist.github.com/2366778.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">We will create three concrete persons: <em>myself</em>, my dad <em>Gilbert Suvee</em> and my grandfather <em>Edmond Suvee</em>. Similarly to the definition of attributes, we again employ the <code>tempid</code> utility method to retrieve temporary ids for our newly created entities. This time however, we store our persons within the <code>:db.part/user</code> database partition, which is the default partition for storing application entities. Each person is given a name (via the <code>:person/name</code> attribute) and parent (via the <code>:person/parent</code> attribute). When calling the <code>transact</code> method, each entity is translated into a set of individual <em>datoms</em> that together describe the entity. Once persisted, Datomic ensures that temporary ids are replaced with their final counterparts.</p>
<p>&nbsp;</p>
<h3>2. The Datomic query language</h3>
<p style="text-align: justify;">Datomic&#8217;s query model is an extended form of which will feel quite familiar to people who have experience with <a href="http://en.wikipedia.org/wiki/SPARQL" target='_blank'>SPARQL</a> and/or <a href="http://en.wikipedia.org/wiki/Prolog" target='_blank'>Prolog</a>. The declarative query language makes use of a <span class="highlight"><em>pattern matching</em></span> mechanism to find all combinations of values (i.e. facts) that satisfy a particular set of conditions expressed as clauses. Let&#8217;s have a look at a few example queries:</p>
<script src="https://gist.github.com/2366913.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">We consider entities to be of type <em>person </em>if they own a <code>:person/name</code> attribute. The <code>:where</code>-part of the first query, which aims at finding all persons stored in the Datomic database, specifies the following &#8220;conditional&#8221; clause: <code>[?person :person/name ?name]</code>. <code>?person</code> and <code>?name</code> are variables which act as placeholders. The Datalog query engine retrieves all facts (i.e. datoms) that match this clause. The <code>:find</code>-part of the query specifies the &#8220;values&#8221; that should be returned as the result of the query.</p>
<script src="https://gist.github.com/2367015.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">The second and the third query aim at retrieving the parents and grandparents of all persons stored in the Datomic database. These queries specify multiple clauses that are <span class="highlight"><em>solved</em></span> through the use of <span class="highlight"><em>unification</em></span>: when a variable name is used more than once, it must represent the same value in every clause in order to satisfy the total set of clauses. As expected, only <em>Davy Suvee</em> has been identified as having a grandparent, as the necessary facts to satisfy this query are not available for neither <em>Gilbert Suvee</em> and <em>Edmond Suvee</em>.</p>
<script src="https://gist.github.com/2367021.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">If several queries require this &#8220;grandparent&#8221; notion, one can define a reusable <span class="highlight"><em>rule</em></span> that encapsulates the required clauses. Rules can be flexibly combined with clauses (and other rules) in the <code>:where</code>-part of a query. Our third query can be rewritten using the following rules and clauses:</p>
<script src="https://gist.github.com/2367059.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">Rules can also be used to write <span class="highlight"><em>recursive queries</em></span>. Imagine the <span class="highlight"><em>ancestor</em></span>-relationship. It&#8217;s impossible to predict the number of parent-levels one needs to go up in order to retrieve the ancestors of a person. As Datomic rules supports the notion of recursion, a rule can call itself within its definition. Similar to recursion in other languages, recursive rules are build up out of a simple base case and a set of clauses which reduce all other cases toward this base case.</p>
<script src="https://gist.github.com/2367151.js"></script>
<script src="https://gist.github.com/2367158.js"></script>
<p>&nbsp;</p>
<h3>3. Back To The Future I</h3>
<p style="text-align: justify;">As already mentioned in section 1, Datomic does not perform <span class="highlight"><em>in-place updates</em></span>. Instead, all facts are stored and tagged with a transaction such that the most <span class="highlight"><em>up-to-date value</em></span> of a particular entity attribute can be retrieved. By doing so, Datomic allows you to travel back into time and perform queries against <span class="highlight"><em>previous states</em></span> of the database. Using the <code>asOf</code> method, one can retrieve a version of the database that only contains facts that were part of the database at that particular moment in time. The use of a checkpoint that predates the storage of my own person entity will result in parent-query results that do not longer contain results related to myself.</p>
<script src="https://gist.github.com/2367368.js"></script>
<script src="https://gist.github.com/2367412.js"></script>
<p>&nbsp;</p>
<h3>4. Back To The Future II</h3>
<p style="text-align: justify;">Datomic also allows to predict the future. Well, sort of &#8230; Similar to the <code>asOf</code> method, one can use the <code>with</code> method to retrieve a version of the database that gets extended with a list of not-yet transacted datoms. This allows to run queries against <span class="highlight"><em>future states</em></span> of the database and to observe the implications if these new facts were to be added.</p>
<script src="https://gist.github.com/2367475.js"></script>
<script src="https://gist.github.com/2367481.js"></script>
<p>&nbsp;</p>
<h3>5. Conclusion</h3>
<p style="text-align: justify;">The use of Datoms and Datalog allows you to express simple, yet powerful queries. This article introduces only a fraction of the features offered by Datomic. To get myself better acquainted with the various Datomic gotchas, I implemented the <a href="https://github.com/tinkerpop/blueprints/wiki/" target='_blank'>Tinkerpop Blueprints API</a> on top of Datomic. By doing so, you basically get a <span class="highlight"><em>distributed</em></span>, <span class="highlight"><em>temporal graph database</em></span>, which is, as far as I know, unique within the Graph database ecosystem. The source code of this Blueprints implementation can currently be found on the <a target='_blank' href="https://github.com/datablend/blueprints">Datablend public GitHub repository</a> and will soon be merged within the Tinkerpop project.</span>.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://datablend.be/?feed=rss2&#038;p=269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
