Summary
In this chapter, we performed a massive refactor. We swapped out an entire storage engine and got to grips with Docker. Although there was a lot of moving parts, due to the structure of the code, the refactor was clean, and the interfaces enabled us to make major changes in the data access layer, and then minimal changes throughout the system that reference the data access layer. Furthermore, because we utilized traits, we have made it easier for our us to implement other storage engines and swap them out when needed. On top of this, we embedded the SQL migrations into the Rust binary with the SQLX crate. So, we now have a singular Rust binary that runs migration scripts on the database, serves the frontend JavaScript app, and serves backend API endpoints to the frontend application. We are nearly at a full functioning web application that can be easily deployed. In the next chapter, we will finish up our application by handling user sessions.