Working with Relational Databases

Relational databases have a very different model from most code, and traditionally this has been the cause of a lot of pain—the so-called “impedance mismatch” between objects and databases.

Data models developed using functional programming principles tend to be more compatible with relational databases, primarily because functional models do not mix data and behavior, so the saving and retrieving of records is more straightforward. Nevertheless, we still need to address some issues. Let’s look at how a relational database model compares to a functional model.

First, the good news is that tables in relational databases correspond nicely to collections of records in the functional model. And the set-oriented ...

Get Domain Modeling Made Functional 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.