<?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>ArangoDB</title>
	<atom:link href="http://www.arangodb.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.arangodb.org</link>
	<description>The universal nosql database</description>
	<lastBuildDate>Wed, 22 May 2013 17:04:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Our plans on replication and sharding in ArangoDB</title>
		<link>http://www.arangodb.org/2013/05/22/replication-and-sharding-in-arangodb</link>
		<comments>http://www.arangodb.org/2013/05/22/replication-and-sharding-in-arangodb#comments</comments>
		<pubDate>Wed, 22 May 2013 17:00:51 +0000</pubDate>
		<dc:creator>Dorthe Lübbert</dc:creator>
				<category><![CDATA[Releases]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=2103</guid>
		<description><![CDATA[In ArangoDB&#8217;s google group there was recently an interesting discussion on what ArangoDB should offer in terms of replication and sharding. For the rest of you who does not follow the posts in the group, I have copied Frank Celler&#8217;saaa]]></description>
				<content:encoded><![CDATA[<p>In <a href="https://groups.google.com/forum/?fromgroups#!forum/arangodb">ArangoDB&#8217;s google group</a> there was recently an interesting discussion on what ArangoDB should offer in terms of replication and sharding. For the rest of you who does not follow the posts in the group, I have copied Frank Celler&#8217;s answer into this post:</p>
<p>Frank writes:</p>
<blockquote class="style2"><p>
We will start with a master-slave, asynchronous replication for 1.4. This has at least the following advantages:</p>
<ul>
<li>It is a good fit for most use cases.</li>
<li>It will allow us to implement backup as &#8220;slave&#8221;.</li>
<li>It easily gives you redundancy by setting up multiple instances.</li>
<li>It gives you read-scaling.</li>
</ul>
<p>There are also drawbacks. For example, you need to manually select and switch masters in case of fail-over. However, restricting to a simple solution (which is still hard enough to implement) should allow us to release V1.4 this summer. If you think about MySQL, you will see that in most case a master-slave replication is sufficient.</p>
<p>The next step will be master-master replication. This, however, requires more complex protocols like Paxos to elect a master and at least three nodes. We have to decide, if this will be in version 1.5 or maybe already 2.0. We have to see how much has to be changed.</p>
<p>We do not want to go the road Riak has chosen, to scale out unlimitedly.<br />
In our experience there really is a trade-off between &#8220;scaling&#8221; and &#8220;querying&#8221;. If you scale massively, than you restrict yourself basically to key/value queries. That is what Riak is extremely good at. That is not what we are aiming at. We want to replicate to a moderate number of computers and assume that most of the time the whole dataset fits onto a single computer. With SSD and RAM getting cheaper and cheaper, this is not a totally unreasonable assumption. However, there will be cases where we want to shard the data. If we do this, it will restrict the possible queries for that collection in some way. Maybe restricting complex queries to one shard or only allowing very simple queries on sharded collections. The same is true for transactions.</p>
<p>As Frank Meyer has pointed out, there will problems, if for instance you implement something based on the graph features and you become the next Twitter. However, if this happens no automagic sharding or replication will help you. Amazon changed their view of the world and throw away landmarks like consistency, so that they can put their vast amount of data into Dynamo. But this does require carefully planning of the application. If you have so much data, then you end up with Dynamo or Riak or some-other massively distributed key-value store.</p>
<p>With our replication and sharding feature, we would like to implement something useful for a lot of cases, but not for extreme ones. For instance, master-master replication makes automatic fail-over much easier. The setup will be more complex, because you need at least three nodes and you have to deal with inconsistencies. Various approaches exist. CouchDB keeps all the document versions, CouchBase only the newest, Riak has vector-clocks and CFRD (Conflict-Free Replicated Data) for some types. If we use conflict documents, then the applications need to be aware of them and handle them accordingly. Our idea here is, again, to start with something straight forward (e.g. last-write wins) and later give an alternative (e.g. conflict documents). The simple solution should be helpful in most cases; harder cases can be dealt with; extreme cases however require support from the application.
</p></blockquote>
<p>We are really looking forward to hearing your thoughts on this &#8211; let us know in the comments, via twitter, in the Google group or via good old email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/05/22/replication-and-sharding-in-arangodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ideas and Facts from scotland.js in Edinburgh</title>
		<link>http://www.arangodb.org/2013/05/14/ideas-and-facts-from-scotland-js-in-edinburgh</link>
		<comments>http://www.arangodb.org/2013/05/14/ideas-and-facts-from-scotland-js-in-edinburgh#comments</comments>
		<pubDate>Tue, 14 May 2013 11:53:33 +0000</pubDate>
		<dc:creator>Michael Hackstein</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[FOXX]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=2081</guid>
		<description><![CDATA[Test Driven Development I have been one of the lucky attendants of scotland.js in Edinburgh recently. It was a really nice &#38; informative conference, thanks to all people that made it possible. I did really like to see that TDDaaa]]></description>
				<content:encoded><![CDATA[<h2>Test Driven Development</h2>
<p>I have been one of the lucky attendants of <a title="scotland.js" href="http://scotlandjs.com">scotland.js</a> in Edinburgh recently.<br />
It was a really nice &amp; informative conference, thanks to all people that made it possible.<br />
I did really like to see that TDD is reaching the front-end developers finally.<br />
A lot of useful tools for this have been presented by James Shore, Bernard Kobos and Sebastian Golasch.<br />
In ArangoDB, TDD is in action all day and I am looking forward to improving our front-end testing even further using these awesome tools.</p>
<p>&nbsp;</p>
<h2>Front-end Development meets NoSQL</h2>
<p>Furthermore several talks focussing on front-end development have been given, e.g. by Gregor Martynus presenting <a title="Hoodie.js" href="http://hood.ie">Hoodie.js</a>.<br />
These front-end talks and my discussions with other attendees gave me the impression that front-end developers spend a lot of time deciding which database they should use.<br />
However many databases focus on one special task and have been optimised for it. If the developers follow the vision of polyglot-persistence which is quite common in the NoSQL world, several different databases have to be installed in order to use the best tool for each job. However maintaining such a crowd of databases is quite an effort and it is much harder to decide which data should be persisted in which database.</p>
<p>In practice many front-end developers could benefit from a more general solution that supports several use-cases. People on the conference expressed their need for a more general NoSQL database, giving the benefits of document-stores, graph-databases and key-value stores, which can serve a broad range of use cases. Additionally, using just one database can make it easier for developers to wrap their head around as they only have to learn one technology.</p>
<p>That said, I am getting more and more convinced that we are going in the right direction with our developments of ArangoDB, which is more general and serves as a document-store as well as a graph-database while only having one interface and one query language for both.</p>
<p>&nbsp;<br />
<a name="deployd_vs_foxx"></a></p>
<h2>Rapid API Development</h2>
<p>Another interesting talk has been held about <a title="deployd" href="http://deployd.com">deployd</a> &#8211; a web-based framework to create REST-APIs for MongoDB.</p>
<p>It is especially targeted for those applications where most of the program logic is in the front-end and the backend only has the task to persist data.<br />
It offers many convenience functions to define access rights on REST-calls as well as on documents and even document attributes.<br />
Furthermore it is shipped with an easy to use content management system.<br />
The general idea of deployd reminded me of the <a title="FOXX-framework" href="http://foxx.arangodb.org">FOXX-framework</a> that has just been released for ArangoDB and I have been asked about the differences between FOXX and deployd.<br />
For the curious ones I made a short list of main differences:</p>
<table border="0" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<th>Feature</th>
<th>deployd</th>
<th>FOXX</th>
</tr>
<tr>
<td>Database</td>
<td>MongoDB</td>
<td>ArangoDB</td>
</tr>
<tr>
<td>Collections</td>
<td>Bound to database</td>
<td>Bound to app</td>
</tr>
<tr>
<td>Routes</td>
<td>HTTP methods on collection names</td>
<td>User defined routes</td>
</tr>
<tr>
<td>Hosting</td>
<td>Cloud or own server</td>
<td>Own server (cloud in progress)</td>
</tr>
<tr>
<td>App sharing</td>
<td>Not built-in</td>
<td>Central repository</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/05/14/ideas-and-facts-from-scotland-js-in-edinburgh/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArangoDB 1.3.0 released</title>
		<link>http://www.arangodb.org/2013/05/12/arangodb-1-3-0-released</link>
		<comments>http://www.arangodb.org/2013/05/12/arangodb-1-3-0-released#comments</comments>
		<pubDate>Sun, 12 May 2013 18:19:41 +0000</pubDate>
		<dc:creator>Frank Celler</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Releases]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=2077</guid>
		<description><![CDATA[Features and Improvements The following list shows in detail which features have been added or improved in ArangoDB 1.3. ArangoDB 1.3 also contains several bugfixes that are not listed here. Changes to the Datafile Structure As the datafile structure hasaaa]]></description>
				<content:encoded><![CDATA[<h2>Features and Improvements</h2>
<p>The following list shows in detail which features have been added or improved in ArangoDB 1.3. ArangoDB 1.3 also contains several bugfixes that are not listed here.</p>
<h3>Changes to the Datafile Structure</h3>
<p>As the datafile structure has changed, please read the <a href="http://www.arangodb.org/manuals/current/Upgrading13.html">upgrade manual</a> carefully.</p>
<h3>Rapid API Development with FOXX</h3>
<p>A preview of the forthcoming Foxx is contained in 1.3. Please note that this is not the final version, Foxx is still experimental.</p>
<p>Foxx is a lightweight Javascript &#8220;micro framework&#8221; which allows you to build applications directly on top of ArangoDB and therefore skip the middleman (Rails, Django, Symfony or whatever your favorite web framework is). Inspired by frameworks like Sinatra Foxx is designed with simplicity and the specific use case of modern client-side MVC frameworks in mind.</p>
<p>The screencast at <a href="http://foxx.arangodb.org">http://foxx.arangodb.org</a> explains how to use Foxx.</p>
<h3>Transactions</h3>
<p>ArangoDB provides server-side transactions that allow executing multi-document and even multi-collection operations with ACID guarantees.</p>
<p>Transactions in ArangoDB are defined by providing a JavaScript object which needs to contain the transaction code, and some declarations about the collections involved in the transaction.</p>
<p>The transaction code will be executed by the server en bloc. If execution of any statement in the transaction code fails for whatever reason, the entire transaction will be aborted and rolled back.</p>
<p>Data modifications done by transactions become visible to following transactions only when a transaction succeeds. Data modifications that are performed by a still-ongoing transaction are not exposed to other parallel transactions. In fact, transactions on the same collection will be executed serially.</p>
<p>The following example will atomically transfer money from one user account to another:</p>
<pre>db._create("accounts");
db.accounts.save({ _key: "john", amount: 423 });
db.accounts.save({ _key: "fred", amount: 197 });

db._executeTransaction({
  collections: {
    write: "accounts"
  },
  params: {
    user1: "fred",
    user2: "john", 
    amount: 10
  },
  action: function (params) {
    var db = require("internal").db;
    var account1 = db.accounts.document(params['user1']);
    var account2 = db.accounts.document(params['user2']);
    var amount = params['amount'];

    if (account1.amount &lt; amount) {
      throw "account of user '" + user1 + "' does not have enough money!";
    }

    db.accounts.update(account1, { amount : account1.amount - amount });
    db.accounts.update(account2, { amount : account2.amount + amount });

    /* will commit the transaction and return the value true */
    return true; 
  }
});</pre>
<p>Please refer to <a href="http://www.arangodb.org/manuals/current/Transactions.html">Transactions</a> for more details and examples on transaction usage in ArangoDB.</p>
<h3>New Administration Interface</h3>
<p>ArangoDB 1.3 comes with a new administration front-end. The front-end is now based on backbone and uses repl.it, which allows for instance line editing when using the browser based ArangoDB shell.</p>
<p>Please note, that the &#8220;Application&#8221; tab belongs to the forthcoming <a href="http://www.arangodb.org/manuals/current/NewFeatures13.html#NewFeatures13Foxx">Rapid API Development with FOXX</a> Foxx. The functionality below this tab is neither stable nor complete. It has been shipped as a feature preview.</p>
<h3>New Server Statistics</h3>
<p>The server statistics provided by ArangoDB have been changed in 1.3.</p>
<p>Before version 1.3, the server provided a multi-level history of request and connection statistics. Values for each incoming request and connection were kept individually and mapped to the chronological period they appeared in. The server then provided aggregated values for different periods, which was implemented using a constant recalculation of the aggregation values.</p>
<p>To lower ArangoDB&#8217;s CPU usage, the constant recalculation has been removed in 1.3. Instead, the server will now only keep aggregate values per figure reported, but will not provide any chronological values.</p>
<p>Request and connection statistics values are 0 at server start, and will be increased with each incoming request or connection. Clients querying the statistics will see the accumulated values only. They can calculate the values for a period of time by querying the statistics twice and calculating the difference between the values themselves.</p>
<p>The REST APIs for the statistics in ArangoDB 1.3 can be found at:</p>
<pre>/_admin/statistics
/_admin/statistics-description</pre>
<p>The <code>/_admin/statistics-description</code> API can be used by clients to get descriptions for the figures reported by <code>/_admin/statistics</code>. The description will contain a textual description, the unit used for the value(s) and the boundary of slot values used.</p>
<p>The previoulsy available APIs</p>
<pre>/_admin/request-statistics
/_admin/connection-statistics</pre>
<p>are not available in ArangoDB 1.3 anymore.</p>
<h3>AQL extensions</h3>
<p>It is now possible to extend AQL with user-defined functions. These functions need to be written in Javascript, and be registered before usage in an AQL query.</p>
<pre>arangosh&gt; var aqlfunctions = require("org/arangodb/aql/functions");
arangosh&gt; aqlfunctions.register("myfunctions:double", function (value) { return value * 2; }, true);
false
arangosh&gt; db._query("RETURN myfunctions:double(4)").toArray();
[ 8 ]</pre>
<p>Please refer to <a href="http://www.arangodb.org/manuals/current/ExtendingAql.html">Extending AQL with User Functions</a> for more details on this.</p>
<p>There have been the following additional changes to AQL in ArangoDB 1.3:</p>
<ul>
<li>added AQL statistical functions <code>VARIANCE_POPULATION</code>, <code>VARIANCE_SAMPLE</code>, <code>STDDEV_POPULATION</code>, <code>STDDEV_SAMPLE</code>, <code>AVERAGE</code>, <code>MEDIAN</code>. These functions work on lists.</li>
</ul>
<ul>
<li>added AQL numeric function <code>SQRT</code> to calculate square-roots.</li>
</ul>
<ul>
<li>added AQL string functions <code>TRIM</code>, <code>LEFT</code> and <code>RIGHT</code> for easier string and substring handling.</li>
</ul>
<ul>
<li>the AQL functions <code>REVERSE</code> and <code>LENGTH</code> now work on string values, too. Previously they were allowed for lists only.</li>
</ul>
<ul>
<li>made &#8220;limit&#8221; an optional parameter in the <code>NEAR</code> function. The &#8220;limit&#8221; parameter can now be either omitted completely, or set to 0. If so, an internal default value (currently 100) will be applied for the limit.</li>
</ul>
<p>Please refer to <a href="http://www.arangodb.org/manuals/current/Aql.html#AqlFunctions">Functions </a> for detailed information on the AQL functions.</p>
<h3>Node Modules and Packages</h3>
<p>ArangoDB 1.3 supports some of <a href="http://www.arangodb.org/manuals/current/JSModules.html#JSModulesNode">modules</a> and <a href="http://www.arangodb.org/manuals/current/JSModules.html#JSModulesNPM">packages</a> from node. The most important module is maybe the Buffer support, which allows to handle binary data in JavaScript.</p>
<pre>arangosh&gt; var Buffer = require("buffer").Buffer;
arangosh&gt; a = new Buffer("414243", "hex");
ABC
arangosh&gt; a = new Buffer("414243", "ascii");
414243
arangosh&gt; a = new Buffer([48, 49, 50]);
012</pre>
<p>Supplying the Buffer class makes it possible to use other interesting modules like punycode. It enables us to support some of NPM packages available &#8211; for instance CoffeeScript.</p>
<pre>arangosh&gt; var cs = require("coffee-script");
arangosh&gt; cs.compile("a = 1");
(function() {
  var a;

  a = 1;

}).call(this);

arangosh&gt; cs.compile("square = x -&gt; x * x", { bare: true });
var square;

square = x(function() {
  return x * x;
});</pre>
<p>&#8220;underscore&#8221; is also preinstalled.</p>
<pre>arangosh&gt; var _ = require("underscore");
arangosh&gt; _.map([1,2,3], function(x) {return x*x;});
[ 
  1, 
  4, 
  9 
]</pre>
<p>The node packages can be installed using npm in the &#8220;share/npm&#8221; directory. If you find out, that a node package is also working under ArangoDB, please share your findings with us and other users.</p>
<h3>Miscelleanous changes</h3>
<ul>
<li>Added server startup option <code>--database.force-sync-properties</code> to force syncing of collection properties on collection creation, deletion and on collection properties change.The default value is <code>true</code> to mimic the behavior of previous versions of ArangoDB. If set to <code>false</code>, collection properties are still written to disk but no immediate system call to sync() is made.
<p>Setting the <code>--database.force-sync-properties</code> to <code>false</code> may speed up running test suites on systems where sync() is expensive, but is discouraged for regular use cases.</li>
</ul>
<ul>
<li>ArangoDB will now reject saving documents with an invalid &#8220;type&#8221;.Previous versions of ArangoDB didn&#8217;t reject documents that were just scalar values without any attribute names.
<p>Starting with version 1.3, each document saved in ArangoDB must be a JSON object consisting of attribute name / attribute value pairs.</p>
<p>Storing the following types of documents will be rejected by the server:</p>
<pre>[ "foo", "bar" ]
1.23
"test"</pre>
<p>Of course such values can be stored inside valid documents, e.g.</p>
<pre>{ "data" : [ "foo", "bar" ] }
{ "number" : 1.23 }
{ "value" : "test" }</pre>
<p>User-defined document attribute names must also start with a letter or a number. It is disallowed to use user-defined attribute names starting with an underscore. This is due to name starting with an underscore being reserved for ArangoDB&#8217;s internal use.</li>
</ul>
<ul>
<li>Changed return value of REST API method <code>/_admin/log</code> <img src='http://www.arangodb.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> reviously, the log messages returned by the API in the <code>text</code> attribute also contained the date and log level, which was redundant.
<p>In ArangoDB 1.3, the values in the <code>text</code> attribute contain only the mere log message, and no date and log level. Dates and log levels for the individual messages are still available in the separate <code>timestamp</code> and <code>level</code> attributes.</li>
</ul>
<ul>
<li>Extended output of server version and components for REST APIs <code>/_admin/version</code> and <code>/_api/version</code>:To retrieve the extended information, the REST APIs can be called with the URL parameter <code>details=true</code>. This will provide a list of server version details in the <code>details</code> attribute of the result.</li>
</ul>
<ul>
<li>Extended output for REST API <code>/_api/collection/&lt;name&gt;/figures</code>:The result will now contain an attribute <code>attributes</code> with a sub-attribute <code>count</code>. This value provides the number of different attributes that are or have been used in the collection.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/05/12/arangodb-1-3-0-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foxx Screencast: Part 2</title>
		<link>http://www.arangodb.org/2013/05/06/foxx-screencast-part-2</link>
		<comments>http://www.arangodb.org/2013/05/06/foxx-screencast-part-2#comments</comments>
		<pubDate>Mon, 06 May 2013 16:01:02 +0000</pubDate>
		<dc:creator>Lucas Dohmen</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=2070</guid>
		<description><![CDATA[It has taken some time, but now part 2 of the Foxx Screencast is available. I talk about some more advanced topics of Foxx and also plans for the future.]]></description>
				<content:encoded><![CDATA[<p>It has taken some time, but now part 2 of the Foxx Screencast is available. I talk about some more advanced topics of Foxx and also plans for the future.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/d3TPtXEGhfk?rel=0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/05/06/foxx-screencast-part-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArangoDB 1.3.alpha1 and the first Foxx Screencast</title>
		<link>http://www.arangodb.org/2013/04/08/arangodb-1-3-alpha1-and-the-first-foxx-screencast</link>
		<comments>http://www.arangodb.org/2013/04/08/arangodb-1-3-alpha1-and-the-first-foxx-screencast#comments</comments>
		<pubDate>Mon, 08 Apr 2013 11:12:20 +0000</pubDate>
		<dc:creator>Lucas Dohmen</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=2026</guid>
		<description><![CDATA[Starting today you can install the first Alpha of the upcoming release of ArangoDB version 1.3. Some of the new features are: ArangoDB Foxx: A lightweight way to define APIs directly on top of ArangoDB Traversals: Define traversals to exploreaaa]]></description>
				<content:encoded><![CDATA[<p>Starting today you can install the first Alpha of the upcoming release of ArangoDB version 1.3. Some of the new features are:</p>
<ul>
<li><strong>ArangoDB Foxx:</strong> A lightweight way to define APIs directly on top of ArangoDB</li>
<li><strong>Traversals:</strong> Define traversals to explore your graphs stored in ArangoDB</li>
<li><strong>A new and improved Frontend:</strong> Featuring a new design and various improvements</li>
<li><strong>And more:</strong> Multi-Collection transaction support, user defined functions in AQL, more builtin AQL functions and AQL improvements, bug-fixes&#8230;</li>
</ul>
<h3>ArangoDB Foxx: The first screencast</h3>
<p>If you want to get a first look at ArangoDB Foxx, you can now see our first screencast. Lucas talks about the motivation and goals of Foxx and introduces you to the basics. A second screencast will follow with more advanced techniques like our Repositories and Models:</p>
<p><iframe width="588" height="320" src="https://www.youtube.com/embed/lR429gig_kU?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></p>
<h3>How to install it?</h3>
<ul>
<li>If you are on a Mac and using Homebrew, you can install it now via<br />
            <code>brew install --devel arangodb</code>.</li>
<li>If you are compiling ArangoDB by yourself, checkout the branch <code>1.3</code> from github and compile it.</li>
<li>if you are using Linux, we have create package for the usual distributions. You can download them from <a href="https://www.arangodb.org/repositories/devel/index.html">here</a>.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/04/08/arangodb-1-3-alpha1-and-the-first-foxx-screencast/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foxx &#8211; a lightweight Javascript application framework for ArangoDB</title>
		<link>http://www.arangodb.org/2013/03/29/foxx-a-lightweight-javascript-application-framework-for-arangodb</link>
		<comments>http://www.arangodb.org/2013/03/29/foxx-a-lightweight-javascript-application-framework-for-arangodb#comments</comments>
		<pubDate>Fri, 29 Mar 2013 09:33:47 +0000</pubDate>
		<dc:creator>Lucas Dohmen</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=1977</guid>
		<description><![CDATA[For the last months we have been working on Foxx &#8211; a brand new Javascript framework on top of the upcoming version of the free and open source NoSQL database ArangoDB. Foxx allows you to build APIs directly on topaaa]]></description>
				<content:encoded><![CDATA[<p>For the last months we have been working on Foxx &#8211; a brand new Javascript framework on top of the upcoming version of the free and open source NoSQL database ArangoDB.<br />
Foxx allows you to build APIs directly on top of the database and therefore skip the middleman (Rails, Django, Symfony or whatever your favorite web framework is). Foxx is designed with simplicity and the specific use case of modern client-side MVC frameworks in mind.<br />
There are a couple of very interesting scenarios for Foxx:</p>
<ul>
<li>You want to build a Single Page Web Application: most of the business logic is in the Javascript frontend. The backend’s most important task is to persist the data and send data to the client plus a bit of auth, modify, validate logic.  In this case ArangoDB plus a Foxx application is all you need as a backend.</li>
<li>Another use case is a mobile app either native or HTML5. Again you’ll have most of the logic already in the frontend (the app in this case). With Foxx you can create your API very easily. And as you don’t have a large full-size MVC stack included, your backend will be very, very fast.</li>
</ul>
<p>You might want to consider Foxx even as lightweight, easy-to-learn alternative to <b>Node.js</b>.</p>
<h2>How does it work?</h2>
<p>Foxx apps are written in Javascript, the Javascript code is stored in production mode in the database. A Foxx app consists of a manifest file (a kind of central config file), the javascript application code, additional libraries like Backbone you might want to use, images and other assets.<br />
As in similarly structured frameworks like Sinatra or Silex you define your own routes and assign functions to the routes. In these functions you have full access to the database.<br />
Well, we all want to see code instead of reading long texts, so here is the not so awesome “Hello World” app in Foxx.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">app <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> FoxxApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
app.<span style="color: #000066; font-weight: bold;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/hello/:name&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>req<span style="color: #339933;">,</span> res<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">var</span> name <span style="color: #339933;">=</span> req.<span style="color: #660066;">params</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  res.<span style="color: #000066; font-weight: bold;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Content-Type&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  res.<span style="color: #660066;">body</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello &quot;</span> <span style="color: #339933;">+</span> name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
app.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span>applicationContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Assuming we have a default ArangoDB installation and ArangoDB is running on port 8259 the browser can now access a url  http://localhost:8259/hello/{something} via REST. The database matches the url and returns “Hello {something}”.<b><b> </b></b></p>
<p>Is that all? Of course not. If you like to separate controller like logic from model related functionality, you can do this with Foxx as well. We don’t want to show this in detail in this very first announcement, but if you want to sneak a peek, have a look at Michael’s <a href="https://github.com/mchacki/aye_aye">“todo app” implementation in Foxx</a>.</p>
<h2>What else is in Foxx?</h2>
<ul>
<li>Routes can have typed parameters (“foo” = string)</li>
<li>Routes can have annotations &#8211; the api documentation can be generated automatically from the annotations using Swagger</li>
<li>Foxx offers support for modules</li>
<li>Support for CoffeeScript</li>
<li>Support for the Underscore template engine is built in, other libs can be used as well.</li>
<li>The asset delivery system is easy to use and straight forward</li>
<li>“Format middleware”: React to certain request types (e.g. JSON) in a straight forward way</li>
<li>In development mode you edit your application files with your favorite editor/IDE. ArangoDB will read the files from the disk with each request. In production mode the code is stored inside of ArangoDB for faster response.</li>
<li>Using the setup/teardown feature in the manifest file.</li>
<li>You can run multiple Foxx apps at the same time &#8211; take a Foxx blog, a Foxx chat, a Foxx forum -&gt; voilá, your community is ready</li>
<li>And: there will be a place to share Foxx apps</li>
</ul>
<h2>Is Foxx production ready?</h2>
<p>This is a technical preview for the open minded &#8211; get the <a href="https://github.com/triAGENS/ArangoDB/tree/preview/foxx" class="broken_link">feature preview branch</a> from Github, play around with it, give us some feedback and send us feature requests and muffins (we already have a real fox in the office, but if you have another one, come and bring it as a present as well). And yes, we are going to provide binaries very soon. And: not all features are done yet. On top of the list is the authentication feature, which will come next.</p>
<h2>Installing the demo app</h2>
<p>ArangoDB has now a “preview/Foxx” branch and a repository “ArangoDB-Apps” &#8211; The demo todo app called “aye_aye” is available there. First start arangosh.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">var</span> aal <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;org/arangodb/aal&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Look for the “aye_aye” app in the repository:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> aal.<span style="color: #660066;">printFishbowl</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;aye_aye&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Name<span style="color: #339933;">:</span> aye_aye
Author<span style="color: #339933;">:</span> Michael Hackstein
&nbsp;
Description<span style="color: #339933;">:</span>
This a demo application implement a ToDo list based on TodoMVC.
&nbsp;
1.0.7<span style="color: #339933;">:</span> aal.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;github&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;mchacki/aye_aye&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;v1.0.7&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>There is one version listed above, so go ahead and load it:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> aal.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;github&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;mchacki/aye_aye&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;v1.0.7&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">&quot;path&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;/tmp/Foxx/share/arangodb/js/apps/aye_aye-1.0.7&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;error&quot;</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;code&quot;</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Check that it is loaded now:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">arangosh&amp;gt; aal.printAvailable()
&nbsp;
AppID              Name                  Version    Path
=================  ====================  ========== ===================================
app:aardvark:1.0   aardvark              1.0        aardvark
app:aye_aye:1.0.7  aye_aye               1.0.7      aye_aye-1.0.7</pre></td></tr></table></div>

<p>Next we make it available using the &#8220;/todos&#8221; route:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> aal.<span style="color: #660066;">installApp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;aye_aye&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;/todos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">&quot;appId&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;app:aye_aye:1.0.7&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;mountId&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;21447079&quot;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> aal.<span style="color: #660066;">printInstalled</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
MountID     AppID             Mount              Active  Devel
<span style="color: #339933;">==========</span>  <span style="color: #339933;">=========</span>         <span style="color: #339933;">=================</span>  <span style="color: #339933;">======</span>  <span style="color: #339933;">=====</span>
<span style="color: #CC0000;">21447079</span>    app<span style="color: #339933;">:</span>aye_aye<span style="color: #339933;">:</span>1.0.7 <span style="color: #339933;">/</span>todos             yes     no</pre></td></tr></table></div>

<p>Open your browser at<br />
<a href="http://localhost:8529/todos/" class="broken_link">http://localhost:8529/todos/</a></p>
<p>and enjoy!</p>
<p>To remove the app run:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">arangosh<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> aal.<span style="color: #660066;">uninstallApp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/todos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/03/29/foxx-a-lightweight-javascript-application-framework-for-arangodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-increment values in ArangoDB</title>
		<link>http://www.arangodb.org/2013/03/28/auto-increment-values-in-arangodb</link>
		<comments>http://www.arangodb.org/2013/03/28/auto-increment-values-in-arangodb#comments</comments>
		<pubDate>Thu, 28 Mar 2013 16:48:58 +0000</pubDate>
		<dc:creator>Jan Steemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Releases]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=1968</guid>
		<description><![CDATA[The most recent versions of ArangoDB offer more detailed control over what values will be auto-generated for the _key and _id attributes of documents. They also allow using predictable auto-increment sequences. ArangoDB 1.1 and before always auto-generated the values foraaa]]></description>
				<content:encoded><![CDATA[<p>The most recent versions of ArangoDB offer more detailed control over what values will be auto-generated for the <strong>_key</strong> and <strong>_id</strong> attributes of documents. They also allow using predictable auto-increment sequences.<br />
<span id="more-1968"></span></p>
<p>ArangoDB 1.1 and before always auto-generated the values for the <strong>_id</strong> attribute of documents, and since ArangoDB 1.2 there was the possibility to provide user-defined document keys in the <strong>_key</strong> attribute.</p>
<p>ArangoDB 1.2.2 extends this a bit more: each collection now has a set of so-called &#8220;key options&#8221;, which control if and how document keys are generated, and if users are allowed to provide their own <strong>_key</strong> values.</p>
<h2>&#8220;Traditional&#8221; key generator</h2>
<p>When no &#8220;key options&#8221; are specified on collection creation, ArangoDB will use the &#8220;traditional&#8221; key generator by default.</p>
<p>This key generator will work in the same ways as ArangoDB 1.2 previously did. Each collection will happily accept user-defined <strong>_key</strong> values. If the user doesn&#8217;t specify any <strong>_key</strong> value, the server will auto-generate the value. The auto-generated <strong>_key</strong> values will be ever-increasing numbers, with a non-deterministic increment:</p>
<pre>arangosh&gt; db._create("users");
arangosh&gt; db.users.save({ name: "John" });
{ "_id" : "users/1533108862550", "_key" : "1533108862550", ... }
arangosh&gt; db.users.save({ name: "Jane" }); 
{ "_id" : "users/1533108993622", "_key" : "1533108993622", ... }</pre>
<h2>&#8220;Autoincrement&#8221; key generator</h2>
<p>To get better control over the generated <strong>_key</strong> values, there is the &#8220;autoincrement&#8221; key generator. This key generator will generate much &#8220;nicer&#8221; and predictable keys. It can activated as follows when a collection is created:</p>
<pre>arangosh&gt; db._create("users", { 
  keyOptions: { 
    type: "autoincrement" 
  } 
});

arangosh&gt; db.users.save({ name: "John" });
{ "_id" : "users/1", "_key" : "1", ... }
arangosh&gt; db.users.save({ name: "Jane" });
{ "_id" : "users/2", "_key" : "2", ... }</pre>
<p>The start value and the actual increment values for the sequence can optionally be adjusted when the collection is first created:</p>
<pre>arangosh&gt; db._create("users", { 
  keyOptions: { 
    type: "autoincrement", 
    offset: 5, 
    increment: 12 
  } 
});

arangosh&gt; db.users.save({ name: "John" });
{ "_id" : "users/5", "_key" : "5", ... }
arangosh&gt; db.users.save({ name: "Jane" });
{ "_id" : "users/17", "_key" : "17", ... }</pre>
<p>Auto-generated and user-specified keys can also be mixed. We&#8217;ll now create a document using our own key, and after that create a document and let the server generate the next <strong>_key</strong> value:</p>
<pre>arangosh&gt; db.users.save({ name: "James", _key: "18" });
{ "_id" : "users/18", "_key" : "18", ... }
arangosh&gt; db.users.save({ name: "Jack" });
{ "_id" : "users/29", "_key" : "29", ... }</pre>
<p>Note that the auto-generated <strong>_key</strong> value of &#8220;29&#8243; is in line with the auto-increment rules initially specified (offset 5, increment 12).</p>
<h2>Disallowing user-defined keys</h2>
<p>In some cases it may make sense to give the server the sole responsibility for generating the <strong>_key</strong> values, and to disallow user-supplied keys completely. This is supported in ArangoDB by creating a collection and setting the &#8220;allowUserKeys&#8221; attribute to false. Whenever there is an attempt then to insert a document with a user-defined key, the server will reject it:</p>
<pre>arangosh&gt; db._create("users", { 
  keyOptions: { 
    type: "autoincrement", 
    allowUserKeys: false 
  } 
});

arangosh&gt; db.users.save({ name: "Jack" });
{ "_id" : "users/1", "_key" : "1", ... }
arangosh&gt; db.users.save({ name: "James", _key: "18" });
JavaScript exception in file '/org/arangodb/arangosh' at 104,11: 
[ArangoError 1222: collection does not allow using user-defined keys]
!    throw new ArangoError(requestResult)</pre>
<p>As noted above, the feature has been made available in recent versions of ArangoDB 1.2, and is thus contained in the ArangoDB 1.2.2 builds, which are available for download <a title="Download" href="http://www.arangodb.org/download">here</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/03/28/auto-increment-values-in-arangodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(German video) Nosql meets mobile.cologne</title>
		<link>http://www.arangodb.org/2013/03/21/german-video-nosql-meets-mobile-cologne</link>
		<comments>http://www.arangodb.org/2013/03/21/german-video-nosql-meets-mobile-cologne#comments</comments>
		<pubDate>Thu, 21 Mar 2013 16:06:38 +0000</pubDate>
		<dc:creator>Dorthe Lübbert</dc:creator>
				<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=1961</guid>
		<description><![CDATA[Last week Jan (core member of ArangoDB and the brain behind AQL and many other parts) was invited by &#8220;mobile.cologne&#8221; &#8211; a user group here in Cologne dealing with mobile development. In this talk Jan gives a general overview onaaa]]></description>
				<content:encoded><![CDATA[<p>Last week Jan (core member of ArangoDB and the brain behind AQL and many other parts) was invited by &#8220;mobile.cologne&#8221; &#8211; a user group here in Cologne dealing with mobile development.</p>
<p>In this talk Jan gives a general overview on nosql databases and the different flavors. He explains how to query a nosql database and he evaluates how a nosql database can be used in a mobile app.</p>
<p>Warning: The talk is in German. If you want to hear it in English, let us know in the comments. <img src='http://www.arangodb.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><iframe src="http://player.vimeo.com/video/62232544" frameborder="0" width="500" height="281"></iframe></p>
<p><a href="http://vimeo.com/62232544">&#8220;NoSQL meets mobile.cologne&#8221; by Jan Steemann</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/03/21/german-video-nosql-meets-mobile-cologne/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with ArangoDB and Symfony 2 &#8211; part 1</title>
		<link>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part1</link>
		<comments>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part1#comments</comments>
		<pubDate>Fri, 15 Mar 2013 11:00:58 +0000</pubDate>
		<dc:creator>Dorthe Lübbert</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=1809</guid>
		<description><![CDATA[This is part 1 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You&#8217;ll find the links to the other parts of this tutorial at the end of this text. In this tutorial we willaaa]]></description>
				<content:encoded><![CDATA[<div class="hint-box">This is part 1 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You&#8217;ll find the links to the other parts of this tutorial at the end of this text.</div>
<p>In this tutorial we will implement a very simple movie database as an example of how to use ArangoDB together with Symfony 2. We assume for the tutorial that you know the basic concepts of Symfony2. No prior ArangoDB knowledge is required.</p>
<p>The demo shows how to create, edit, update and delete movies, how to select a list of movies from the database in two different ways. We’ll use the simple query API for most examples. The “search for a topic” feature uses ArangoDB’s query language (AQL), a convenient sql-like way to query ArangoDB.</p>
<p>You can download the completed demo at <a title="Symfony nosql demo" href="https://github.com/luebbert42/symfony-arangodb">Github</a>.</p>
<p><span id="more-1809"></span><br />
<a href="http://www.arangodb.org/wp-content/uploads/2013/03/symfony-tutorial-img1.png"><img class="alignnone size-full wp-image-1813" title="List of movies" src="http://www.arangodb.org/wp-content/uploads/2013/03/symfony-tutorial-img1.png" alt="" width="754" height="342" /></a><span style="color: #000000; font-size: 1.8em; line-height: 1.5em;">A short word on ArangoDB</span></p>
<p>Warning &#8211; a paragraph of marketing ahead! <img src='http://www.arangodb.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ArangoDB is an open-source mostly-memory database with a flexible data model for documents and graphs for modern web applications.  With ArangoDB you build high performance applications in short time &#8211; it is schema-less and has a full-blown query language nevertheless (there is no need to write map/reduce functions if your queries get more complicate) . You can even extend ArangoDB by adding your own Javascript/Ruby methods to the database.</p>
<h2>Libraries &amp; infrastructure</h2>
<p>The following components are used</p>
<ul>
<li>ArangoDB 1.2 (installable via one-click-installers for many operating systems)</li>
<li>Symfony 2.2</li>
<li>the <a href="https://github.com/triAGENS/ArangoDB-PHP">ArangoDB PHP driver</a></li>
<li>the <a title="MopArangoDbBundle" href="https://github.com/m0ppers/MopArangoDbBundle">MopArangoDbBundle</a></li>
</ul>
<p>What’s this? Since Symfony is a PHP framework we need the PHP driver for ArangoDB. The MopArangoDbBundle integrates the PHP driver into Symfony: having this bundle installed, you can config the connection to ArangoDB in the config.yml (note: the bundle also offers a FOSUserBundle integration which is not used in this demo, but might be interested for you if you are looking for a  user management system out of the box).</p>
<h2>Installing ArangoDB</h2>
<p>Now grab your copy of ArangoDB from the <a title="download ArangoDB" href="https://www.arangodb.org/download">download page</a> and install it. There are binaries available for many common platforms (Linux, OSX, Windows). Make sure that ArangoDB is up and running by opening the graphical user interface in your browser:</p>
<p><a title="Admin interface" href="http://localhost:8529/_admin/html/index.html" class="broken_link">http://localhost:8529/_admin/html/index.html</a></p>
<h2>Configuring Symfony for use with ArangoDB</h2>
<p>First thing we have to do is to tell Symfony that we want to work with ArangoDB. So we add the two required bundles to composer.json and run “php composer.phar update” as usual.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// path/to/myapp/composer.json</span>
<span style="color: #3366CC;">&quot;require&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        …
        <span style="color: #3366CC;">&quot;triagens/ArangoDb&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;dev-devel&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">&quot;mop/arangodbbundle&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;dev-master&quot;</span>
         …
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>Note: for this tutorial a feature was added to the ArangoDB PHP driver which is only available in the  “dev-devel” branch at the time of writing this text.</p>
<p>Having MopArangodbBundle installed we can add our connection settings to config.yml</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="yaml" style="font-family:monospace;">//myapp/app/config/config.yml<span style="color: #007F45;">
mop_arango_db</span>:<span style="color: green;">
    default_connection</span><span style="font-weight: bold; color: brown;">: </span>main <span style="color: blue;">#will be set to the first connection if not present</span><span style="color: #007F45;">
    connections</span>:<span style="color: #007F45;">
        main</span>:<span style="color: green;">
            host</span><span style="font-weight: bold; color: brown;">: </span>127.0.0.1<span style="color: green;">
            port</span><span style="font-weight: bold; color: brown;">: </span><span style="">8529</span></pre></td></tr></table></div>

<p>We are done.</p>
<p>In Symfony we can now access the default connection to ArangoDB with</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mop_arangodb.default_connection'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h2>The end</h2>
<p>Congrats, you have reached the end of part 1 the tutorial. There is more:</p>
<ul>
<li>Symfony 2 &#038; ArangoDB &#8211; part 1: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part1">setup and getting a connection</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 2: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part2">data modelling &#038; fetching a list from the DB</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 3: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part3">working with forms &#038; data transformers</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 4: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part4">extending ArangoDB Document &#038; querying via AQL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with ArangoDB and Symfony 2 &#8211; part 2</title>
		<link>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part2</link>
		<comments>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part2#comments</comments>
		<pubDate>Fri, 15 Mar 2013 10:00:12 +0000</pubDate>
		<dc:creator>Dorthe Lübbert</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.arangodb.org/?p=1822</guid>
		<description><![CDATA[This is part 2 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You&#8217;ll find the links to the other parts of this tutorial at the end of this text. You can download the completedaaa]]></description>
				<content:encoded><![CDATA[<div class="hint-box">This is part 2 (of 4) of an introduction to the use of ArangoDB together with Symfony 2. You&#8217;ll find the links to the other parts of this tutorial at the end of this text.<br />
<br />You can download the completed demo at <a href="https://github.com/luebbert42/symfony-arangodb">Github</a>.
</div>
<h2>The data structure</h2>
<p>Our app deals with movies: each movie has a title, a year of release and it is assigned to a genre. Each movie deals with none, one or many topics.</p>
<p>In a relational database we would probably create a table movie and another table topic and join them with a shared movie id.</p>
<p>ArangoDB follows like other document stores the “aggregate model” approach: In short terms this means that you should put data that is often needed together into one document. Remember: documents are a bit like rows in the relation world; in nosql world they can have a nested structure.</p>
<p><span id="more-1822"></span><br />
So our movie entity looks like this in JSON notation:</p>
<pre class="text" escaped="true">{
    "released": 1983,
    "genre": "sci-fi",
    "title": "Star wars",
    "topics": ["spaceship", "laser-games", "romance"]
}</pre>
<p>A remark for those who are not familiar with nosql databases yet: One of the advantages of document stores is the great flexibility of the data model. There could be movies in ArangoDB having 20 topics or no topics at all. There could also be some records for which additional information were provided like if there is a director’s cut available or not. Just add and remove attributes, as you need them. This is especially nice for prototyping or persisting objects which occur in many, slightly different versions like cars or clothing.</p>
<h2>Accessing our data in Symfony</h2>
<p>ArangoDB returns JSON, but we won’t see raw JSON in Symfony necessarily. The ArangoDB driver maps the JSON documents to instances of ArangoDbDocument automatically. We can access the properties of our movie documents with get and set methods:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span>“title”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// string(9) &quot;Star Wars&quot;</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span>“topics”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// array(3)</span></pre></td></tr></table></div>

<p>Of course we can also extend ArangoDBDocument to create a more specialized movie entity class. We’ll see that later on when we have a look at our CRUD code.</p>
<p>ArangoDB and the PHP driver for ArangoDB offer “simple queries” for basic operations like “get document by id” or “get all movies with attribute = ‘foo’”. This becomes messy for joins and more complex conditions. Therefore ArangoDB also supports a full-blown query language (AQL).</p>
<p>And yes, we are hearing you asking: Why the heck did they invent a new query language, SQL is great, isn’t it? The main reason for developing our own query language was that ArangoDB offers lots of functionality which is not covered by the SQL language standard: you can’t express graph relations, there is no proper support for lists and so on.</p>
<h2>The first feature: Listing movies using the simple query API</h2>
<p>Our movie database should be able to list movies. To make it at least a little bit more interesting the list is split by genre. The genre is set via GET parameter from the user interface.</p>
<p><a href="http://www.arangodb.org/wp-content/uploads/2013/03/symfony-tutorial-img2.png"><img class="alignnone size-full wp-image-1835" title="genre as request parameter in the movies list" src="http://www.arangodb.org/wp-content/uploads/2013/03/symfony-tutorial-img2.png" alt="" width="750" height="270" /></a></p>
<p>We are using ArangoDB’s simple query API for this feature. This API has a method “byExample” which will return all documents with the same characteristics as the given example document. The method returns a cursor which we’ll pass to the Twig template.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// src/Triagens/ArangodbBundle/Controller/DefaultController.php</span>
<span style="color: #000000; font-weight: bold;">use</span> triagens\ArangoDb\Document<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> triagens\ArangoDb\CollectionHandler <span style="color: #b1b100;">as</span> CollectionHandler<span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
* @Route(&quot;/list/{genre}&quot;, defaults={&quot;genre&quot; = &quot;sci-fi&quot;})
* @Template
*/</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> listAction<span style="color: #009900;">&#40;</span><span style="color: #000088;">$genre</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// get connection to ArangoDB</span>
    <span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mop_arangodb.default_connection'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$collectionHandler</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CollectionHandler<span style="color: #009900;">&#40;</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// create example document which is used for the search by example afterwards</span>
    <span style="color: #000088;">$movie</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Document<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;genre&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$genre</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$cursor</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$collectionHandler</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">byExample</span><span style="color: #009900;">&#40;</span>“movies”<span style="color: #339933;">,</span><span style="color: #000088;">$movie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'movies'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$cursor</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The Twig part is pretty straight forward as well. Note how you can access the movie’s attributes and in line 7 that “topics” is an array you can iterate through.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">// src/Triagens/ArangodbBundle/Resources/views/list.html.twig
{% if movies|length &gt; 0 %}
    {% for movie in movies %}
&nbsp;
        &lt;h1&gt;{{movie.get(&quot;title&quot;)}}&lt;/h1&gt;
&nbsp;
        {% for topic in movie.get(&quot;topics&quot;) %}
            - {{topic}} &lt;br&gt;
        {% endfor %}
&nbsp;
    {% endfor %}
&nbsp;
{% else %}
    No movies found.
{% endif %}</pre></td></tr></table></div>

<h2>The end</h2>
<p>Congrats, you have reached the end of part 2 the tutorial. There is more:</p>
<ul>
<li>Symfony 2 &#038; ArangoDB &#8211; part 1: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part1">setup and getting a connection</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 2: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part2">data modelling &#038; fetching a list from the DB</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 3: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part3">working with forms &#038; data transformers</a></li>
<li>Symfony 2 &#038; ArangoDB &#8211; part 4: <a href="http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part4">extending ArangoDB Document &#038; querying via AQL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.arangodb.org/2013/03/15/getting-started-with-arangodb-and-symfony-part2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
