Growing an application is hard. We started our app with the best of intentions and promised ourselves we were going to “design it right". However as the app grew, complexity increased, dependencies piled up, and changes that were once small now felt like slogging through mud.
Driven by the need to keep our sanity, we decided to apply ideas from Phoenix’s contexts and Domain Driven Design with the hope that we could put boundaries around the complex parts of our system and keep the code from turning into a tangled rat’s nest. This talk covers many of the lessons we learned along the way, including:
- How to start tackling complexity by teasing apart the app into multiple layers.
- How to simplify testing and reduce mental burden by defining contracts between these layers.
- How to verify contracts using tools like dialyzer, automated tests and mocks.
- How to document these contracts and use them to guide the application design.
After applying these ideas to our codebase for almost a year, we’re eager to share our experiences and provide strategies you can use to tame complexity in your own applications.
Aaron has been developing software professionally for 10+ years and has been writing Elixir full time since 2016. He has been the technical co-founder for multiple startups and can only imagine the money he would have saved on servers if he had found Elixir sooner. Aaron enjoys clean code, refactoring and studying application design. When he’s not in front of the computer, Aaron enjoys cycling, camping and family road trips.