Service Oriented Architecture Vs Monolithasaurus
-
Upload
joe-roberts -
Category
Technology
-
view
654 -
download
0
description
Transcript of Service Oriented Architecture Vs Monolithasaurus
serviceoriented
architecture
serviceoriented
architecture
Working memory
Fight back!- Solid OO techniques- Refactoring- Paying back technical debt- Test driven development- Continuous integration
Easy to change
Service Oriented
Architecture
SOABuild applications
out of smaller ones
Services =
HTTP =
REST+
Message queues
REST
Message queues
SQS, RabbitMQ, ActiveMQ, Resque, etc
OO principles - Single responsibility- Loose coupling- Cohesion- Encapsulation
Real world?There are no rules
auth
users
front-end
blog
socialreviews
recommendations
stock shippingpayments
tagsbaskets
history
Online record shop
Extract functionality
intoservices
Reviews
Recommendations
Product info
Stock levels
reviews-service
REST + JSON
reviews-serviceGET /reviews/idPOST /reviewsPATCH /reviews/idDELETE /reviews/id
reviews-serviceGET /reviews/id
{ json }
reviews-servicePOST /reviews
{ json }
reviews-service
{ json }
BONUS: Client-side rendering!
reviews-serviceapplication/json
text/html
Isolated
Reusable
Interoperable
Agile
Scalable
Robust
Shipping
shipping-service
Shop Shipping-service
Message queue
{ order details }
/api/shippings
IsolatedReusable
InteroperableAgile
ScalableRobust
hydra.ioAPI for building &
profiting from digital image apps
/uploads /products /orders/artworks
imageprocessing
hydra.io
/uploads /products /orders/artworks
imageprocessing
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
hydra.io
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
hydra.io
api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
hydra.io
api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
admin tools
api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
admin tools
api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
admin tools
backbone.js
hydra gem
api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)api.hydra.io proxy (HAProxy)
/uploads /products /orders/artworks
imageprocessing MongoDB MongoDB MongoDB
S3
message queue (resque)
Small, sharp tools
SOA is Lego
for developers
Change is easyChange is hard
PrefactoringDraw pictures &
simplify
When to extract into services?Mature functionality
EnvironmentsStaging
Caching at every layer
Performance
- Test in isolation- Integration tests
Testing
Everything
Automate
Warning!
Polyglot?
Reuse & Consistency
Nooo!
Centralised Database
Keep checking the big picture
/api/v2/gorillas
Versioning
Parallel HTTP requests
Small steps
Conclusions
1. Discipline pays
2. Minimise coupling
3. Small services
4. Reduce complexity
5. Check the big picture
START SMALLSTAY SMALL
The future