architecting your cloud application

50
Architec(ng your Cloud applica(on Raju Mazumder Sr. So;ware Engineer Tasawr Interac(ve Rubyist, Java and PHP Developer Like to work fun and challenging environment Web: www.rajumazumder.com TwiMer: @rajuniit *All the picture taken under crea(ve common license

Upload: raju-mazumder

Post on 26-Dec-2014

432 views

Category:

Technology


0 download

DESCRIPTION

If you want to know, what is cloud? why you should move to cloud? and what are the things you should follow when developing application for the cloud, then you can check this slide. I present it at Basis SoftExpo 2012.

TRANSCRIPT

Page 1: Architecting your cloud application

Architec(ng  your  Cloud  applica(on  Raju  Mazumder  Sr.  So;ware  Engineer  Tasawr  Interac(ve    Rubyist,  Java  and  PHP  Developer  Like  to  work  fun  and  challenging  environment    Web:  www.rajumazumder.com  TwiMer:  @rajuniit    

                       

*All  the  picture  taken  under  crea(ve  common  license  

Page 2: Architecting your cloud application

What  is  “The  Cloud”?  

                                               

Page 3: Architecting your cloud application

I  don’t  know  

                                               

Page 4: Architecting your cloud application

A  hype?  

Hos(ng  solu(ons?  New  terminology?  

Compu(ng  Services?   Scalable  architecture?  

Okay,  so  is  it  …                                                  

Page 5: Architecting your cloud application

21  experts  defined  Cloud  compu(ng!!!                                                  

Page 6: Architecting your cloud application

Cloud  is  …                                                  

•  Pay  only  for  what  you  use  •  Elas(c  capacity  •  Self  service  interface  •  Scale  based  on  the  level  of  traffic  •  Resources  are  abstracted/virtualized  

Page 7: Architecting your cloud application

Three  service  models  

•  SaaS  •  PaaS  •  IaaS  

                                               

Page 8: Architecting your cloud application

SaaS                                                  

Page 9: Architecting your cloud application

                                               

IaaS  

Page 10: Architecting your cloud application

PaaS                                                  

Page 11: Architecting your cloud application

•  Let’s  discuss  it  in  a  non-­‐technical  way  so  that  your  Grandmother  can  understand  it  ..  

                                               

Why  Cloud?  

This  idea  take  from:    hMp://goo.gl/mIbbs    

Page 12: Architecting your cloud application

•  Say  you  just  moved  to  a  city  and  looking  for  a  place  to  live  

                                               

Page 13: Architecting your cloud application

•  Now  you  have  two  op@ons.  You  can  either                            Build  a  house  or        Rent  an  apartment  

                                               

Page 14: Architecting your cloud application

•  If  you  want  to  build  a  house,  there  are  some  important  decisions  you  have  to  make.  

                                               

Page 15: Architecting your cloud application

•  How  big  is  the  house?  •  Are  you  planning  to  grow  a  large  family?  •  Ini@al  cost  is  lots  more  

                                               

Page 16: Architecting your cloud application

•  Flooring,  roof,  ligh@ng,  landscaping  

                                               

But  you  get  a  chance  to  customize  

Page 17: Architecting your cloud application

•  Once  the  house  built,  you  are  responsible  for  maintenance  •  Hire  Landscaper,  plumber,  electrician,  hea@ng  and  cooking,  house  keeping  

•  Pay  property  tax,  electricity  water  

                                               

Page 18: Architecting your cloud application

                                               

How  about  ren(ng?  

Page 19: Architecting your cloud application

•  You  have  to  make  a  fewer,  simpler  decisions  

•  You  can  start  with  a  one  unit  and  grow  later  or  downsize  

                                               

Page 20: Architecting your cloud application

•  But  you  do  not  have  lot  of  op@ons  to  customize  your  unit  

                                               

Page 21: Architecting your cloud application

•  However  builders  provide  you  with  very  high  quality  infrastructure  

•  High  speed  internet,  high  capacity  electricity,  green  materials,  triple  pane  windows  

                                               

Page 22: Architecting your cloud application

•  No  need  to  worry  about  maintenance  cost.  •  No  need  to  hire  plumbers,  electrician  and  landscaper  

•  ini@al  cost  is  low  

                                               

Page 23: Architecting your cloud application

•  Pay  as  you  go  •  Just  pay  your  rent  and  u(li(es  bill  

                                               

Page 24: Architecting your cloud application

• How  it  relates  with  Cloud  Compu(ng  ?  

                                               

Page 25: Architecting your cloud application

•  Lets  tell  you  a  story  why  we  should  move  to  Cloud?  

                                               

Not  Convinced?  

Page 26: Architecting your cloud application

Three  Developers  ….  •  Anis  •  Raju  •  Khairul  

working  together  and  have  a  dream  one  day  they  will  make  something  great  …  

                                               

Page 27: Architecting your cloud application

One  day  morning…  

•  Anis  was  very  excited.  Hey  guys  I  have  a  idea.  Let’s  build  it.  

Raju  and  Khairul  were  also  very  excited  to  hear  it.  

                                               

Page 28: Architecting your cloud application

Idea  “holiday  gi;”  •  A  simple  applica@on  where  user  can  buy  virtual  gi;  and  sent  it  to  his  friends.  

So  they  decided,  they  will  develop  the          applica@on  ..  

                                               

Page 29: Architecting your cloud application

Technology  stack  •  OS  X  for  development,  Linux(centOS)  in  produc@on  

•  Apache  •  PHP  •  MySQL  •  Git  Developing  was  progressing  ..  

                                               

Page 30: Architecting your cloud application

Ini(al  Architecture                                                  

Page 31: Architecting your cloud application

Applica(on  Deploy!!!  

•  Within  15  days  they  have  developed  the  applica@on  and  deploy  it  into  a  tradi(onal  hos(ng  site.  

                                               

Page 32: Architecting your cloud application

Site  is  growing  

•  They  need  more  resources  •  So  they  had  to  invest  to  buy  resources  •  Bought  another  one  web  server  •  Introduced  Load  Balancer  

                                               

Page 33: Architecting your cloud application

New  Architecture                                                  

Page 34: Architecting your cloud application

The  site  was  growing  too  fast  

•  AZer  one  week  New  Year  is  coming.  So  they  •  Bought  three  memcached  servers  •  Add  two  more  web  servers  •  Add  one  more  database  server  and  par@@on  it  as  master  and  slave.  

So  they  were  very  excited  and  but  they  didn’t  what  was  going  to  happen..  

                                               

Page 35: Architecting your cloud application

New  Architecture                                                  

master  

Database            slave  

Page 36: Architecting your cloud application

New  year!!!  •  They  didn’t  sleep  last  night.  •  Site  was  going  to  down  very  frequently.  •  Actually  they  didn’t  expect  massive  user  visits  •  They  need  more  web  servers,  memcache  servers  and  database  servers  

•  But  It  tokes  more  (me  to  add  and  configured  resources  

                                               

Page 37: Architecting your cloud application

Disaster!!!  •  They  were  trying  hard  to  give  backup  •  But  aZer  some  few  hours  they  were  going  to  down  completely  

Everyone  was  very  upset  and  from  next  day  the  site  was  live  again.  

                                               

Page 38: Architecting your cloud application

Lessons  

•  It  takes  more  @me  to  add  new  resource  •  No  automa@c  deployment  •  No  fault  tolerance  •  Had  to  invest  more  money  but  aZer  peak  hour  the  resource  is  idle  

                                               

Page 39: Architecting your cloud application

                                               

Can  Cloud  help  them  that  (me?  

Page 40: Architecting your cloud application

Cloud  Architecture  

                                               

Page 41: Architecting your cloud application

Are  you  •  Engineer?    •  Developer?  •  Architect?    If  yes  then  you  have  to  keep  something  in  your  mind  when  developing  applica(on  for  the  cloud  ..  

                                               

Page 42: Architecting your cloud application

Horizontal  Scalability  

•  Adding  more  servers  •  Load  balancing  •  Clustering  

                                               

Page 43: Architecting your cloud application

Sessions  

•  HTTP  is  a  stateless  protocol  •  By  default  on  the  local  server  •  Cause  a  problem  to  load  balance  •  Unintended  logout  

                                               

Page 44: Architecting your cloud application

To  cloudify  Sessions  

•  Some  load  balance  support  “session  affinity”  •  Shared  sessions  using  database  or  file  storage  •  Session  clustering  using  memcached  

                                               

Page 45: Architecting your cloud application

Distributed  File  Storage  

•  Stored  on  a  directory  on  the  web  server  •  Cause  trouble  into  mul@-­‐server  environment  

                                               

Page 46: Architecting your cloud application

Cloudily  file-­‐storage  

•  Tradi@onal  approach  to  add  a  shared  storage  •  We  can  use  Amazon  S3  and  Rackspace  Cloudfiles  

•  Some  open  source  solu@ons  MogileFS2,  HDFS3  and  Ceph  

                                               

Page 47: Architecting your cloud application

Automa(c  Deployment  

•  You  should  have  automa@c  deployment  process.  

                                               

Page 48: Architecting your cloud application

Prepare  for  Failure  

•  Cloud  is  not  silver  bullet  

                                               

Page 49: Architecting your cloud application

Misconcep(ons  

•  Just  because  it  is  in  the  cloud  doesn’t  mean  it  scales  

•  Not  only  do  you  need  to  rebuild  your  applica@on,  you  also  need  to  rethink  your  applica@on  

•  Failure  as  a  Feature  

                                               

Page 50: Architecting your cloud application

                                               

Thank  you