Why isn’t RDBMS Partition Tolerant in CAP Theorem and why is it Available?

It is very easy to misunderstand the CAP properties, hence I’m providing some illustrations to make it easier. Consistency: A query Q will produce the same answer A regardless the node that handles the request. In order to guarantee full consistency we need to ensure that all nodes agree on the same value at all … Read more

NoSQL Use Case Scenarios or WHEN to use NoSQL [closed]

It really is an “it depends” kinda question. Some general points: NoSQL is typically good for unstructured/”schemaless” data – usually, you don’t need to explicitly define your schema up front and can just include new fields without any ceremony NoSQL typically favours a denormalised schema due to no support for JOINs per the RDBMS world. … Read more

MongoDB nested array query

After running some queries, I came to the conclusion that $in doesn’t work for an array of arrays. You can use $elemMatch instead and it’ll work, but it is frustrating that MongoDB’s documentation doesn’t warn about it. I created this document: { “_id”: “51cb12857124a215940cf2d4”, “level1”: [ [ “item00”, “item01” ], [ “item10”, “item11” ] ], … Read more

Fast or Bulk Upsert in pymongo

Modern releases of pymongo ( greater than 3.x ) wrap bulk operations in a consistent interface that downgrades where the server release does not support bulk operations. This is now consistent in MongoDB officially supported drivers. So the preferred method for coding is to use bulk_write() instead, where you use an UpdateOne other other appropriate … Read more