Schema Design Process
On this page
The schema design process helps you prepare an effective schema for your application. Following the schema design process helps you identify what data your application needs and how to best organize your data to optimize performance.
Use Cases
Planning and designing your schema is best done early in your application development process. Starting your application with good data modeling practices helps prevent schema and performance issues as your application grows. When you follow schema design practices early and appropriately, you can achieve better performance and make it easier to scale your application in the future.
You can design your schema iteratively and modify your schema as the needs of your application change. MongoDB provides ways to seamlessly modify your schema without downtime. However, it can still be difficult to modify large-scale schemas that are used in production.
When you design your schema, you may need to strike a balance between performance and simplicity. Sometimes, the most performant schema takes many iterations and a great deal of testing to achieve. Depending on your application and the importance of optimization, you may want to establish a simple schema to cover basic functionality, before spending time on optimizations.
Tasks
The schema design process consists of the following steps:
Identify your workload
Identify the operations that your application runs most frequently. See Identify Application Workload.
Map relationships
Identify the relationships in your application's data and decide whether to link or embed related data. See Map Schema Relationships.
Apply design patterns
Apply schema design patterns to optimize reads and writes. See Apply Design Patterns.
Create indexes
Create indexes to support common query patterns. See Create Indexes to Support Your Queries.