Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 

README.md

SimplexDB

a simple pure ruby implement in-memory database~ you can use it as a embedded database or as a service. it use append only file to persist data on disk

inspired by The Great Code Club.

features

  • search with index
  • range search
  • store data in append only file
  • embedded in ruby application
  • use as a service with tcp connection (not implement yet)
  • pure ruby implementation

usage

require 'simplexdb'

setting = 
{
  default_index_degree: 10,
  components:
  {
    aof_storage:
    {
      filename: 'aof.txt',
      save_interval: 0
    }
  }
}

database = SimplexDB::Database.create(setting)
table = database.create_table(:my_table)

table.index :my_key

1000.times do |i|
  table.insert my_key: i, value: 'abc'
end

result = table.search(:my_key, 10)
range_result = table.range_search(:my_key, 980, nil)

About

a simple pure ruby implement in-memory database~

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.