Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
M I C R O S E R V I C E S
D E C O U P L I N G A P I S T H R O U G H
M I C R O S E R V I C E S
D E C O U P L I N G A P I S T H R O U G H
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 a...
W H AT I WA 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
...
W H AT P R O B L E M S D O
M I C R O S E R V I C E S S O LV E ?
Q U E S T I O N 1 :
W H AT D O W E
A S P I R E F O R I N
A G O O D A P I ?
W H AT M A K E S A G O O D A P I ?
HATEOS-y
Sensibly named
Ignorant of Consumers
Well Maintained
Tested
Appropriate
Extens...
D E C O U P L E D
A G O O D A P I I S …
R E U S A B L E
A G O O D A P I I S …
S C A L A B L E
A G O O D A P I I S …
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
...
W H AT I S A
M I C R O S E R V I C E ?
Q U E S T I O N 2 :
Independently deployable services
focused around business concerns,
which contain all your logic.
F O C U S E D
A R O U N D
B U S I N E S S
C O N C E R N S
M I C R O S E R V I C E S A R E …
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 ...
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
TaxP...
I N D E P E N D E N T LY
D E P L O YA B L E
M I C R O S E R V I C E S A R 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
TaxP...
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 ...
T H E
F R A C T U R E D
M O N O L I T H
B E WA R E …
C O N TA I N I N G
A L L Y O U R
L O G I C
A M I C R O S E R V I C E H A S …
- M A R T I N F O W L E R
“Smart Endpoints, Dumb Pipes”
S M A R T P I P E S
H O W D O E S T H I S M AT C H
O U R “ I D E A L A P I ” ?
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
o...
S C A L A B L E
• Separate systems can each
be deployed
independently of the other
• Smaller systems have less
requirement...
M I C R O S E R V I C E S A R E N O T
R I G H T F O R E V E RY O N E
WA R N I N G
T H E B A D
B I T S …
• Increased latency through
message passing
• Added work and
complexity
• Issues are less
discoverab...
T H E B A D
B I T S …
• Similar issues exist with
any “encapsulation”
methodology:
• OOP
• Web Components
H O W C A N I S TA R T T O
I M P L E M E N T T H E M ?
Q U E S T I O N 3 :
T H E R E ’ S T O O M U C H T O
TA L K A B O U T I N O N E TA L K .
WA R N I N G
C R E AT I O N
S T E P # 1 :
C R E AT I O N
• Do it yourself!
• Lightweight languages
such as NodeJS make
API creation easy
• App creation
frameworks l...
C R E AT I O N
• DropWizard
P O P U L AT I O N
S T E P # 2 :
J U S T C O D E I T !
P O P U L A T I O N
M E S S A G E
PA S S I N G
S T E P # 3 :
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...
D E P L O Y M E N T
S T E P # 4 :
D E P L O Y M E N T
• Five years ago:
• Work hard
D E P L O Y M E N T
• Automate it as much as
possible
• Old favourites: Continuous
Integration/Source Control
• Puppet/Che...
T O C O N C L U D E
S O …
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 micro...
T H A N K S
@swamwithturtles
swamwithturtles.com
Upcoming SlideShare
Loading in …5
×

Decoupled APIs through microservices

3,212 views

Published on

Why should we use microservices during API architecture and design? What even is a Microservice? What does the ecosystem look like at the moment?

Published in: Technology

Decoupled APIs through microservices

  1. 1. M I C R O S E R V I C E S D E C O U P L I N G A P I S T H R O U G H
  2. 2. M I C R O S E R V I C E S D E C O U P L I N G A P I S T H R O U G H
  3. 3. W H O A M I ? • David Simons (@SwamWithTurtles) • Technical Lead for Softwire • Hacker specialising in Node and Java
  4. 4. 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
  5. 5. W H AT I WA 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?
  6. 6. W H AT P R O B L E M S D O M I C R O S E R V I C E S S O LV E ? Q U E S T I O N 1 :
  7. 7. W H AT D O W E A S P I R E F O R I N A G O O D A P I ?
  8. 8. W H AT M A K E S A G O O D A P I ? HATEOS-y Sensibly named Ignorant of Consumers Well 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
  9. 9. D E C O U P L E D A G O O D A P I I S …
  10. 10. R E U S A B L E A G O O D A P I I S …
  11. 11. S C A L A B L E A G O O D A P I I S …
  12. 12. 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 …
  13. 13. W H AT I S A M I C R O S E R V I C E ? Q U E S T I O N 2 :
  14. 14. Independently deployable services focused around business concerns, which contain all your logic.
  15. 15. F O C U S E D A R O U N D B U S I N E S S C O N C E R N S M I C R O S E R V I C E S A R E …
  16. 16. 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
  17. 17. 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
  18. 18. I N D E P E N D E N T LY D E P L O YA B L E M I C R O S E R V I C E S A R E …
  19. 19. 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
  20. 20. 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
  21. 21. T H E F R A C T U R E D M O N O L I T H B E WA R E …
  22. 22. C O N TA I N I N G A L L Y O U R L O G I C A M I C R O S E R V I C E H A S …
  23. 23. - M A R T I N F O W L E R “Smart Endpoints, Dumb Pipes”
  24. 24. S M A R T P I P E S
  25. 25. H O W D O E S T H I S M AT C H O U R “ I D E A L A P I ” ?
  26. 26. 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
  27. 27. 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
  28. 28. 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
  29. 29. M I C R O S E R V I C E S A R E N O T R I G H T F O R E V E RY O N E WA R N I N G
  30. 30. 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
  31. 31. T H E B A D B I T S … • Similar issues exist with any “encapsulation” methodology: • OOP • Web Components
  32. 32. H O W C A N I S TA R T T O I M P L E M E N T T H E M ? Q U E S T I O N 3 :
  33. 33. T H E R E ’ S T O O M U C H T O TA L K A B O U T I N O N E TA L K . WA R N I N G
  34. 34. C R E AT I O N S T E P # 1 :
  35. 35. 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)
  36. 36. C R E AT I O N • DropWizard
  37. 37. P O P U L AT I O N S T E P # 2 :
  38. 38. J U S T C O D E I T ! P O P U L A T I O N
  39. 39. M E S S A G E PA S S I N G S T E P # 3 :
  40. 40. 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
  41. 41. D E P L O Y M E N T S T E P # 4 :
  42. 42. D E P L O Y M E N T • Five years ago: • Work hard
  43. 43. 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
  44. 44. T O C O N C L U D E S O …
  45. 45. 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!
  46. 46. T H A N K S @swamwithturtles swamwithturtles.com

×