Date post: | 16-Jul-2015 |
Category: |
Technology |
Upload: | david-simons |
View: | 1,886 times |
Download: | 0 times |
W H O A M I ?
• David Simons (@SwamWithTurtles)
• Technical Lead for Softwire
• Hacker specialising in Node and Java
M Y E X P E R I E N C E W I T H A P I S
• Focused on web development
• Utilise data from our own, or third party APIs to affect rendered data
W H AT I W A N T T O TA L K A B O U T…
• What problems do microservices solve?
• What is a microservice?
• How can I start implementing microservices?
W H AT M A K E S A G O O D A P I ?
HATEOS-y
Sensibly named
Ignorant of ConsumersWell Maintained
Tested
Appropriate
Extensible
Hard to Misuse
Secure Useful
High Quality Data
RESTful
Easy to Adopt
Resilient
Performant
Versioned Declarative
Flexible output formats
Stable
Well Documented
A M I C R O S E R V I C E A R C H I T E C T U R E M A K E S
Y O U R A P I S M O R E :
D E C O U P L E D , R E U S A B L E A N D S C A L A B L E
M Y C L A I M …
M I C R O S E R V I C E S A R E N O T L AY E R E D A R C H I T E C T U R E S
B AT C H D ATA P R O C E S S
D ATA A C C E S S L AY E R
P R E S E N TAT I O N T I E R
M E S S A G E Q U E U E
B U S I N E S S C O N C E R N S
B AT C H D ATA P R O C E S S
D ATA A C C E S S L AY E R
P R E S E N TAT I O N T I E R
TaxPricing
B U S I N E S S C O N C E R N S
B AT C H D ATA P R O C E S S
D ATA A C C E S S L AY E R
P R E S E N TAT I O N T I E R
TaxPricing
B U S I N E S S C O N C E R N S
B AT C H D ATA P R O C E S S
D ATA A C C E S S L AY E R
P R E S E N TAT I O N T I E R
Tax v2Pricing
D E C O U P L E D
• Implementation can’t be leaked due to separate deployments
• All the intelligence is in the system
R E U S A B L E
• Services contain “just enough” information to be useful in multiple places
• No danger of long strands of dependencies
S C A L A B L E
• Separate systems can each be deployed independently of the other
• Smaller systems have less requirements in terms of hardware
T H E B A D B I T S …
• Increased latency through message passing
• Added work and complexity
• Issues are less discoverable
• Increased licensing costs on some stacks
T H E B A D B I T S …
• Similar issues exist with any “encapsulation” methodology:
• OOP
• Web Components
C R E AT I O N
• Do it yourself!
• Lightweight languages such as NodeJS make API creation easy
• App creation frameworks like Spring Boot (Java) and Yeomen (JS)
M E S S A G E PA S S I N G
• “Smart Endpoints, Dumb Pipes” - Martin Fowler
• All the standard ways of consuming APIs - e.g. HTTP, Message Queues
D E P L O Y M E N T
• Automate it as much as possible
• Old favourites: Continuous Integration/Source Control
• Puppet/Chef for config management
• Docker can automate microservice containers
T O C O N C L U D E …
• APIs work best when they allow separate parts of your system to behave independently
• Using microservices can enforce this pattern
• The Ecosystem is big - and growing!