SQL vs. NoSQL
A practical comparison based on a developer's long-term experience, contrasting the initial ease of use of MongoDB with the long-term structural benefits of PostgreSQL.
▶ Watch at 0:13
A practical comparison based on a developer's long-term experience, contrasting the initial ease of use of MongoDB with the long-term structural benefits of PostgreSQL.
▶ Watch at 0:13An Object Data Modeling (ODM) library for MongoDB that allows developers to enforce schemas at the application level on top of the schemaless database.
▶ Watch at 0:46The core concept of document-based databases like MongoDB, which offer flexibility by not requiring a predefined data structure.
The challenge of maintaining a consistent and predictable data structure in a flexible environment over time, especially as a project is handed off between developers.
How developer perceptions of "old" versus "new" technologies can influence architectural decisions, sometimes overlooking the proven benefits of established tools like SQL.
“I thought it was this ancient thing that wasn't a good idea to use anymore.”
“So the entire idea behind Mongo being schemaless and document-based, I wasn't using it at all for anything.”
“Why haven't I given this a shot before?”
The speaker once dismissed SQL as an ancient technology that was not a good idea to use anymore, choosing the newer MongoDB instead. In this episode, which came out on April 27, 2022, a software developer shares his early programming journey. By the end, you will learn how to choose between initial setup speed and long term database structure.
Why initial ease of use can lose to long term structure. A developer's long term experience contrasts the easy start of MongoDB, a NoSQL database, with the lasting structural benefits of PostgreSQL, a SQL database. Around 2016, the growing popularity of Postgres and its direct power for creating structured tables led the speaker to switch and become a strong advocate.
How an add on tool can defeat your database's purpose. The speaker had an aha moment while using Mongoose, an Object Data Modeling library that enforces rules called schemas at the application level. He realized that by building schemas on top of a schemaless database, he was nullifying its core benefit. If you find yourself enforcing rigid schemas on a schemaless database, consider whether a relational database like Postgres is a more appropriate choice from the start.
The hidden trap of total flexibility. Document based databases like MongoDB offer flexibility because they are schemaless, meaning they do not require a predefined data structure. Yet because the speaker was adding schemas anyway, he was not using that document based, schemaless design for anything at all.
What happens when a flexible project changes hands. Maintaining a consistent and predictable data structure in a flexible environment is a challenge over time. The speaker built a system on MongoDB that lost its structural integrity after being handed off to a new team. Prioritize long term maintainability over initial setup speed so future teams can understand and build upon your database without data chaos.
Why newer is not always better in software. Developer perceptions of old versus new tools can influence architectural decisions and overlook the proven benefits of established tools like SQL. After finally exploring PostgreSQL, the speaker wondered why he had not given it a shot before.
Be mindful of defeating the purpose of your tools. Reevaluate established technologies like SQL periodically, because they have remained relevant for decades by solving a fundamental set of problems effectively and reliably.
Changelog
Changelog
Changelog
Changelog
Changelog
Changelog
Changelog
Wookash Podcast
The Data Engineering Show - Podcast
Wookash Podcast
The Data Engineering Show - Podcast
The Data Engineering Show - Podcast
Syntax
The Data Engineering Show - Podcast
The Data Engineering Show - Podcast