Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Side question about redis:

Does redis do async operations? I'm not sure how that would work because it's known to be in memory. But I do know it persists to disk. So basically my question is:

Does almost absolutely every operation on a redis database happen serially? Maybe not every single operation, but in general.



Sort of. To my knowledge, the original redis was literally signal threaded and performed io on the same threads as managing the DB (asynchronously of coarse). Then after either redis 5 or 6 they added IO threads to redis such that the DB stayed managed by a single thread and network/disk IO happened on the IO threads.


It makes sense for disk persistence to be io but redis is primarily in memory. So I don't think async applies to that aspect of it. In theory that makes it so all operations on the database from the user perspective are serial.

Not sure about this that's why I'm asking here for a definitive concrete answer about this.


Every user/client operation is serial.


This is mainly because it's single threaded and operates on in memory state. Async io doesn't apply to in memory so all operations have to be serial, is this characterization correct? Thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: