All Projects → ioquatix → Relaxo

ioquatix / Relaxo

Relaxo is a transactional document database built on top of git.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Relaxo

Sequelize Ui
Browser-based GUI for previewing and generating Sequelize project files.
Stars: ✭ 142 (-4.7%)
Mutual labels:  database
Polluter
The easiest solution to seed database with Go
Stars: ✭ 146 (-2.01%)
Mutual labels:  database
Sqlitestudio
A free, open source, multi-platform SQLite database manager.
Stars: ✭ 2,337 (+1468.46%)
Mutual labels:  database
Dapper.fsharp
Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL and PostgreSQL
Stars: ✭ 145 (-2.68%)
Mutual labels:  database
Realm Java
Realm is a mobile database: a replacement for SQLite & ORMs
Stars: ✭ 11,232 (+7438.26%)
Mutual labels:  database
Datanymizer
Powerful database anonymizer with flexible rules. Written in Rust.
Stars: ✭ 147 (-1.34%)
Mutual labels:  database
Clickhouse Net
Yandex ClickHouse fully managed .NET client
Stars: ✭ 142 (-4.7%)
Mutual labels:  database
Bicing Api
Get statistics and locations of bicycle stations through REST API
Stars: ✭ 149 (+0%)
Mutual labels:  database
Postgres Meta
A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
Stars: ✭ 146 (-2.01%)
Mutual labels:  database
Openmicroscopy
OME (Open Microscopy Environment) develops open-source software and data format standards for the storage and manipulation of biological light microscopy data. A joint project between universities, research establishments and industry in Europe and the USA, OME has over 20 active researchers with strong links to the microscopy community. Funded by private and public research grants, OME has been a major force on the international microscopy stage since 2000.
Stars: ✭ 148 (-0.67%)
Mutual labels:  database
Lokidb
blazing fast, feature-rich in-memory database written in TypeScript
Stars: ✭ 145 (-2.68%)
Mutual labels:  database
Jnosql
Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Stars: ✭ 145 (-2.68%)
Mutual labels:  database
Graphql Genie
Simply pass in your GraphQL type defintions and get a fully featured GraphQL API with referential integrity, inverse updates, subscriptions and role based access control that can be used client side or server side.
Stars: ✭ 147 (-1.34%)
Mutual labels:  database
Metamodel
Mirror of Apache Metamodel
Stars: ✭ 143 (-4.03%)
Mutual labels:  database
Doobie
Functional JDBC layer for Scala.
Stars: ✭ 1,910 (+1181.88%)
Mutual labels:  database
Influxdata.net
InfluxData TICK stack .net library.
Stars: ✭ 142 (-4.7%)
Mutual labels:  database
Mongo Hacker
MongoDB Shell Enhancements for Hackers
Stars: ✭ 1,786 (+1098.66%)
Mutual labels:  database
Etcd Cloud Operator
Deploying and managing production-grade etcd clusters on cloud providers: failure recovery, disaster recovery, backups and resizing.
Stars: ✭ 149 (+0%)
Mutual labels:  database
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+1316.78%)
Mutual labels:  database
Faker Elixir
💧 FakerElixir generates fake data for you.
Stars: ✭ 147 (-1.34%)
Mutual labels:  database

Relaxo

Relaxo is a transactional database built on top of git. It's aim is to provide a robust interface for document storage and sorted indexes. If you prefer a higher level interface, you can try relaxo-model.

Development Status

Installation

Add this line to your application's Gemfile:

gem 'relaxo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install relaxo

Usage

Connect to a local database and manipulate some documents.

require 'relaxo'
require 'msgpack'

DB = Relaxo.connect("test")

DB.commit(message: "Create test data") do |dataset|
	object = dataset.append(MessagePack.dump({bob: 'dole'}))
	dataset.write("doc1.msgpack", object)
end

DB.commit(message: "Update test data") do |dataset|
	doc = MessagePack.load dataset.read('doc1.msgpack').data
	doc[:foo] = 'bar'

	object = dataset.append(MessagePack.dump(doc))
	dataset.write("doc2.msgpack", object)
end

doc = MessagePack.load DB.current['doc2.msgpack'].data
puts doc
# => {"bob"=>"dole", "foo"=>"bar"}

Document Storage

Relaxo uses the git persistent data structure for storing documents. This data structure exposes a file-system like interface, which stores any kind of data. This means that you are free to use JSON, or BSON, or MessagePack, or JPEG, or XML, or any combination of those.

Relaxo has a transactional model for both reading and writing.

Authors

By default, Relaxo sets up the repository author using the login name and hostname of the current session. You can explicitly change this by modifying database.config. Additionally, you can set this per-commit:

database.commit(message: "Testing Enumeration", author: {user: "Alice", email: "[email protected]"}) do |dataset|
	object = dataset.append("Hello World!")
	dataset.write("hello.txt", object)
end

Reading Files

path = "path/to/document"

DB.current do |dataset|
	object = dataset.read(path)

	puts "The object id: #{object.oid}"
	puts "The object data size: #{object.size}"
	puts "The object data: #{object.data.inspect}"
end

Writing Files

path = "path/to/document"
data = MessagePack.dump(document)

DB.commit(message: "Adding document") do |changeset|
	object = changeset.append(data)
	changeset.write(path, object)
end

Datasets and Transactions

Datasets and Changesets are important concepts. Relaxo doesn't allow arbitrary access to data, but instead exposes the git persistent model for both reading and writing. The implications of this are that when reading or writing, you always see a consistent snapshot of the data store.

Suitability

Relaxo is designed to scale to the hundreds of thousands of documents. It's designed around the git persistent data store, and therefore has some performance and concurrency limitations due to the underlying implementation.

Because it maintains a full history of all changes, the repository would continue to grow over time by default, but there are mechanisms to deal with that.

Performance

Relaxo can do anywhere from 1000-10,000 inserts per second depending on how you structure the workload.

Relaxo Performance
Warming up --------------------------------------
              single   129.000  i/100ms
Calculating -------------------------------------
              single      6.224k (±14.7%) i/s -    114.036k in  20.000025s
  single transaction should be fast
Warming up --------------------------------------
            multiple   152.000  i/100ms
Calculating -------------------------------------
            multiple      1.452k (±15.2%) i/s -     28.120k in  20.101831s
  multiple transactions should be fast

Reading data is lighting fast as it's loaded directly from disk and cached.

Loading Data

As Relaxo is unapologetically based on git, you can use git directly with a non-bare working directory to add any files you like. You can even point Relaxo at an existing git repository.

Durability

Relaxo is based on libgit2 and asserts that it is a transactional database. We base this assertion on:

  • All writes into the object store using libgit2 are atomic and synchronized to disk.
  • All updates to refs are atomic and synchronized to disk.

Provided these two invariants are maintained, the operation of Relaxo will be safe, even if there are unexpected interruptions to the program.

The durability guarantees of Relaxo depend on libgit2 calling fsync, and this being respected by the underlying hardware. Otherwise, durability cannot be guaranteed.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Released under the MIT license.

Copyright, 2015, by Samuel G. D. Williams.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].