NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter



ruby: All content tagged as ruby in NoSQL databases and polyglot persistence

Pacer: Gremlin with Ruby Flavor

Sounds like ☞ Gremlin with Ruby’s syntactic sugar:

Let’s get two very fundamental differences out of the way first. First, Pacer uses Ruby as it’s language, employing method chaining to define traversal routes while Gremlin defines its own using a combination of xpath-like traversal definitions with its own procedural syntax for other functions. Secondly, Pacer does not have the concept of a current vertex or a current graph; the starting point of any traversal is explicit and there are no special variables like Gremlin’s $g and $.


Original title and link: Pacer: Gremlin with Ruby Flavor (NoSQL databases © myNoSQL)


NoSQL The Ruby Way

A not yet released ☞ book:

Wondering what would such a book cover. The tons of different APIs for each NoSQL database?

Original title and link: NoSQL The Ruby Way (NoSQL databases © myNoSQL)

Naive Bayes Classification in Ruby using Hadoop and HBase

I couldn’t find anything that could possibly handle many terabytes of data, though. Most Ruby implementations, like the classifier gem, have only a simplistic implementation […]. I decided to create a better naive bayes implementation (for instance, using a Laplacian smoother) that could also handle up to many terabytes of corpus data.

We already have a Hadoop cluster with HBase running, and HBase is perfect for storing data like word counts.

I guess you can imagine what happened next. GitHub project name ☞ ankusa.

Original title and link: Naive Bayes Classification in Ruby using Hadoop and HBase (NoSQL databases © myNoSQL)


MONGOID Cheat Sheet

☞ MONGOID, one of the most popular — one as in currently I can count at least 4: MongoMapper and MONGOID compared, MongoODM, and Mongomatic, a minimal mapper — MongoDB Ruby-based “Object-Relational Mapper”[1], got a ☞ cheat sheet.

If you are a rubyist working with MongoDB print it out as a PDF and have it around .

  1. Shouldn’t these mappers be called something like object-document mappers or document-object mappers?  ()

Original title and link: MONGOID Cheat Sheet (NoSQL databases © myNoSQL)

Ruby, Rails, and NoSQL: Cassandra, CouchDB, MongoDB

List of gems and brief installation notes and examples for using Cassandra, CouchDB, and MongoDB from Ruby on Rails:

In order to do so, we will review the following NoSQL databases: Cassandra, MongoDB and CouchDB. Ruby supports each one of them over corresponding gems. In this blog post we will be using Ruby 1.8.7 with Rails 3.0 under Ubuntu 9.10 OS.

Original title and link: Ruby, Rails, and NoSQL: Cassandra, CouchDB, MongoDB (NoSQL databases © myNoSQL)


Neo4j for Ruby

Andreas Ronge’s slides on using Neo4j from Ruby:

I’d use the embedded version with JRuby, otherwise ☞ I’d go REST.

Original title and link: Neo4j for Ruby (NoSQL databases © myNoSQL)

MongoDB: A ToDo App with Ruby and PHP

Sort of ☞ todo.txt, but using MongoDB with ☞ Ruby or ☞ PHP:

Earlier this summer, we kicked off a series on MongoDB where the goal was to write a simple todo application using native MongoDB drivers and three of our favorite scripting languages.

Original title and link: MongoDB: A ToDo App with Ruby and PHP (NoSQL databases © myNoSQL)

Redis-powered ACL for Ruby Apps: ACLatraz

Authentication options get a lot of press these days, but there is another Auth that can still be a pain: Authorization. ACLatraz from Kriss Kowalik caught our eye because it’s inspired by *nix Access Control Lists (ACLs), powered by Redis, and has a sense of humor.

I still think that graph databased are a better fit for ACL. But if you are already running Redis, why not having a library ready for dealing with ACL. Security is critical!

Original title and link: Redis-powered ACL for Ruby Apps: ACLatraz (NoSQL databases © myNoSQL)


Redis: Implementing Auto Complete or How to build Trie on Redis

In the days the news are about instant searches and auto complete, Salvatore Sanfilippo (@antirez) shows how to use Redis sorted sets and corresponding commands (ZRANGE, ZRANK) to implement autocompletion:

The initial code in Ruby:

already got ported to Python:

and ☞ Java and ☞ PHP.

As Ilya Grigorik (@igrigorik) commented, this is building a ☞ Trie with Redis.

Original title and link: Redis: Implementing Auto Complete or How to build Trie on Redis (NoSQL databases © myNoSQL)


MongoDB Ruby Driver Sees Major Speed Improvements

Hongli Lai (FooBarWidget@GitHub) worked on some improvements of the MongoDB Ruby driver:

The Ruby driver was quite inefficient with handling data. Strings (read from the network or passed by the user) were being unpacked into arrays all over the place and vice versa. We’ve modified the driver to work with strings instead of byte arrays as much as possible. Most notably: ByteBuffer has been rewritten to use a binary string as underlying storage object instead of an array.

The Ruby 1.8 implementation of BSON::OrderedHash was inefficient: it uses a Set even though it’s not necessary. We removed the dependency on Set and greatly improved OrderedHash’s 1.8 performance.

The end result is a driver that’s 274% faster on Ruby 1.8 and 204% faster on Ruby 1.9.


Original title and link for this post: MongoDB Ruby Driver Sees Major Speed Improvements (published on the NoSQL blog: myNoSQL)

MongoODM: A new Mongo ODM for Ruby

There have been only a few days since I’ve written that (maybe) there are already too may mapping tools for document databases. Then, we’ve heard about Mongomatic: a minimal Ruby mapper for MongoDB. And now it is MongoODM, yet another Ruby mapper for MongoDB that can be found on ☞ GitHub.

Basically, I’ve tried to create an ODM that uses the native query syntax of the Ruby driver, but that was:

  • Fully compatible with Rails 3
  • Use the Mongo ruby driver syntax over a new syntax (for queries, cursors, indexes management…)
  • Allow lazy loading of collections and queries nesting (concatenation of ‘find’ calls) to emulate ActiveRecord 3
  • No association methods (for now): Just declare your own methods on models to fetch associated items
  • Give support for dirty objects, validations, etc. through ActiveModel 3
  • Automanage type conversions and default values
  • Keep it as simple as possible

I made sure to ask the author, Carlos Paramio, why a new mapping tool for MongoDB? and what is it different in MongoODM compared to those other 3 MongoDB mapping libraries?

Carlos Paramio: The main reason for me creating this new ODM is that I felt the Mongo Ruby driver and its syntax (which is pretty similar to the native MongoDB syntax) is much more proper and richer than the syntax similar to the popular ActiveRecord ORM for Ruby — which is particularly designed for relational databases. Even if MongoMapper and MongoId are awesome projects, they both share this particular ActiveRecord-like syntax, which sometimes seems a bit forced and it generates weird bugs and unexpected behavior.

I preferred to use the official syntax and instead of writing tons of new code to bring all the other interesting features that you would expect from an Object Mapper (as an extra to the database driver), I used some stable and widely used Ruby libraries to provide: Validations, type conversions, dirty objects, nesting conditions, Rails 3 compatibility, etc.

There is a similar ODM by Ben Myles, who shares this same opinion about how a MongoDB ODM should work. It’s called MongoMatic, and it’s really cool. I think we started to code our ODMs at approximately same time, because we both have published stable versions of them recently (I’m particularly using MongoODM for my own project). MongoMatic doesn’t support some features like dirty objects, nesting conditions or Rails 3 compatibility yet, but it seems to be interesting to follow.

I think some people was expecting a solution like this. Like Kyle Banker has said (and I quote) recently in response to the MongoODM announcement at the mongodb-user mailing list: “Awesome. I love the trend of moving toward a more native MongoDB query syntax. Great to see the surge in new Ruby ODMs, too.”

Now the Ruby world of MongoDB has 4 mapping libraries and it is only the time and users that will decide if all of them are needed.

Original title and link for this post: MongoODM: A new Mongo ODM for Ruby (published on the NoSQL blog: myNoSQL)

Mongomatic: Minimal Ruby Mapper for MongoDB

I hope someone will update the MongoDB Ruby libraries comparison, currently including Mongoid and MongoMapper, to also include Mongomatic. For an outsider it’s difficult to say what’s unique about it.

Original title and link for this post: Mongomatic: Minimal Ruby Mapper for MongoDB (published on the NoSQL blog: myNoSQL)