ElixirConf US 2018 – Growing Applications and Taming Complexity – Aaron Renner (@aaronrenner)
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.