Exploring functional programming and database design
Find a file
Didier Wenzek 9a80327a0a Improve wording
Signed-off-by: Didier Wenzek <didier.wenzek@acidalie.com>
2022-02-28 20:38:58 +00:00
src Improve wording 2022-02-28 20:38:58 +00:00
.gitignore Init mdbook 2022-02-19 13:54:04 +00:00
book.toml Init mdbook 2022-02-19 13:54:04 +00:00
LICENSE Initial commit 2022-02-19 11:57:50 +00:00
README.md Improve wording 2022-02-21 22:14:00 +00:00

Exploring functional programming and database design

The guiding theme of this project is to revisit an established technology — databases — and to explore it through the lens of functional programming languages and type systems.

The idea is hardly new and has already been successfully explored along several dimensions.

  • The most notable contribution has been to apply the concept of list comprehension (now formalized as monad comprehension) to database queries, leading to numerous variants and cumulating with the Microsoft's Language Integrated Query (LINQ) system. LINQ leverages the concept of monad comprehensions as well as the type system to let the developers compose well-behaved queries guided by the types of data at hand.

  • More recently, the term of functional database is used to emphasise that the values manipulated by the database are immutable, in particular the core datasets. Snapshots of the database are accumulated over time, transactions after transactions, using the functional programming legacy of persistent data structures to optimize the space required for all these versions. This approach can be used to improve the performance of the system with simpler synchronisation mechanisms. But the main benefits are from a user perspective. Queries are reproducible, leading to the same result when applied to the same version of the database. Versions can be compared. The history can be queried. Several systems are built on this idea: Irmin, Datomic or NixOs to name a few.

On the strength of these successes, I'm convinced that many pearls are still to be discovered. And I have many promising ideas I would like to share!