Kousik Nath
1 min readFeb 21, 2020

--

Thanks for reading this article. Yes both Redis and RDBMS support transactions in their own way. What I meant is redis hash can be used to replace RDBMS tables. Typically relational tables are used when you have very strict schema or you want to perform some transactions on table entries which probably requires some joining with other tables as well. If you relax those constraint or you want to have the join done at the application level at the cost of very fast memory lookup, redis hash can be used. Redis also can perform transactions using MULTI, EXEC commands— that’s like executing a group of commands together and there is no concept of join or anything like that in Redis. Commands are qued and evaluated together at the runtime, if there is any syntax mistake, transaction does not even happen. If you use optimistic locking in redis, you can use WATCH command and if any watched variable get changed by another command outside of your transaction, the transaction does not happen. So redis transaction is a simple grouping of commands whereas RDBMS transactions can get very complex with commands involving join and lot of table constraints etc. If you don’t want to use database joining or don’t want to put lot of transactions in the database layer, can handle little bit inconsistency in data, probably fine with denotmalized data, can operationally handle any issue related to NoSQL databases, go for NoSQL.

--

--

Kousik Nath

Deep discussions on problem solving, distributed systems, computing concepts, real life systems designing. Developer @Uber. https://in.linkedin.com/in/kousikn