Live data from Hacker News

Redis: new disk storage to replace VM

groups.google.com

21–24 of 24 posts

Re: Redis: new disk storage to replace VM

#21
post #7

Earlier quoted context omitted.

On MySQL / InnoDB, this is innodb_flush_log_at_trx_commit and how the buffer log is flushed can have a tremendous impact on the latency of writes.

So, no physical disk write need occur before a client can continue with processing? If so, cool.

http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.htm...

``If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit.''

Re: Redis: new disk storage to replace VM

#22

I am curious as to what people who use Redis in production think of these types of changes. Is this alarming or hopeful? Seems like a rather large shift in trade-offs and a whole new set of tuning parameters to play with.

This changes only affect a small percentage of users that need to run single Redis instances with datasets that are larger than the computer memory.

Our default back end is to run as an in memory DB, and most of the design and goals are related to this mode. But I think that most of the value of Redis is its data model, and I bet it will survive Redis itself, so the idea is, let's look to alternatives that make this data model working well with data sets bigger than RAM.

Our old solution was VM, but we found it is not ideal, does not work well with the Redis in-memory back end persistence ideas (that are instead working well without VM). What to do then? Keep trying with the wrong solution? :) I guess not, open source also means that if the cure for a disease is not good enough we put things into the trash and try again and again, as the sole goal should be the progress of the technology we are trying to put in the hand of users.

So we have a new model now, and will test how it works in practice. What we said is: for write heavy applications where performances matter, use Redis as an in-memory DB. It works well, it's well tested, and we can count many happy users.

But if the Redis data model solves your problems, and you have a read-heavy application with tons of data, we are going to provide an alternative that could work well.

Re: Redis: new disk storage to replace VM

#23
post #14

Earlier quoted context omitted.

Actually, that is talking about the existing virtual-memory (VM) implementation, which swaps data in and out to disk, and doesn't work so great. The change being talked about here is all about replacing that exact flakey VM with a more solid disk backed approach

I'm sorry, but that's what I meant. I'd be more alarmed than enticed to discover that the current implementation of datasets-larger-than-RAM for my chosen database was considered "flakey", and was going to be swapped out for a green-field approach in the next release. For reference, this is the blog post that introduced the VM idea: http://antirez.com/post/redis-virtual-memory-story.html

> I'm sorry, but that's what I meant. I'd be more alarmed than enticed to discover that the current implementation of datasets-larger-than-RAM for my chosen database was considered "flakey", and was going to be swapped out for a green-field approach in the next release.

As Redis is mainly an in-memory DB, currently larger datasets than RAM were not our first goal, and there was even the idea to drop support at all for this use case. I think that what matters for most users is that the default mode of operations is working great, and that for an alternative mode of operations developers are not dogmatic and don't fear to drop what is not optimal to replace it with something better. In many other contexts this would be regarded as bad marketing and not done at all, but I try to follow a scientific way to make progresses, and I tend to accept that I and the other developers are not perfect and need to make mistakes and improve the design again and again ;)

I like Redis data model and I think this is our biggest value, and we need to find different underlaying implementations for different use cases, and keep trying to provide more speed, better durability, better replication, and so forth, ad libitum.

Re: Redis: new disk storage to replace VM

#24

Earlier quoted context omitted.

"in the event of a crash the data is recovered from the transaction log" Doesn't this statement imply that a disk hit occurred before a client is told that a transaction committed (vs. being told that a unique key constraint was violated, etc.)? I'm talking about a more extreme form where I don't have to wait multiple milliseconds for a disk platter to spin around before continuing with my processing.

For full durability, you configure/ask the DB to fsync the transaction log before reporting the transaction committed to the client. Most people can tolerate a few seconds of data loss, so a sensible config will only fsync every few seconds and will report a transaction committed before it hits the disk. If the DB crashes, you lose those recent transactions in this mode. All (?) relational databases let you choose wh…

Also note that you can get the best of both worlds with a battery backed RAM cache contained in a SAN storage backend, such that the storage subsystem can be extremely low latency and yet "guarantee" that what it has accepted will get persisted to a disk for durability. (Predictably, this isn't cheap, but it's very effective.)

Your DB host tells the SAN to write this block, the SAN ingests the write to local RAM and reports "got it" to the DB server in sub-millisecond. The SAN will then dump that data to actual underlying discs over the next (hand-wavy) short timeframe, but from the DB's perspective, it got a durable fsync in under a millisecond.

Post reply on HN