As you are going down this path, understand the one truth: machines
crash and disks disappear (especially in EC2 with ephemeral OR EBS
volumes). Have a backup strategy, and remember that it is possible
that you could lose all of the changed data since your last backup. If
your system cannot deal with this kind of data loss, you shouldn't be
using Redis. Redis cluster can somewhat mitigate this (with multiple
slaves per master), but there isn't a lot that can be done if/when an
entire availability zone disappears due to some catastrophic event
(which occurs roughly once every 6-9 months, according to my memory).
In the past, I have used Redis as the only storage for a large
collection of data. Daily at 3AM local time, the system would pause,
dump to disk, backup to S3, then continue. We did this because we
could recover from 24 hours of lost data in about 4-6 hours. We could
also seed the system from the database, and build up 95% of our data
in 3-5 days (the 5% lost would have been nice to have, but wasn't
crucial).
Also, MongoDB is not magic. Claims to the contrary are demonstrably
false. You can tune Postgres or MySQL to perform as well as (if not
better than) MongoDB with the same data reliability. For logging, I'd
actually just recommend syslog-ng + backing up your logs to S3. If you
ever need to do queries against your logs, you can either perform a
mapreduce over them, or just download and process them offline.
Syslog-ng will be able to handle millions of logs per second without
breaking a sweat, where Mongo will be having serious issues with just
a few hundred (unless you configure Mongo in such a way that you don't
care about your data, and your Mongo loggers will be backed up waiting
for Mongo to catch up). Even worse, unless you have indexes (which
slows writes even more), your queries will grind your log insertion to
a halt on Mongo. If you really need multi-machine logging and
arbitrary querying; look at Riak. It's better than Mongo at just about
everything.
Regards,
- Josiah