architecting for the
play

Architecting for the Clo loud @axelfontaine About Axel Fontaine - PowerPoint PPT Presentation

Architecting for the Clo loud @axelfontaine About Axel Fontaine Founder and CEO of Boxfuse Over 15 years industry experience Continuous Delivery expert Regular speaker at tech conferences JavaOne RockStar in 2014


  1. Architecting for the Clo loud @axelfontaine

  2. About Axel Fontaine • Founder and CEO of Boxfuse • Over 15 years industry experience • Continuous Delivery expert • Regular speaker at tech conferences • JavaOne RockStar in 2014 @axelfontaine

  3. flywaydb.org

  4. boxfuse.com

  5. about questions

  6. POLL: what type of infrastructure are you running on? • On Premise • Colocation • Root Server • Cloud

  7. what is special about the cloud ??

  8. Every day, AWS adds enough server capacity to power the whole $7B enterprise Amazon.com was in 2004. Weekends included.

  9. Control Plane Data Plane "RIAN archive 341194 Kursk Nuclear Power Plant" by RIA "Advanced Test Reactor" by Argonne National Laboratory - Novosti archive, image #341194 / Sergey Pyatakov / CC-BY-SA originally posted to Flickr as Advanced Test Reactor core, 3.0. Licensed under CC BY-SA 3.0 via Wikimedia Commons - Idaho National LaboratoryUploaded using F2ComButton. http://commons.wikimedia.org/wiki/File:RIAN_archive_341194_ Licensed under CC BY-SA 2.0 via Wikimedia Commons - Kursk_Nuclear_Power_Plant.jpg#mediaviewer/File:RIAN_archi http://commons.wikimedia.org/wiki/File:Advanced_Test_Reac ve_341194_Kursk_Nuclear_Power_Plant.jpg tor.jpg#mediaviewer/File:Advanced_Test_Reactor.jpg

  10. Control Plane Data Plane

  11. benefits of the cloud  Shift to a world of abundance (no more resource scarcity)  Clean Control Plane/Data Plane split with API-based provisioning  Cost-based Architectures with the ability to turn infrastructure off

  12. moving to the cloud

  13. lift & shift (= the naïve approach)

  14. lift & shift (= the naïve approach) Congratulations! You now have: • A more expense Hetzner/OVH • Lots of (too much?) trust in your cloud provider • Potential legal trouble due to data privacy laws

  15. understanding the cloud

  16. regions

  17. availability zones <<IMAGE GERMANY + two small clouds with racks>>

  18. building blocks http://en.wikipedia.org/wiki/Lego#/media/File:Lego_Color_Bricks.jpg

  19. building blocks Storage Compute Network Security

  20. The hard Truth about Security 1. Always breakable with infinite time & resources 2. Must make it more complicated/expensive to break than it’s worth (use defense in depth!) 3. Has a usability cost 4. Almost always about the data

  21. the 3 states of data Data at Rest Data in Use Data in Motion

  22. Trusting your neighbors is good. But it’s even better to put a good lock on the door. Werner Vogels CTO of an online book shop http://en.wikipedia.org/wiki/Werner_Vogels#/media/File:Wernervogels_ddp.jpg

  23. Data in Motion TLS / SSL

  24. Data in Use & at Rest Client-side encryption

  25. Client-side encryption  Encrypt sensitive & personally identifiable data  Use different Encryption key for each field/record  Encrypt Encryption Key using Key encrypting Key  Secure & Rotate the Key encrypting Key

  26. Key Management In App KMS HSM € €€ €€€€€

  27. Querying Encrypted Data Id Encrypted Hmac Encrypted Low Fi Encrypted 123 #!azw\b 5841545832 #!azw\b 48.5 #!azw\b 456 67ftf6&) 0219237127 67ftf6&) 37.2 67ftf6&) Other Exact Match Range clear text => Hmac => Lower fidelity field => Use transparent persistence layer converters!

  28. Compute

  29. POLL: which level of automation are you at? • Build • Unit Tests • Continuous Integration • Acceptance Tests • Continuous Deployment (Code) • Continuous Deployment (Code + DB + Configuration) • Infrastructure

  30. Test Build

  31. Test Build

  32. • One immutable unit • Regenerated after every change • Promoted from Environment to Environment Classic Mis istake: Build per Environment

  33. Image Instance ? Fully Baked Provisioned on Startup

  34.  Every Instance 100% identical  Fastest startup  Launch always succeeds Most people Fully Baked Provisioned on Startup

  35.  One immutable unit  Regenerated after every change  Promoted from environment to environment Most people Fully Baked Provisioned on Startup

  36.  One immutable unit  Regenerated after every change  Promoted from environment to environment Image Fully Baked

  37.  One immutable unit  Regenerated after every change  Promoted from environment to environment

  38.  One immutable unit  Regenerated after every change  Promoted from environment to environment Image Fully Baked

  39. keep your instances stateless Image Instance Fully Baked

  40. high uptime is a liability The longer an instance is up, the harder it becomes to recreate exactly (and it will fail eventually!)

  41. Focus shift Instance Service Individual instances become disposable

  42. Treat servers like cattle instead of pets

  43. What are the implications ???

  44. scaling Image Instance

  45. types of scaling up out in down

  46. scaling triggers for different types of services sync async cron => load => queue depth => time

  47. scaling & costs vs prefer smaller granularity

  48. instance types General Purpose CPU RAM Disk

  49. How to solve service discovery ? ? Instance Elastic Load Instance Balancer Instance Use a stable entry point with an internal registry

  50. what about configuration ??? • Bake as much configuration as possible for all environments directly in the Image • Use environment detection and auto-configuration • Pass remaining configuration Key Value at startup and expose it as JDBC_URL jdbc :… environment variables ENV prod

  51. what about the database ??? Instance • Keep all persistent state out of the instance, including the database • Use one of the many good hosted solutions available like Amazon RDS or Google Cloud SQL • Use a database migration tool to update the schema on application startup

  52. what about the logs ??? ssh me@myserver1 LOG tail -f server.log file ssh me@myserver2 LOG tail -f server.log file ssh me@myserver3 LOG tail -f server.log file

  53. LOG file LOG log server file LOG file

  54. Ship logs to a central log server Many good hosted solutions • Loggly • where they can be Logentries • • aggregated Papertrail • • stored and backuped … • indexed • searched through a nice web UI => Think about data privacy!

  55. what about sessions ??? Keep session in an encrypted and signed cookie • avoids session timeouts • avoids server clustering & session replication • avoids sticky sessions & server affinity

  56. what about rolling out new versions ???

  57. Availability Zone 1 App v1 Load Balancer App v1 Logs Availability Zone 2

  58. Availability Zone 1 App v1 Load Balancer App v1 Logs Availability Zone 2

  59. Availability Zone 1 App v1 App v2 Load Balancer App v1 Logs App v2 Availability Zone 2

  60. Availability Zone 1 App v1 App v2 Load Balancer App v1 Logs App v2 Availability Zone 2

  61. what about containers ???

  62. understanding modern CPUs Both Intel and AMD have hardware support for virtualization • isolation • performance

  63. on prem Image Image your OS+Container responsibility Hypervisor Runtime Hardware Hardware VM Container

  64. Only makes sense if cloud you cannot afford 8.75 € /month granularity your responsibility container container containers container container volumes images networking scheduling clo loud responsibility instance machine instance instance instances volumes images networking scheduling

  65. Only makes sense if cloud you cannot afford 0.0 .01 € /hour r granularity your responsibility container container containers container container volumes images networking scheduling clo loud responsibility instance machine instance instance instances volumes images networking scheduling

  66. summary  Put a good lock on the door (use encryption!)  Use fully baked images (build once!)  Treat servers like cattle (disposable!)

  67. • Fully baked images generated in seconds (not minutes or hours) • Optimized for JVM apps (Spring Boot, Dropwizard, Tomcat, TomEE, ...) • Minimal images just 1% of size of regular OS (measured in MB not GB) • Images work on VirtualBox & AWS (environment parity from dev to prod) boxfuse.com • Zero downtime updates on AWS (fully automatic blue/green deployments)

  68. final disclaimer no animals were harmed while making this talk 

  69. @axelfontaine Thanks ! boxfuse.com

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend