No commit activity in last 3 years
No release in over 3 years
MiyazakiResistance is a library like ActiveRecord to use Tokyo Tyrant.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.8.0
>= 1.2.3
 Project Readme

miyazakiresistance¶ ↑

DESCRIPTION:¶ ↑

MiyazakiResistance is a library like ActiveRecord to use Tokyo Tyrant. MiyazakiResistance support Master/Slave. If Slave server down, it separates automatically. MiyazakiResistance support Dual Master(Active/Standby). If Active server down, Standby server become Active.

SYNOPSIS:¶ ↑

require 'miyazakiresistance'
class Example < MiyazakiResistance::Base
  server :localhost, 1975, :write
  server :slave_host, 1975, :standby
  timeout 1
  column :name, :string
  column :age, :number
  column :birthday, :date
  column :created_at, :datetime
end

work = Example.new
work.name = "tsukasa"
work.age = 34
work.birthday => Date.today
work.save

Example.create(:name => "oishi", :age => 14, :birthday => Date.today)

Example.count
Example.count(:conditions => ["name = ?", "oishi"])

Example.find(1)
Example.find([1,2])
Example.find(:first)
Example.find(:all)
Example.find(:all, :conditions => ["name = ? age = ?", "tsukasa", 34], :order => "created_at DESC", :offset => 1, :limit => 1)
Example.find_by_name("tsukasa")
Example.find_all_by_name_and_age("tsukasa", 34)
Example.first
Example.delete_all(["created_at > ?", Time.local(2009,11,15)])

* You can write in config file

require 'miyazakiresistance'
class Example < MiyazakiResistance::Base
  server_config Rails.env, "log/miyazakiresistance.yml"
  timeout 60
  column :name, :string
  column :age, :integer
  column :birthday, :date
  column :created_at, :datetime
end

'in log/miyazakiresistance.log'
developemnt:
  set_server:
    - server: localhost
      port: 1975

role: write

- server: localhost
  port: 1978

role: readonly

REQUIREMENTS:¶ ↑

Tokyo Tyrant

INSTALL:¶ ↑

  • sudo gem install miyazakiresistance

LICENSE:¶ ↑

Miyazakiresistance is released under the MIT license.