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.

Written by

Deep discussions on problem solving, distributed systems, computing concepts, real life systems designing. Developer @PayPal.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store