Search⌘ K

Planning the Physical Model to Enforce Correctness

Understand how to translate a logical data model into a physical database design that enforces data correctness in Rails applications. Explore planning strategies, the use of migrations, and how database constraints help maintain precise, reliable data especially as your app grows in complexity.

Translating the logical model to the physical model requires making several design decisions, especially as the app becomes more complex and needs to manage more types of data. This should be done in two discrete steps. The first is to plan exactly how we are going to store the data in the database. The next is how to write a Rails migration to implement this plan.

Whereas the logical model was for building alignment and discovering business rules, the physical model is for accurately ...