Closing

As with application development, database design is part science and part art. It may seem quite complex, with keys to set up, different relationships to define, Normal Forms to follow, and indexes to create.

Thankfully, the basics usually fall into place fairly quickly. If you start to get into larger or more complex designs, some reading on more formal methods of data modeling and database design might be in order, but most developers can get pretty far by just leveraging their knowledge and experience in designing application data structures. In the end, you’re just defining data structures and hooking them together.

Finally, don’t expect to get it right the first time. Very often, when going through the database design process, you realize that your understanding of the thing you’re trying to store is incorrect or incomplete. Just as you might refactor a class hierarchy, don’t be afraid to refactor a database design. It should be an evolving thing, just like your application code and data structures.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.