Beware the monolith
-
Upload
dee-wilcox -
Category
Software
-
view
492 -
download
0
Transcript of Beware the monolith
![Page 1: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/1.jpg)
Beware theMonolith
Presentation by Dee WilcoxNashville PHP - March 8, 2016
![Page 2: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/2.jpg)
Developing for ScaleIn enterprise-level development projects, or projects where the application is the business, it is easy to find ourselves unintentionally scaling up to a monolith. This month we’ll spend some time learning together how we can build stable enterprise applications that scale, while moving away from this architectural design pattern.
![Page 3: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/3.jpg)
Speak up! Take the survey.(With a little help from your smart phone)
http://goo.gl/forms/o3qJZ1Krpw
Are you working on a monolith or distributed system?
Which do you prefer?
![Page 5: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/5.jpg)
1. What is a Monolith?How do you know if you are working on one?
➔ Single-TieredThe user interface and data access code are combined into a single program from a single platform. Very few layers of abstraction.
➔ Self-ContainedIndependent from other systems and applications.
➔ Deeply IntegratedModels are collapsed for simplicity.
![Page 6: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/6.jpg)
It’s an integrated system that collapses as many unnecessary conceptual models as possible. Eliminates as much needless abstraction as you can swing a hammer at. IT’S A BIG FAT NO TO DISTRIBUTING YOUR SYSTEM lest it truly prevents you from doing what really needs to be done.
Source
From Majestic Monolith by David Heinemeier Hansson on SignalVsNoise
![Page 7: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/7.jpg)
2. Benefits of a Monolith
➔ One codebase to maintain
➔ Application logic is tightly coupled to the data model and user interface
➔ Everything is in one place
![Page 8: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/8.jpg)
Monoliths aren’t all bad. In fact, they are widely used even in modern tech companies. But when polled, most Nashville-based developers preferred a distributed architecture. We can debate which way is right, but it reallydepends on the application and the environment.
![Page 9: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/9.jpg)
Meet Etsy.
Either Etsy is a monolith or it is a shining example of what service-oriented architecture looks like
and/or microservices, depending on who you ask...
There are other languages at play at Etsy, but as far as the guts of the API and the web application, it is largely
PHP. There’s a huge advantage in that, a massive advantage.
Source
Microservices, monoliths and laser nail guns: Etsy tech boss on finding the right focus
![Page 10: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/10.jpg)
Meet Bootcamp.
One of the benefits to the majestic monolith is that it
basically presumes that the people who work on it
also understand it.
Source
The Majestic Monolith
![Page 11: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/11.jpg)
Monoliths work best on small teams dedicated to one application. Even in the best case
scenario, documentation, documentation! Silos of knowledge are dangerous without documentation..
![Page 12: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/12.jpg)
Now for some data. (Thanks to everyone for participating!)
This survey was limited to the
NashDev Slack team and the
Nashville PHP meetup group.
http://goo.gl/forms/o3qJZ1Krpw
![Page 13: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/13.jpg)
Meet Netflix.
“Give the developers the pain, and they'll automate everything out of the way.”
Source
https://www.battery.com/our-team/member/adrian-cockcroft/
![Page 14: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/14.jpg)
Defeat the monolith by going small. Tiny, even.Microservices are small applications that represent one piece of business logic, or one function within the application. When designed as an API, the application becomes a front end client consuming various API endpoints.
Pro Tip
Microservices can be broken down into larger chunks, but generally, the smaller, the better. This makes them easier to maintain and helps keep the system decoupled.
![Page 15: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/15.jpg)
3. Benefits of Microservices➔ Application logic, user interface,
and data models are de-coupled.
➔ Easier to maintain and deploy.
➔ Easier to teach to new team members.
➔ Increases application stability.
➔ Ability to fail gracefully.
![Page 16: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/16.jpg)
Strong application architecture is a simple as clear lines and simple patterns.
![Page 17: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/17.jpg)
Consider the simple marble run.
COMPLEX PATTERNS COMBINED WITH MILLIONS OF DESIGN CHOICES SLOW DOWN THE SYSTEM AND MAKE IT DIFFICULT TO UNDERSTAND.
Source: thisiscolossal.com
![Page 18: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/18.jpg)
Some of our monolithic applications end up looking like this.
![Page 19: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/19.jpg)
But perhaps they should look more like this.
![Page 20: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/20.jpg)
Building API Centric Applications
An API Centric web application executes most, if not all, of its functionality through API calls. The application is separated into the front end client and the codebase(s) for the API(s) it consumes. A formerly monolithic app will likely consume many microservices.
![Page 21: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/21.jpg)
4. Best Practices➔ Design your application so that it
is consuming APIs from your microservices.
➔ Break each business task out intoa microservice with an exposed API.
➔ Require authentication with your services. It goes without saying, but
this is an crucial for security.
➔ Use AWS to distribute and load balance your services. We have
seen huge performance gains simply by moving our infrastructure to AWS.
![Page 22: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/22.jpg)
tl;dr
Microservices, Monoliths, and Laser Nail Guns
Adopting Microservices at Netflix: Lessons for Team and Process Design
Microservices: A Definition of This New Architectural Term
![Page 23: Beware the monolith](https://reader034.fdocuments.in/reader034/viewer/2022051318/58ef1d421a28abf2668b468f/html5/thumbnails/23.jpg)
Stay in Touch t/s/l @dee_wilcoxe/ [email protected]