3 ms·
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 di
by byby 3y ago
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.
- drwiggly 3y agoEvery user/client operation is serial.
- byby 3y agoThis 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.
- T0pH4t 3y agoSort 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.
- byby 3y agoIt 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.