shortcuts:
TOC
NanoTwitter
search:
Monolith or Not?
slides
|
Monolith vs. Microservices
Opposite of Microservices
Monolith:
No “internal” services
A single code base (repo)
Actually it’s a spectrum
Actually even a monolith is three tier
Monoliths are not
bad
and Microservices are not
good
Pros and Cons
Monolith
Fewer API/Interfaces to design, test and deploy
One codebase is more efficient
Devops is far simpler
No extra network communications overhead
But: Overly-tight coupling
But: A bigger, single architecture is harder to understand
Microservices
Forces more modularity and better organization
Allows service reuse, and additional scaling options
Really isolated testing is possible
But: Extra work for cross cutting concerns (e.g. logging, authentication, monitoring etc.)
But: Far more complicated operations and devops
Microservices
This article lays out an approach to
Break a monolith into Microservices
STEP 1
: Start thinking about building Devops
Environment variables
Services mapped to hosts
Automation
STEP 2
: First attack simple self-contained functionality
Either needs no database or has a table that no other part of the system uses
It should be easy to isolate with interface of a single class or a few methods
Preferably “functional”, think amazon Lambda etc
Next create a think sinatra (or other) layer to accept requests as urls and paths and return results as http results.
Demonstrate that it works by running automated deployment, installation, configuration, and service start, stop and restart operations
STEP 3
: Next decouple a service which doesn’t share data
Again a service that needs no database or has a table that it fully controls
The goal again is to make the interface in the form of a class and/or a set of methods
Might need <%= link_to_topic :refactoring %> in order to remove or reduce dependencies
Then, continue as above
Intro
Cosi105 - Scalability 2022 Syllabus
List of lectures
nanoTwitter
Homeworks
Lectures
Web Apps + Sinatra
Welcome
What is Scalability?
Cosi166 Quick Bullets
Intro to Sinatra
Sinatra and Twitter
NanoTwitter introduced
nano Twitter
Starting to think about scaling
Scaling at Hubspot
Service Oriented Architecture
Deploying to the Cloud
Scalable Service design
Scalability, continued
Testing in the world of SOA
Scaling Patterns
Testing Scalability
Tuning for Scale
Logging
Caching
Database Tuning 1
Database Tuning 2
Concurrency 1
Concurrency 2
Queueing
SOA + µservices
Software Engineering
Scalability Runoff 1
Last class!
Background
Technical Presentations
Misc Links and Resources