service oriented architecture vs monolithasaurus

88
service oriented architecture

Upload: joe-roberts

Post on 20-Jan-2015

654 views

Category:

Technology


0 download

DESCRIPTION

SOA is an approach to application design that allows us to build robust, scalable software. This is not about scary enterprise systems, this is about building applications with interoperable, lean services that can provide incredible flexibility and freedom. You will learn the pros (and cons) of this approach, and how you can apply it to your own projects. Using common idioms like REST, HTTP and message queues, complex applications can appear simple again. Simplicity leads to better design, increased agility and developer happiness.

TRANSCRIPT

Page 1: Service Oriented Architecture Vs Monolithasaurus

serviceoriented

architecture

Page 2: Service Oriented Architecture Vs Monolithasaurus
Page 3: Service Oriented Architecture Vs Monolithasaurus

serviceoriented

architecture

Page 4: Service Oriented Architecture Vs Monolithasaurus
Page 5: Service Oriented Architecture Vs Monolithasaurus
Page 6: Service Oriented Architecture Vs Monolithasaurus
Page 7: Service Oriented Architecture Vs Monolithasaurus

Working memory

Page 8: Service Oriented Architecture Vs Monolithasaurus
Page 9: Service Oriented Architecture Vs Monolithasaurus
Page 10: Service Oriented Architecture Vs Monolithasaurus
Page 11: Service Oriented Architecture Vs Monolithasaurus
Page 12: Service Oriented Architecture Vs Monolithasaurus
Page 13: Service Oriented Architecture Vs Monolithasaurus
Page 14: Service Oriented Architecture Vs Monolithasaurus

Fight back!- Solid OO techniques- Refactoring- Paying back technical debt- Test driven development- Continuous integration

Page 15: Service Oriented Architecture Vs Monolithasaurus

Easy to change

Page 16: Service Oriented Architecture Vs Monolithasaurus

Service Oriented

Architecture

Page 17: Service Oriented Architecture Vs Monolithasaurus

SOABuild applications

out of smaller ones

Page 18: Service Oriented Architecture Vs Monolithasaurus

Services =

HTTP =

Page 19: Service Oriented Architecture Vs Monolithasaurus

REST+

Message queues

Page 20: Service Oriented Architecture Vs Monolithasaurus

REST

Page 21: Service Oriented Architecture Vs Monolithasaurus

Message queues

SQS, RabbitMQ, ActiveMQ, Resque, etc

Page 22: Service Oriented Architecture Vs Monolithasaurus

OO principles - Single responsibility- Loose coupling- Cohesion- Encapsulation

Page 23: Service Oriented Architecture Vs Monolithasaurus

Real world?There are no rules

Page 24: Service Oriented Architecture Vs Monolithasaurus

auth

users

front-end

blog

socialreviews

recommendations

stock shippingpayments

tagsbaskets

history

Page 25: Service Oriented Architecture Vs Monolithasaurus

Online record shop

Page 26: Service Oriented Architecture Vs Monolithasaurus
Page 27: Service Oriented Architecture Vs Monolithasaurus

Extract functionality

intoservices

Page 28: Service Oriented Architecture Vs Monolithasaurus
Page 29: Service Oriented Architecture Vs Monolithasaurus

Reviews

Recommendations

Product info

Stock levels

Page 30: Service Oriented Architecture Vs Monolithasaurus

reviews-service

REST + JSON

Page 31: Service Oriented Architecture Vs Monolithasaurus

reviews-serviceGET /reviews/idPOST /reviewsPATCH /reviews/idDELETE /reviews/id

Page 32: Service Oriented Architecture Vs Monolithasaurus

reviews-serviceGET /reviews/id

{ json }

Page 33: Service Oriented Architecture Vs Monolithasaurus

reviews-servicePOST /reviews

{ json }

Page 34: Service Oriented Architecture Vs Monolithasaurus

reviews-service

{ json }

BONUS: Client-side rendering!

Page 35: Service Oriented Architecture Vs Monolithasaurus

reviews-serviceapplication/json

text/html

Page 36: Service Oriented Architecture Vs Monolithasaurus

Isolated

Page 37: Service Oriented Architecture Vs Monolithasaurus

Reusable

Page 38: Service Oriented Architecture Vs Monolithasaurus

Interoperable

Page 39: Service Oriented Architecture Vs Monolithasaurus

Agile

Page 40: Service Oriented Architecture Vs Monolithasaurus

Scalable

Page 41: Service Oriented Architecture Vs Monolithasaurus

Robust

Page 42: Service Oriented Architecture Vs Monolithasaurus

Shipping

Page 43: Service Oriented Architecture Vs Monolithasaurus

shipping-service

Page 44: Service Oriented Architecture Vs Monolithasaurus

Shop Shipping-service

Message queue

{ order details }

Page 45: Service Oriented Architecture Vs Monolithasaurus

/api/shippings

Page 46: Service Oriented Architecture Vs Monolithasaurus

IsolatedReusable

InteroperableAgile

ScalableRobust

Page 47: Service Oriented Architecture Vs Monolithasaurus
Page 48: Service Oriented Architecture Vs Monolithasaurus

hydra.ioAPI for building &

profiting from digital image apps

Page 49: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing

hydra.io

Page 50: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing

hydra.io

Page 51: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

hydra.io

Page 52: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

hydra.io

Page 53: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

message queue (resque)

hydra.io

Page 54: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

message queue (resque)

hydra.io

Page 55: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

message queue (resque)

hydra.io

Page 56: Service Oriented Architecture Vs Monolithasaurus

/uploads /products /orders/artworks

imageprocessing MongoDB MongoDB MongoDB

S3

message queue (resque)

hydra.io

Page 57: Service Oriented Architecture Vs Monolithasaurus

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

Page 58: Service Oriented Architecture Vs Monolithasaurus

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)

Page 59: Service Oriented Architecture Vs Monolithasaurus

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)

Page 60: Service Oriented Architecture Vs Monolithasaurus

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)

Page 61: Service Oriented Architecture Vs Monolithasaurus

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)

Page 62: Service Oriented Architecture Vs Monolithasaurus

Small, sharp tools

Page 63: Service Oriented Architecture Vs Monolithasaurus

SOA is Lego

for developers

Page 64: Service Oriented Architecture Vs Monolithasaurus

Change is easyChange is hard

Page 65: Service Oriented Architecture Vs Monolithasaurus

PrefactoringDraw pictures &

simplify

Page 66: Service Oriented Architecture Vs Monolithasaurus

When to extract into services?Mature functionality

Page 67: Service Oriented Architecture Vs Monolithasaurus

EnvironmentsStaging

Page 68: Service Oriented Architecture Vs Monolithasaurus

http://12factor.net/

Deployments

Page 69: Service Oriented Architecture Vs Monolithasaurus

Caching at every layer

Performance

Page 70: Service Oriented Architecture Vs Monolithasaurus

- Test in isolation- Integration tests

Testing

Page 71: Service Oriented Architecture Vs Monolithasaurus

Everything

Automate

Page 72: Service Oriented Architecture Vs Monolithasaurus

Warning!

Polyglot?

Page 73: Service Oriented Architecture Vs Monolithasaurus

Reuse & Consistency

Page 74: Service Oriented Architecture Vs Monolithasaurus

Nooo!

Centralised Database

Page 75: Service Oriented Architecture Vs Monolithasaurus

Keep checking the big picture

Page 76: Service Oriented Architecture Vs Monolithasaurus

/api/v2/gorillas

Versioning

Page 77: Service Oriented Architecture Vs Monolithasaurus

Parallel HTTP requests

Page 78: Service Oriented Architecture Vs Monolithasaurus

Small steps

Page 79: Service Oriented Architecture Vs Monolithasaurus

Conclusions

Page 80: Service Oriented Architecture Vs Monolithasaurus

1. Discipline pays

Page 81: Service Oriented Architecture Vs Monolithasaurus

2. Minimise coupling

Page 82: Service Oriented Architecture Vs Monolithasaurus

3. Small services

Page 83: Service Oriented Architecture Vs Monolithasaurus

4. Reduce complexity

Page 84: Service Oriented Architecture Vs Monolithasaurus

5. Check the big picture

Page 85: Service Oriented Architecture Vs Monolithasaurus

START SMALLSTAY SMALL

Page 86: Service Oriented Architecture Vs Monolithasaurus

The future

Page 87: Service Oriented Architecture Vs Monolithasaurus
Page 88: Service Oriented Architecture Vs Monolithasaurus