LJC 05/14 "Cloud Developer's DHARMA"

1,898
-1

Published on

Building applications for the IaaS Cloud is easy, right? "Sure, no problem - just lift and shift!" all the Cloud vendors shout in unison. However, the reality of building and deploying Cloud applications can often be different. This talk will introduce lessons learnt from the trenches during two years of designing and implementing cloud-based Java applications, which we have codified into our Cloud developer’s 'DHARMA' rules; Documented (just enough); Highly cohesive/loosely coupled (all the way down); Automated from code commit to cloud; Resource aware; Monitored thoroughly; and Antifragile.

We will look at these lessons from both a theoretic and practical perspective using a real-world case study from Instant Access Technologies (IAT) Ltd. IAT recently evolved their epoints.com(http://epoints.com/) customer loyalty platform from a monolithic Java application deployed into a data centre on a 'big bang' schedule, to a platform of loosely-coupled JVM-based components, all being continuously deployed into the AWS IaaS Cloud

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,898
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Code doesn’t tell whole storycontext, containers, components and classes
  • James Gough’s “The benefits are more than just the tests”Mash Badar’s “TDD at Scale” (slidesha.re/19P7kzS)
  • LJC 05/14 "Cloud Developer's DHARMA"

    1. 1. Cloud Developer’s DHARMA… redefining ‘done’ for Cloud applications Daniel Bryant CTO, Instant Access Technologies d.bryant@iatltd.com @danielbryantuk
    2. 2. Who is this guy? • My career so far… • Open source work • I enjoy coding… 07/05/2014 @danielbryantuk
    3. 3. @danielbryantuk07/05/2014
    4. 4. epoints.com 2012/13 Upgrade… @danielbryantuk07/05/2014 • Increasing traffic – Scalability being stretched • Increasingly diverse requirements • Our starting point – Developers creating monolithic application – Manual QA – Operations deploying to data center
    5. 5. Core Changes… • Service-Oriented Architecture • Cloud-based deployments • DevOps Culture @danielbryantuk07/05/2014
    6. 6. Core Changes… • Service-Oriented Architecture – Twitter’s Story (bit.ly/1j1WbmI) • Cloud-based deployments – Tonight! • DevOps Culture – Previous LJC Event (bit.ly/1elVPJz) @danielbryantuk07/05/2014
    7. 7. Moving to the Cloud • IAT chose Amazon Web Services (AWS) IaaS • IaaS was great, but… – Made a few mistakes – Learnt a lot of lessons • Bonus! Russ Miles view on PaaS – bit.ly/1neXzaf 07/05/2014 @danielbryantuk
    8. 8. Common Cloud Problems TL;DR… 07/05/2014 @danielbryantuk
    9. 9. @danielbryantuk07/05/2014
    10. 10. Common Cloud Problems • Components – Who does what now? – Configuration issues • Deployment topology – Cloud networking – “Is that DB local?” 07/05/2014 @danielbryantuk
    11. 11. Common Cloud Problems • Unknown failure modes – Bang! – Now you see me… – Can…you…hear…me?… – A to B, but not B to A 07/05/2014 @danielbryantuk
    12. 12. Common Cloud Problems • High Availability (HA) – Self-inflicted wounds… • Snowflake servers • Monitoring / Diagnostics 07/05/2014 @danielbryantuk
    13. 13. Common Cloud Problems • Not respecting the underlying hardware • Not testing in the Cloud – Here be dragons! 07/05/2014 @danielbryantuk
    14. 14. We’ve created a “Cloud Developer’s DHARMA” to act as a checklist when building Cloud apps 07/05/2014 @danielbryantuk
    15. 15. dharma /ˈdɑˈmə,ˈdəˈmə/ noun 1. Signifies behaviors that are considered to be in accord with order that makes life and universe possible (Hinduism) 2. "cosmic law and order”, but is also applied to the teachings of the Buddha (Buddhism) 07/05/2014 @danielbryantuk
    16. 16. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    17. 17. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    18. 18. 07/05/2014 @danielbryantuk
    19. 19. 07/05/2014 @danielbryantuk07/05/2014 @danielbryantuk
    20. 20. Documentation (just enough) • Create a Wiki • Simon Brown’s C4 Model – bit.ly/StVpa4 • Architectural ‘views’ • Open Source style README.md
    21. 21. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    22. 22. High Cohesion / Loose Coupling (all the way down…) • Code • Architecture – Components – Services • Public API – PayPal (bit.ly/1hnZNly) 07/05/2014 @danielbryantuk
    23. 23. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    24. 24. Automated from Commit to Cloud 07/05/2014 @danielbryantuk • Continuous Integration • Continuous Deployment • Continuous Delivery
    25. 25. Our Build Pipeline Jenkins, with plugins… • Build Pipeline – wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin • Parameterized build – wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build • Promoted Builds Plugin – wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin 07/05/2014 @danielbryantuk
    26. 26. Our Build Pipeline • Component Build – Compile – Unit Tests (surefire) – Integration Tests (failsafe) • Deployment onto QA Cloud – Python Scripts + Chef to provision – Verify success using Python 07/05/2014 @danielbryantuk
    27. 27. Our Build Pipeline • Acceptance Tests – Cucumber and Selenium – Work in progress… • Performance Tests – Jmeter – Jenkins Jmeter performance plugin • Live Deployment – “Human-based conditional operation” 07/05/2014 @danielbryantuk
    28. 28. Automating QA • Intra-component integration testing – Spock is awesome (code.google.com/p/spock) – Utilise embedded datastore/middleware • Inter-component integration testing – The hardest part of SOA… • Consumer-based Testing – Brandon Byars (bit.ly/1lmcoaD) 07/05/2014 @danielbryantuk
    29. 29. Infrastructure: Say No To Snowflakes! • Automate all provisioning – Chef, Puppet, SaltStack – Bash, Python – AWS API / CLI • “Infrastructure as Code” – Version control everything 07/05/2014 @danielbryantuk
    30. 30. Infrastructure: Say No To Snowflakes! • Doing “Proper Development” – Gareth Rushgrove at Craft Conf (bit.ly/1njuc49) – Chef Conf (www.youtube.com/user/getchef) • Local tooling/testing – Vagrant (www.vagrantup.com) – Docker (www.docker.io) 07/05/2014 @danielbryantuk
    31. 31. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    32. 32. Deployment Platform: What you’ve got… 07/05/2014 @danielbryantuk
    33. 33. What you think you want… 07/05/2014 @danielbryantuk
    34. 34. What you get… 07/05/2014 @danielbryantuk Fact: 9 out of 10 cheetahs prefer the taste of an Ops team over tinned food
    35. 35. Thou Shalt Know thy Cloud… • AWS EBS 100 IOPS (by default) – My Mac SSD does 49K IOPS • 1000Mbps network max transfer ~125MB/s – My Mac does 400+ MB/s Sequential Write to SSD • “Noisy *virtual+ Neighbours” Reference for Mac statistics: bit.ly/1ftJZH8 07/05/2014 @danielbryantuk
    36. 36. Thinking/Acting Operationally • Cultivate “Mechanical Sympathy” • Virtualisation – Tech Target (bit.ly/1kDVqyG) • Networking – ‘Unix and Linux System Administration Handbook’ – aws.amazon.com/documentation 07/05/2014 @danielbryantuk
    37. 37. Thinking/Acting Operationally • Learn Linux fundamentals • Diagnostic skills – top, netstat, vmstat, tcpdump – Java utils: jps, jstat, jmap, jhat – “DevOps Troubleshooting” by K. Rankin • Maybe grow a beard… 07/05/2014 @danielbryantuk
    38. 38. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    39. 39. Monitor All The Things! • Infrastructure monitoring – Nagios – Zabbix – Splunk – AppDynamics • Distributed Tracing – twitter.github.io/zipkin 07/05/2014 @danielbryantuk
    40. 40. Component Metrics 07/05/2014 @danielbryantuk • Dropwizard’s Metrics – metrics.codahale.com • Netflix’s Servo – github.com/Netflix/servo • Etsy’s StatsD – github.com/etsy/statsd/wiki
    41. 41. Gauges, Counters, Meters, Timers… 07/05/2014 @danielbryantuk
    42. 42. Graph It! 07/05/2014 @danielbryantuk
    43. 43. 07/05/2014 @danielbryantuk
    44. 44. 07/05/2014 @danielbryantuk
    45. 45. Health Checks 07/05/2014 @danielbryantuk
    46. 46. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk
    47. 47. Antifragile • The opposite of fragile? – Robust… – Antifragile… • Netflix are best-in-class – bit.ly/1gs5n3q • System must be robust first! 07/05/2014 @danielbryantuk
    48. 48. Design for Failure • Design patterns – Timeouts / retries – Bulkheads / circuit-breakers • Inspiration – Chris Richardson (slidesha.re/1ft3vsg) – Netflix (bit.ly/1h5GMid) 07/05/2014 @danielbryantuk
    49. 49. Retries 07/05/2014 @danielbryantuk https://github.com/rholder/guava-retrying
    50. 50. Circuit-breaker 07/05/2014 @danielbryantuk https://github.com/Netflix/Hystrix
    51. 51. Robust in the Cloud • Distributed Computing Principles – ‘For young bloods’ (bit.ly/1pKVepz) • “Multi-AZ” 07/05/2014 @danielbryantuk
    52. 52. Robust in the Cloud 07/05/2014 @danielbryantuk
    53. 53. Robust in the Cloud • Careful caching… • Make apps “Cluster-aware” – MongoDB – SolrCloud – RabbitMQ 07/05/2014 @danielbryantuk
    54. 54. Real Antifragility • Autoscaling 07/05/2014 @danielbryantuk
    55. 55. Antifragile Patterns • Stateless components • Distributed data stores / caches 07/05/2014 @danielbryantuk
    56. 56. Antifragile Patterns • Eventual consistency • Asynchronous communication 07/05/2014 @danielbryantuk http://cloudshankar.blogspot.co.uk/2013/05/eventual-consistency.html
    57. 57. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 07/05/2014 @danielbryantuk So, Cloud Apps are ‘done’ when…
    58. 58. Thanks For Listening • Massive thanks to all the IAT team! • Questions / comments? – d.bryant@iatltd.com – @danielbryantuk • Join us at Devoxx UK! – www.devoxx.co.uk 07/05/2014 @danielbryantuk
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×