Hyperion is a lightning fast Ruby object model backed with Redis. It was created in 48 hours to back Leatherbound.me, a ebook comparison shopping tool that was built for Rails Rumble. We withstood 15,000 uniques on Monday morning, and Hyperion stayed super quick even with tons of concurrent queries on a small Linode.
-
CRUD on Ruby classes, any attributes get stuffed into a Redis key.
-
Indexing of objects on any attributes or collections of attributes.
adrian$ gem install hyperion require ‘hyperion’ class Person < Hyperion # First we set up the attributes on this object. attr_accessor :name, :email, :password, :other_amazing_info, :car_color, :state # Let’s use the email as our primary key. # Another option would be to not define our own, in which case :id will be created & used. hyperion_key :email # Lets add some indexes! # We can search for all Persons with a given name. hyperion_index :name # We can also search for all people with a given car color and state. hyperion_index [:car_color, :state] end
p1 = Person.new({:name => ‘Adrian Pike’, :email => ‘adrian@pikeapps.com’, …}) p1.save Person.find(‘adrian@pikeapps.com’) #=> #<Person @name=“Adrian Pike”, @email=“adrian@pikeapps.com”> Person.find(:name => ‘Adrian Pike’) #=> [#<Person @name=“Adrian Pike”, @email=“adrian@pikeapps.com”>] Person.find(:car_color => ‘purple’, :state => ‘denial’) #=> [#<Person @name=“Adrian Pike”, @email=“adrian@pikeapps.com”>]
-
Ruby 1.9
-
activesupport
-
Redis
-
Change the indexes to use ZSETs.
-
Delete. (ha!)
-
Schema versioning and migrations.
-
Faster faster faster! Let’s utilize more of Redis’ exposed data structures to make it better.
-
Clever auto-sharding based on primary keyspace
-
Figure out a way to auto-balance shards
-
-
Slow full-table searches.
-
Partial index searches
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 Adrian Pike. See LICENSE for details.