today i want to continue my little series about how to use redis as rails cache.
i will show you how to build a caching system that does not rely on cache invalidation and is able to constantly deliver up to date cached results.
more…
today i want to continue my little series about how to use redis as rails cache.
i will show you how to build a caching system that does not rely on cache invalidation and is able to constantly deliver up to date cached results.
more…
if none of the two terms in the title tell you anything, you have some serious reading todo.
first off learn and love coffeescript.
second of all get to know some javascript design patterns. why? because it helps you to write a lot better clearer code in a very weird language.
so my design pattern of choice is revealing module…obviously…as the title already spoiled ;)
how to implement it in coffescript?
in my last article about using redis as rails cache i used the redis ‘keys’ function to invalidate cache.
as my readers noted, and i experienced myself, this is not a good idea if you plan on storing a few million keys in your redis-db.
so today we’ll look at how to do this invalidation thing in a nicer and faster way
postgresql has grown to the most beloved database in the rails community. so as more and more rails developers start using it the more common mistakes get made.
today i want to give some general advice to follow when using postgresql in a rails app.
more…
as redis has become the number one contender for memcaches throne of key-value storage engines. it deserves a closer look why so many rails developers are flocking to it.
redis has a set of commands and functions that enable endless possibilities to those creative enough to use them in a new way.
today i want to show how we use redis to count the picture views in our spray can app.
here at rapidrabbit we deliver many 1,000 requests per second. doing this while only using a handful of servers and ruby on rails we employ very clever caching using redis and nginx.
once the cache is written, it is directly accessed by nginx via a module, which makes it around 500-2,000 times faster than any rails controller.
today i am going to show you how to do it.
i hope i hit all the necessary keywords with the title so you can find this one on google.
because if you, just like me, are switching to rvm on your mac os development environment and installed your postgresql via ports
gem install pg
will fail telling you, that you are missing the right headers.
gem install pg -- --with-opt-include=/opt/local/include/postgresql84/will fix that for you.
--with-opt-lib=/opt/local/lib/postgresql84/
if you who have to work with the apple itunes rss feeds generated here
http://ax.itunes.apple.com/rss
and hate xml parsing just as any one:
just replace the “xml” at the end with “json”
http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/
ws/RSS/topfreeapplications/sf=143441/limit=10/xml
becomes
http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/
ws/RSS/topfreeapplications/sf=143441/limit=10/json
the json files are roughly 1/3 of the size and ridiculously easy to parse.
enjoy.
those of you who run their rails app with paperclip on a standard linux server and ever tried to save more than 32.000 attachments may know the problem.
the saving of new files is shamefully refused with a meaningless error message.
more…