This blog explains the fundamentals of the gem that I am working on swift_db
I named this swift coz i need some something which performs faster
Swift DB is a lightweight and clean in-memory Distributed Database written in pure ruby. It can also be used as a new distributed datastructure(B+ Tree) in ruby.Installation:
via Ruby Gem: gem install swift_db
via Github: https://github.com/ask4prasath/swift_db
Features:
- Stores Data in a Inmemory (B+ tree) Datastructure
- Executes Various kinds of queries(Provides variety of range search)
- Supports RegEx Search
- Returns Result using Table.rb Object model.
Examples:
[source language=”ruby”]
require ‘rubygems’
require ‘swift_db’
include Db::Core
person = Table.new(3) #Where 3 is the Node Structure The minimum you give the better the performance but takes some memoryh
person.insert(1, “Michael Ken”)
person.insert(2, “John Key”)
person.insert(3, “stacy”)
#For Searching:
person.search(1) => [“Michael Ken”] #Fetches Person With primary key 1
person.search(3, DB::Core::Common::Comparison::
person.search(2, DB::Core::Common::Comparison::GT) => [“stacy”] #Fetches Person whose primary key greater than 2
person.search(3, DB::Core::Common::Comparison::NEQ) => [“Michael Ken”, “John Key”] #Fetches Person whose primary key not equal to
[/source]
You can find the source code on https://github.com/ask4prasath/swift_db/
and the gem at http://rubygems.org/gems/swift_db