wso2con asia 2016: understanding microservice architecture

26
Understanding Microservice Architecture (MSA) Sagara Gunathunga So7ware Architect WSO2

Upload: wso2-inc

Post on 13-Feb-2017

536 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: WSO2Con ASIA 2016: Understanding Microservice Architecture

Understanding  Microservice  Architecture    (MSA)  

Sagara  Gunathunga  So7ware  Architect  WSO2    

Page 2: WSO2Con ASIA 2016: Understanding Microservice Architecture

Monolithic  Applica-ons    

Built  as  a  single  unit,  so  they  are  responsible  for  every  possible  funcConality:  

handling  HTTP  requests,  UIs,  execuCng  domain  logic,  database  operaCons,  

communicaCon  with  the  browser/client,  handling  authenCcaCon  and  so  on.  

Page 3: WSO2Con ASIA 2016: Understanding Microservice Architecture

Drawbacks  of  Monolithic  u  Even  smallest  changes  involves  building  and  deploying  the  whole  

applicaCon.  

u  Scalability  issues  :  have  to  run  mulCple  instances,  even  if  you  know  that  boPlenecks  are  lay  on  one  component.  

u  One  technical  stack  is  defined  for  whole  soluCon,  without  considering  most  suitable  technology  for  each  components.      

u  High  coupling  among  project  teams.      

u  Can’t  evolve  or  replace  part  of  the  applicaCon  easily.    

Page 4: WSO2Con ASIA 2016: Understanding Microservice Architecture

What  is  ‘MSA’  ?    An  architectural  style  to  developing  a  single  applica-on  

 as  a  suite  of  small  services  

 

     

   

 -­‐  Mar&n  Fowler  

Page 5: WSO2Con ASIA 2016: Understanding Microservice Architecture

Monolithic  Vs  Microservice  

Page 6: WSO2Con ASIA 2016: Understanding Microservice Architecture

‘MSA’  -­‐    Two  Architecture  Viewpoints  

The  Inner  Architecture  -­‐  Architecture  of  an  individual  Microservice.  

The  Outer  Architecture  -­‐  Architecture  of  the  ecosystem  in  which  Microservices  

will  be  built,  deployed  and  executed.  

     

   

Inner    Architecture    

Outer  Architecture    

Page 7: WSO2Con ASIA 2016: Understanding Microservice Architecture

‘MSA’  -­‐    Inner  Architecture    

Inner    Architecture    

Page 8: WSO2Con ASIA 2016: Understanding Microservice Architecture

Characteris-cs  of    Microservice  

1.  “Micro"  is  a  concept  of  scope  rather  than  size.  A  microservice  

must  have  a  single  purpose  and  be  loosely  coupled  in  design  

 

     

   

•  NOT    a  service  implemented  with  a  small  amount  of  code.  

•  NOT  a    simple  API  to  a  more  complex  service                implemented  as  part  of  a  monolithic  applicaCon.      •  NOT  a  service  exposed  via  API  by  another  party        

Page 9: WSO2Con ASIA 2016: Understanding Microservice Architecture

2.  Microservices  should  be  independently  deployable  and  

independently    disposable      

   

 

 

     

   

Characteris-cs    Microservice  

•  Microservices  must  to  be  disposable.  If  a  microservice  fails  or  is  superseded  a  bePer  service,  then  simply  dispose  of  the  old  one.    

•  Require  lot  of  support  from  deployment  architecture  and  operaConal  environment  in  which  microservices  will  be  built,  deployed  and  executed.  

Page 10: WSO2Con ASIA 2016: Understanding Microservice Architecture

3.  Organized  around  Business  CapabiliCes  not  around  management  focused  teams  such  as    UI  ,server-­‐side,  DB        

 

     

   

Characteris-cs  of    Microservice  

Page 11: WSO2Con ASIA 2016: Understanding Microservice Architecture

4.  Decentralized  Data  Management    

 

     

   

Characteris-cs  of  Microservice  

Page 12: WSO2Con ASIA 2016: Understanding Microservice Architecture

5.  Supports  Technology  Heterogeneity  among  services      

 

     

   

Characteris-cs  of    Microservice  

Page 13: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  and  SOA  

MSA  is  not  based  on  all-­‐new  architectural  principle;  It  combines  SOA  best  prac-ces  with  modern  applica-on  delivery  tooling  and  organiza-onal  disciplines.    

+  

Page 14: WSO2Con ASIA 2016: Understanding Microservice Architecture

‘MSA’  -­‐    Outer  Architecture  

Outer  Architecture    

Page 15: WSO2Con ASIA 2016: Understanding Microservice Architecture

‘MSA’  -­‐    Outer  Architecture  

•  Service  Gateway    •   Expose  services  as  managed  APIs  •  Provides  traffic  and  policy  (security)  management    

•  Service  RouCng  •  Route  message  to  right  service  based  on  clients  and  service  polices  

 •  Load  Balancing  

•  Support  service  scalability  

•  Service  Discovery  •  Register  and  find  services  and  endpoints  dynamically  

Page 16: WSO2Con ASIA 2016: Understanding Microservice Architecture

‘MSA’  -­‐    Outer  Architecture  

•  Shared  configuraCon  •  Sharing  configuraCon  details  among  new  nodes.    

•  Dependency  management    •  Track  and  manage  dependencies  among  services    

•  Messaging  channels  •  Support  asynchronous  communicaCon  based  on  publish/subscribe  

and  event  sourcing  paPerns.      

Page 17: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  challenges  –  End  to  end  Monitoring    1.  Service  level  (APM)    &  deployment  level  dashboards    

 2.  TransacCon  tracing,  replay  and  log  analysis    

 3.  Service  InstrumentaCon      

 

Page 18: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  challenges  –  Security  

1.  AuthenCcaCon  and  AuthorizaCon    

2.  Security  context  propagaCon  among  services      

Page 19: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  challenges  –  Service  Discovery  

•  Client-­‐side  Service  Discovery              •  Server-­‐Side  Service  Discovery      

Page 20: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  challenges  –  Deployment  Scalability    

•  ApplicaCon  pladorm  as  a  service  (aPaaS)  •  WSO2  AppCloud    

 •  OS  container  management  systems    

•  Google  Kubernetes  •  Apache  Mesos    

 •  Lightweight  server  OS  

•  CoreOS  •  Atomic        

Page 21: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  and  WSO2  Although  aPaaS  pladorms  come  closest,  they  are  sCll  general-­‐purpose  pladorms,  and  there  is  currently  no  such  thing  as  a  holisCc,  commercially  supported  "microservice  pladorm"  that  brings  together  all  of  the  necessary  capabiliCes.    

- Gartner (January 2015)

WSO2  offer  ….      ①   A  compeCCve  Microservice  framework  to  support  “Inner  

Architecture”      (WSO2  MSF4J)  

② A  complete  pladorm  to  support    “Outer  Architecture  “    (  AnalyCcs,  Security,  discovery  ,  gateways,  MQ  etc.)    

Page 22: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  and  WSO2  Service  Gateway    

   

Service  Rou-ng    

   

Service  Discovery  Shared  Configura-on  Dependency  Management  

     

Messaging  

   

Monitoring      

Security    

   

Page 23: WSO2Con ASIA 2016: Understanding Microservice Architecture

WSO2  MSF4J    

2.30  PM  

Page 24: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  Drawbacks    

•  Complexity  Is  Moved  Not  Removed                        -­‐  Understanding,  managing  and  tesCng  dependencies  is  difficult.    •  Centralized  governance  is  not  possible                    -­‐  Large  numbers  of  Microservices  are  difficult  to  orchestrate    •  Increase  Network  communicaCon                  -­‐  Independently  running  component  interact  with  each  other  using  N/W                          calls.  Such  system  require  reliable  and  fast  network  connecCons.      

Page 25: WSO2Con ASIA 2016: Understanding Microservice Architecture

MSA  Drawbacks      •  Network  Security                -­‐  Inter  Service  CommunicaCon  need  to  be  secured  to  avoid  any  inter  communicaCon  security  breach  these  applicaCon                      are  more  prone  to  security  vulnerabiliCes.  

•  ProducCon  monitoring                  -­‐  Monitoring  the  applicaCon  in  producCon  deployment  becomes  a  complex  job,  with  mulCple  services.        

Page 26: WSO2Con ASIA 2016: Understanding Microservice Architecture

Thank  You