Quiz

  1. Is sharding the only major advantage of NoSQL databases?

    No, I don't think so, but it is a very important one.

    Other advantages include: having embedded documents, which avoids joins (which have a computational cost) and denormalization (includinging extra data in a document, though relational databases can do this too).

    Both of those, paradoxically, bloat the amount of data and increase the likelihood of sharding.

    There's also the redesign of the MQL, to make injection attacks much more difficult.

  2. Why would an organization choose a SQL database with no sharding vs a NoSQL database with sharding?

    Size of the data, convenience of deployment or purchase, existing code base, existing skill sets.

    For example, Workday almost certainly has a relational database under the covers.

    The ACID properties, which we'll talk about later, are well implemented in SQL databases.

  3. How common is it for companies to use both types of databases?

    According to the MongoDB people, who have every reason to emphasize the importance of NoSQL, it's extremely common. Again, think of software like SalesForce and WorkDay.

  4. How big should a database be in order to justify sharding?/When should we use sharding vs. not?

    It depends. Geographical reasons might be enough reason to shard, even if the data easily fits in one server.

  5. What would sharding (each of the four types) look like in code?

    It mostly doesn't. But it might affect how we code. I asked ChatGPT and it gave a really interesting answer.