Gem swift_db introduction

Prasath Ram

50 sec read

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::

LT) => [“Michael Ken”, “John Key”] #Fetches Person whose primary key lesser than 3
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

Related posts:

Is Web Analytics Oversold ?

Web Analytics is a universal term, which deals with the study of the impact of a website based on its users. It is the...
Ashwin Sundarabaskar
1 min read

Book Review: Transform Your Habits

Name: Transform Your Habits Author: James Clear Link: http://jamesclear.com/habits I came across this great book when I was browsing through “TheNextWeb“.
Balaji D Loganathan
1 min read

Book Review: Flex on Rails by Tony & Daniel

Book Name: Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2 (Developer’s Library) Authors: By Tony Hillerson, Daniel Wanja...
Balaji D Loganathan
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *