The goal of this project is to learn about new tools that facilitate scalability, enhance application performance, and improve development speed. The focus, at least to start, is on back-end data stores, and particularly NoSQL solutions.
The approach is to take one or more demo applications, point them at various different back ends, and run load tests against them. The NoSQL database is used as the data store behind the model classes, which should look as much as possible like ActiveRecord classes to the outside world.
We use JMeter for load testing and Rails as the application platform.
The current demo app is a Twitter clone forked from ujihisa's twi1 at https://github.com/ujihisa/twi1. The original app stored tweets in javascript files and only used the database for storing users; the current app has been updated to store tweets in the database as well.
The current demo app doesn't have the "follow" feature.
Starting the application requires indicating which database back-end to use in the "DB" environment variable. The current options are "Mongo" and "Redis" (case insensitive). E.g.:
> DB=MONGO rails s
The environment variable controls which gems will be selected in the Gemfile, and which model classes will be loaded.
Each model class contains a conditional that loads in a file whose extension is determined by the database environment variable (i.e., user.mongo or user.redis).
The Mongo models use the Mongoid gem to mimic ActiveRecord models. The authlogic gem doesn't work with Mongo, so Nifty Generators was used to create authentication code.
The Redis models involve a lot more one-off reimplementation of ActiveRecord methods. These assume a certain naming format for keys in Redis, and various tricks to make a key-value store look like a relational database.
The JMeter test is included in the file "Twitter Clone Test Plan.jmx" in the JMeter directory. This can be opened and run directly from the JMeter GUI.