Ruby Archives - ArangoDB

Sign up for ArangoGraph Insights Platform

Before signing up, please accept our terms & conditions and privacy policy.

What to expect after you signup
You can try out ArangoDB Cloud FREE for 14 days. No credit card required and you are not obligated to keep using ArangoDB Cloud.

At the end of your free trial, enter your credit card details to continue using ArangoDB Cloud.

If you decide that ArangoDB Cloud is not (yet) for you, you can simply leave and come back later.

Getting started with Guacamole on Rails

02API, Documentation, RubyTags: ,

Please note that parts of this article will not work out of the box with ArangoDB 3.0

Using ArangoDB as your main database is a good idea for various reasons. What I personally like about it is its query language AQL. I used relational databases in the past as my main database and writing statements in a language similar to SQL was a great way for me to get started with ArangoDB.

Having a HTTP based interface (like all the cool kids these days) we could build applications running solely on top of our database. That’s rather nice but then we would have to take care of all the gory details. So for our app we want at least an abstraction layer on top of the HTTP API. Better yet, something assisting us with modeling our domain logic.

Meet Guacamole: A object-document-mapper that takes care of all the busywork and allows you to focus on your domain. More info

Guacamole released: an ODM for ArangoDB for rails

00Releases, RubyTags: ,

Rubyists, here is something for you: Dirk Breuer (@railsbros_dirk) and Lucas Dohmen (@moonbeamlabs) hav released the first version of Guacamole. The following text is taken from the Github repository:

Guacamole is an Object Document Mapper (ODM) for the multi-model NoSQL database ArangoDB. Its main goal is to support easy integration into Ruby on Rails but will likely work in other Rack-based frameworks as well. There are a couple of design goals behind Guacamole which should drive all our development effort:

  • Easy integration on the View layer (i.e. form builders)
  • Reflect the nature of NoSQL in general and ArangoDB in particular
  • Focus on long-term maintainability of your application

More info

MRuby, JIT, and ArangoDB at RuPy 2012

00API, Presentation, RubyTags: ,

@moonbeamlabs and I hold a workshop about ArangoDB and the Ruby driver Ashikawa, which will hopefully become one of the first DataMapper 2 NoSQL drivers. Currently, we are using the aequitas and virtus components of DataMapper 2.

Slides of the workshop can be found on slideshare:

I also gave a short talk about the possibilities of using MRuby in ArangoDB. In preparation for this talk, Achim did some experiments using JIT compilation of the RiteVM bytecode using LLVM. The results are consistent with result for other byte-compiled languages. You can expect a speed-up of 2 using LLVM. In order to gain larger improvements one needs type inference and optimizations to the method selection. Luckily within a context like ArangoDB one can expects to be dealing a lot with primitives types (floats and strings) and a fixed environment. So it seems plausible that one can eventually get near the performace of V8.

MRuby Links

01Application Server, RubyTags:

I’ve started the following collection of links, example code, projects, and articles about mruby. This list is most likely not complete, if you have other interesting articles please let me know. Especially sample code and mruby projects.

Article

Examples & Projects

FAQ

CRuby vs MRuby FAQ

02RubyTags:

At our last Ruby user group meeting it was asked, what the differences between CRuby and MRuby are. @junjis0203 wrote a MRuby FAQ. Unfortunately, it’s in Japanese. I’ve tried to translate it using http://www.excite.co.jp/world/english/ & Google translate and added my own findings.

Not all classes and method from CRuby are available in MRuby

MRuby does not guarantee to implement the features which are defined in ISO / IEC 30170

Regular Expression

Mruby allows you to switch features on or off depending on your needs and available space. These features are defined in “include/mrbconf.h”. One of the features is regular expression support, which is switched off by default.

More info

“Use-Cases for MRuby in a Database like ArangoDB” or “Can MRuby be the next PL/SQL?”

00RubyTags: ,

In the relational world, PL/SQL is used to store business/application logic inside the relational database. The same movement is currently happening in the NoSQL. Redis for example uses LUA script in its newest version (2.6), to allow developers to tweak Redis. There a lot of use-cases for a programming language in document-stores. Programming languages are used in various document stores like ArangoDB, CouchDB, MongoDB, or VoltDB. In my opinion in the following use-cases a suitable language like Ruby will be most handy.
More info