From the course: Data Modeling in MongoDB

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Schema versioning

Schema versioning

- [Instructor] With this lesson, we'll start getting into some of the tactics surrounding building out your schemas and data models. We'll get started here with the concept of schema versioning. Versioning is simple. Just add a version number to your schemas. It's that easy. But how do we do this? And why is this an important thing for us to consider doing? Let's take a simple example where we're modeling a database for an online retailer. We've got this beautiful data model and code, and production that fetches and uses this, and everything is great. But then, a new requirement comes in. Well, one way to solve for this, having a second shipping address, is simply to add another set of properties to the document model, right? MongoDB is flexible for a reason, isn't it? Doing this in a SQL database, by the way would require all sorts of migrations and change orders. Mongo DB allows for data to be different from…

Contents