José P. Airosa
José P. Airosa

Reputation: 368

WHat is the best solution for large caching in Ruby?

I'm building an REST API in Ruby with JRuby+Sinatra running on top of Trinidad web server.

One of the functionalities of the API will be getting very large datasets from a database and storing them in a middle caching/non relational DB layer. This is for performing filter/sorting/actions on top of that dataset without having to rebuild it from the database.

We're looking into a good/the best solution for implementing this middle layer.

My thoughts:

Notes:

Upvotes: 1

Views: 256

Answers (1)

GroovyCakes
GroovyCakes

Reputation: 361

Since you asked for an opinion, I'll give you mine... I think MongoDB would be a good match for your needs:

http://www.mongodb.org/

I've used used it to store large, historical datasets for a couple of years now that just keep getting bigger and bigger, and it remains up to the task. I haven't even needed to delve into "sharding" or some of the advanced features.

The reasons I think it would be appropriate for the application you describe are:

  • It is an indexed, schemaless document store which means it can be very "dynamic" with fields being added or removed
  • I've benchmarked it's performance versus some SQL databases for large "flat" data it performs orders of magnitude better in some cases.
  • https://github.com/guyboertje/jmongo will let you access MongoDB from JRuby

Upvotes: 1

Related Questions