In part 1 of this series, we’ll use the Persistent library and Template Haskell to create a simple database schema. This will enable us to run migrations with ease. It will also allow us to write some simple type safe SQL queries!
Once we have our database set up, we’ll want to serve the information we’re storing over a web API. We’ll do this with the Servant library. Servant allows us to build endpoints that retrieve their query parameters in a type-safe way! Find out how in part 2 of the series!
Now that we have our API set up, we’ll see how we can make it faster by adding a Redis cache! We’ll learn how to use the Redis bindings for Haskell so we can avoid using the database for some of our queries! See how it all works in part 3.
Our end-to-end system is now quite complicated, so testing it is difficult for a variety of reasons. In part 4, we’ll see some techinques to test our web API. We’ll also use Docker to make this process easier.
In the final part of our Real World Haskell series, we’ll learn some more about advanced SQL queries. We’ll extend our schema and use the Esqueleto library to perform type safe joins between our different data types!
This series goes over some cool libraries, but there’s still so much more to explore! Check out our Production Checklist and explore a ton of other libraries you can use for various tasks when making a production system in Haskell!
More Stories
A teenager from Co Offaly has been “inundated” with orders for his handmade reindeer decorations after his mother put up a post in a popular Facebook group.
Run Windows apps such as Microsoft Office in Linux (Ubuntu) and GNOME as if they were a part of the native OS, including Nautilus integration. – Fmstrat/winapps
With Australia’s relationship with China at a very dangerous stage, the timing of what is expected to be a ‘more nuanced’ approach from a Biden administration could not be more welcome.