Stone: Dead-Simple Data Persistence

Get Version


→ ‘stone’




Getting Up and Running Usage

A Word About Finding Stuff





For small applications, a database can be overkill for storing your data in a consistent and organized manner. Therefore, Stone was built to provide plug-and-play data persistence for any application or framework. It is fast, and it is easy… therefore it is good.

You can check out an application that uses Merb+Stone here.

The source for that blog is here.


sudo gem install stone

Up and Running



Everywhere Else

Stone was designed to provide easy data storage management for any app, not just web ones.

That’s it! Remember, there are no databases to install with Stone. Instead, your data gets persisted to files within myapp/datastore/.


Model Files

Models are really easy to create. Here is an example:

  class Person
    include Stone::Resource   # gives you access to persistence methods
    # defines an attribute called "name" of type String
    field :name, String
    # defines an attribute called "email" of type String. 
    # Since :unique => true is set, "email" must be unique.
    field :email, String, :unique => true
    # Notifies Stone of a relationship between People and Jewels.
    # This allows for @person.jewels retrieval.
    has_many :jewels
    # both name and email must be present or errors will be added
    validates_presence_of :name, :email

For more validation methods, see here.

Get, Post, Put, and Delete

A Word About Finding Stuff

Stone uses a series of unique methods (à la DataMapper) to finding objects. You may use the following methods when searching:


This code is free to use under the terms of the MIT license.


PLEASE. Stone is extremely immature at this point—“stable” is the watchword for the moment.

The code is pretty well specced out, so make sure you don’t break anything by running rake ok every once in a while.

Please add specs for any new functionality you might add, and hit me up to commit. =D


Comments are welcome. Join me in the IRC channel #stone on freenode.

Nick DeMonner, 17th April 2008
Theme extended from Paul Battley