Introduction to Schemas Without Tables

Learn how to use schemas without database tables.

Some database libraries automatically map database tables to the data structures we use in our application code.

Ecto is not one of them.

Instead, we create our schema structs manually by specifying each of the fields and their types.

At first glance, this can feel like unnecessary work that the framework could be doing for us—but it’s actually doing us a service. It allows us to consider the data structures we use in code separately from how that data is stored. This means that we can design our code to be as flexible and expressive as possible without having to adhere to the rules imposed by relational databases.

Get hands-on with 1400+ tech skills courses.