3 ms·
One underappreciated part about Redis is that its singlethreaded in-memory approach makes every thing extremely atomic. There is literally no way for simultaneo
by WJW 4y ago
One underappreciated part about Redis is that its singlethreaded in-memory approach makes every thing extremely atomic. There is literally no way for simultaneous operations to conflict if you only ever run one operation at a time.
That said, you indeed need to be very careful around durability since the dataset is kept in memory. Most persistence options are a bit meh compared to "real" databases IMO. Redis is a very fast ACI-compliant datastore if you will.
- jjtheblunt 4y agoCan you create a conflict across a power failure reboot?
- WJW 4y agoI don't think you can create a conflict as in "corrupt the database", but it is definitely possible to lose data depending on how you have set your FSYNC settings in the redis config. The docs mention that a truncated AOF file (such as might happen during a power failure) will not invalidate it but the last command will be lost. The default is to sync to disk every second, so you could lose up to a second of data that your backend did consider to be written. You can also set it to fsync after every write query, but this will be much slower. https://redis.io/docs/manual/persistence/ https://redis.io/docs/manual/persistence/ has all the details.