"Architecture of complex web applications" book

March 15, 2019

I have 15+ years experience with several programming languages(C++, C#, Java, PHP), last 4 years of them with Laravel. My last project was a huge content site with 45 localizations and about 10 millions unique visitors per day. After participating in this project I decided to write this book.

Book describes the evolution of typical web project architecture, when project grows step by step by making changes in architecture, like moving some parts to own layers, improving error handling and maybe rethinking the ways how to store data.

eBook in Leanpub - $11.99

eBook in Amazon - $11.99 - free Kindle sample available

Paperback in Amazon - $19.99

Free pdf sample - intro + 2 chapters

I have worked with a lot of projects which was written by usual "everything in controller" way and when they become to grow their support complexity grows exponentially. Every project had the same illnesses: Copy-paste driven development, God classes, etc. Modern frameworks offers a lot of features to implement functionality super-fast, but when project grows almost all these "optimizations" becomes a big pain for developers. In the same time there a lot of dogmas, like SOLID and others, which described very abstractly and becomes some kind of cargo cults. "if project has 100% code coverage by unit tests, it has super code quality", "if project doesn't have static methods, it's well organized", etc. Someone very clever said: Software Engineering Is Art Of Compromise. Some of these dogmas have very important exceptions. Some of them easy to misunderstand.

In this book I'm going to analyze usual project with common mistakes. How implementing new requirements can decrease code quality. Then step by step I'll show how I usually refactor the code: extracting classes, using DI, using exceptions. How this refactoring consequences moving to layered architecture. After moving to layered architecture we will talk about pro and contras of Command Query Responsibility Segregation(CQRS). After CQRS it's hard to don't talk about Event Sourcing(ES).

I'll use examples in Laravel, but it's not very important. The book is about framework-agnostic code.