Skip to content

dmitrypol/rails_redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rails_redis

demo app for http://redisconference.com/

basic demo Rails app using Redis for caching and background jobs

install ruby and Redis

git pull

bundle

rake db:migrate

rake db:seed

rails s

http://localhost:3000/

To get weather go to http://openweathermap.org/, sing up for API key and put it in application.yml file. App uses Figaro gem

http://localhost:3000/cache and http://localhost:3000/cache/1 - cached controller actions

http://localhost:3000/redis - view stuff in Redis

http://localhost:3000/sidekiq - view your jobs

http://localhost:3000/logs - view logs via logster gem (data is stored in Redis DB 1)

http://localhost:3000/newrelic - newrelic perf metrics on your code

To run the CacheWarmerJob rails r CacheWarmerJob.perform_now

To run the WeatherService rails r "WeatherService.new.perform(94158)"

To run the GithubService rails r "GithubService.new('dhh').perform"

Also look at index.html.erb, show.html.erb, user.rb, user_decorator.rb, user_serializer.rb and cache_controller.rb

Also use Mongo as a DB to aggregate reporting data (in constrast to Redis). If you do not have Mongo installed comment out Mongo code in ArticleDailyViewsJob, Article.rb model and articles/show.html.erb.