Slide 1

Slide 1 text

Micro Services

Slide 2

Slide 2 text

Prasanna N Venkatesan Developer with ThoughtWorks http://prasans.info/blog @pvenk

Slide 3

Slide 3 text

Expect for…

Slide 4

Slide 4 text

Expect for… •  What are Micro services? •  Why we need a new pattern? •  Implementing a Micro Service •  When to use Micro Services •  Implications of using Micro Services

Slide 5

Slide 5 text

Write programs that do one thing and do it well.

Slide 6

Slide 6 text

Micro Services should be… Small • aka Simple • In terms of LOC. • In terms of memory footprint.

Slide 7

Slide 7 text

Micro Services should be… Portable Should be independent to deploy and run

Slide 8

Slide 8 text

Micro Services should be… Performs one thing Adding many functionality to one service will break the other 2 characteristics.

Slide 9

Slide 9 text

Move the complexity to Infrastructure We've  pushed  a  lot  of  the  old  applica2on  complexity  down  to  infrastructure  level.   We  are  no  longer  bound  to  a  single  stack  or  language.      

Slide 10

Slide 10 text

Micro Services A new Paradigm?

Slide 11

Slide 11 text

Small is beautiful Make each program do one thing well. Build a prototype as soon as possible. Choose portability over efficiency. Use software leverage to your advantage. Make every program as filter. UNIX Philosophy

Slide 12

Slide 12 text

Consumer-Driven Contracts Read  more  on:  h?p://mar2nfowler.com/ar2cles/consumerDrivenContracts.html  

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

• Provider Contracts • Consumer Contracts • Consumer Driven Contracts

Slide 15

Slide 15 text

•  Closed and complete •  Singular and non­authoritative •  Bounded stability and immutability

Slide 16

Slide 16 text

Domain Driven Design

Slide 17

Slide 17 text

•  Project's  primary  focus  on  the  core  domain   and  domain  logic.   •  Complex  designs  based  on  a  model  of  the   domain.   •  Itera2vely  refine  a  conceptual  model  that   addresses  par2cular  domain  problems.  

Slide 18

Slide 18 text

Communication       •  Mostly over HTTP and pass JSON between services. •  If serialization or de-serialization is expensive try something like ProtoBuf/MessagePack •  ProtoBuf - Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats.

Slide 19

Slide 19 text

Monitoring •  More possibility of small services to just fail and fade away. •  Make sure services are running always •  Monitor usage and increase instances

Slide 20

Slide 20 text

Monitoring Tools

Slide 21

Slide 21 text

Testing Strategy •  Tes2ng  Micro  Services  are  not  so  cri2cal.   •  Preferably  have  health-­‐check  tests    in  CI.  

Slide 22

Slide 22 text

Where to use Micro Services •  Independent, small process worthy to try out in different stack. •  Don’t want to break a legacy system.

Slide 23

Slide 23 text

Implications •  Understanding how everything fits together •  Deployment •  Interactions between components •  Duplication of code across the services