"Northwind Elixir Traders" is now completed!

“Northwind Elixir Traders” is now completed!

14 March, 2025 3 min read
software, programming, Elixir, learning, Ecto, databases, book

Since the last update:

  • Chapter 16 was written from scratch. We now have complex (complicated) queries that use Common Table Expressions and ROWS in a window fragment to perform window-aggregate calculations for rolling and running (sliding and expanding) windows across sequential and unique dates of dataset with triple partitioning–even for those dates that have no orders. There is also a lot of exploration of SQLite’s troubles with complex queries of that kind, as well as a section on profiling database queries with SQLite’s EXPLAIN QUERY PLAN (and with Erlang’s timer module) to determine what’s causing them to run slow.
  • Chapter 17 (“Leftover bits and pieces”) was dropped, since it seemed too “poor”, especially for a closing chapter. After reviewing the book in its entirety, I concluded that everything that was supposed to be in there was either truly trivial (Ecto.Enum, redacting fields, and one-to-one associations) compared to what the book has covered in almost 500 pages, or was always truly beyond the scope of the book (switching to PostgreSQL, which shouldn’t pose an issue given how everything has been implemented).
  • With a handful of exceptions, now all Elixir, Ecto and SQLite functions have been hyperlinked to their online documentation. I considered hyperlinking the book contents to the git commits, but after trying it out I found that it made already-busy book pages even busier, hindering readability.

With this, the book is now 100% complete!

For those of who have have been asking me for the complete codebase, it’s now available and Apache-2.0 licensed on GitHub: waseigo/northwind_elixir_traders: The official repository of the “Northwind Elixir Traders” book . Every code block and every instruction to change something to the code corresponds to a git commit. The commit title is the title of the corresponding code block, or a snippet of the text with the instruction on what to change/remove.

The entirety of the book has now been “replayed”–that’s how the git repo has been built from scratch by following the book step by step.

The next step in the story of this book is the upcoming episode of the Elixir Mentor podcast with Jacob Luetzow . We’ll record it on March 21st.

The next step for me, Elixir, and writing technical books is the upcoming and much shorter Elixir Chatbot Alchemy , in which we will follow a similar exploratory approach to develop a self-hosted chatbot with Elixir, the Ollama REST API, Ecto, and Phoenix LiveView under the severe constraint of getting a decent chatbot working with only CPU-based inference.