Compositional, Expressive, Performant Database Queries: Choose 3
ORMs are slow and frustrating and SQL queries are giant, type-unsafe strings, incapable of modular reuse. Functional programming lets you access your database without sacrificing composition (modularity and reuse), expressivity (complex edge cases), and performance.
Many programmers who need database support either use an Object Relational Mapper or give up and use SQL strings and manually parse result sets. Both approaches have significant drawbacks for the developer and the business, including poor reuse (monolithic, non-reusable query fragments), poor composability, poor type safety, and poor testability.
Discover how functional programming takes the real world challenges of database access, helping programmers to be more productive, and making business applications smaller, faster, easier to maintain, and less buggy.
Outline/Structure of the Talk
In this talk, the author will present Slick, a Functional Relation Mapping library for Scala. Slick allows you to express queries in an embedded, type-checked, collections-like DSL, which is compiled at runtime into SQL and executed on the underlying database.
The author will then show you techniques enabling you to implement database queries in a generic, reusable, self-contained, modular fashion. This enables application-level functionality to be implemented once, efficiently and correctly, using functional programming techniques to provide reuse, compositionality, type safety, and testability, all without sacrificing high performance. Time permitting, we’ll briefly venture into the Category Theory basis underlying the approach.
Attendees will learn a novel approach to interacting with relational databases which allows for creation of simple, testable, reusable logic/semantic snippets which are composable into more complex and correct functionality.
Persons interested in higher order, reusable approaches to DB interactions. Persons who have interest in Category Theory.
Prerequisites for Attendees
Attendees should preferably be comfortable with functional programming and the idea of monads. Familiarity with Scala and Slick will be beneficial, but is not required.