class: center, middle # Basic principles of Cloud applications and their architectural styles ### A Software Architecture lecture ### Peter Schiffer, Red Hat Czech --- class: center, middle # Do I hear Cloud again? --- background-image: url(img/cloud-good.jpg) --- background-image: url(img/cloud-bad.jpg) ??? No clear specification what cloud means, but there is a plenty of requirements for cloud applications. --- # Brief history of cloud computing * 2006 - Amazon Web Services * 2007 - Heroku (PaaS) * 2010 - Microsoft Azure * 2010 - OpenStack (IaaS) * 2011 - OpenShift (PaaS) * 2011 - Google Cloud Platform ## In general * When single server stops being enough * with increasing demand for faster deployment * with increasing demand for cheaper services * with increasing number of technologies --- # When single server is not enough * More data * Complex operations -- ### Vertical scaling is limited * Faster CPU * More RAM * Bigger disk ### Horizontal scaling is not * Add server --- # Vertical scaling ### + * Trivial architecture * Simple to implement ### - * Expensive * Hardware failure cause bigger outages * Limited --- # Horizontal scaling ### + * Theoretically unlimited * Cheaper * Easier fault-tolerance * Easy upgrades ### - * Complex architecture * Harder to implement * Bigger footprint --- # Faster deployment Better integrated management tools enable easier and more effective deployment of cloud infrastructure. > Deploying new applications used to take the bank 8–12 weeks. Now it's done in just a few hours. New applications are delivered faster, with better quality, improving service for internal and external customers. [*] .small[[*] https://www.redhat.com/en/resources/mufg-union-bank-serves-customers-faster-private-cloud-red-hat] --- ## Before (hours to days) * User creates IT ticket requesting new virtual server * Admin creates and configures new machine * User receives login information ## Now (minutes) * User logs in to the self-service portal * Selects virtual server template * Creates new machine in couple of mouse clicks * Once the virtual server boots, it's ready to use --- # Cheaper services Usually: * no upfront costs * no termination fees * pay-as-you-go * unit of resource per hour ### Google Compute Engine example * $0.033174 / vCPU hour * $0.004446 / GB hour --- # XaaS Everything as a service: * HaaS - Hardware as a Service * IaaS - Infrastructure as a Service * PaaS - Platform as a Service * SaaS - Software as a Service * ... --- # Infrastructure as a Service * Virtual Machines * Networking * Storage ### Ability to * Use custom / to modify Operating System --- ## Networking * SDN - Software defined networking * Custom networks, subnets * Custom firewall rules * Custom DNS * Load Balancing * OpenvSwitch * OpenDaylight --- ## Storage Block storage: * Block device (disk) * Needs to be attached to the virtual server * Easy to use, well supported Object Storage: * Cloud native storage * Every object has ID - URI * REST API - HTTP GET, PUT * Amazon S3 --- ## Storage II Shared / Distributed Filesystem * Cloud native * Spans across multiple devices / servers * Enables concurrent writes * GlusterFS (distributed fs) * Ceph (block & object storage, distributed fs) --- # IaaS (OpenStack)  --- # Platform as a Service * Application platform * Languages, libraries, frameworks ### Ability to * Deploy custom application ### Not possible to * Manage OS --- # PaaS (OpenShift)  --- # Software as a Service * Access to specific software ### Ability to * Immediately use application ### Not possible to * Change application --- # Saas (CD as a Service)  --- # Classification of cloud types * Public cloud * Private cloud * Dedicated Cloud * Hybrid cloud --- # Public cloud * Publicly available, shared with others * Cost effective, ready to use * Amazon Web Services * Google Cloud Platform * Microsoft Azure --- # Private cloud * On premise, usually for internal use * Might be partially available to public * Exclusively used by owner * More expensive, requires set up period * OpenStack * CloudStack * Eucalyptus * OpenShift * Mesos --- # Dedicated cloud * Managed by provider, for single customer * OpenStack * OpenShift --- # Hybrid cloud * Integrated cloud service utilizing both private and public clouds * Federation * CloudForms ---  --- # Reading assignment * https://youtu.be/iw2Wkf5uva0 * https://youtu.be/XZmGGAbHqa0 * http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf --- class: center, middle # Questions? --- class: center, middle # Practical part --- # Google Cloud Platform https://console.cloud.google.com/ --- # IaaS https://cloud.google.com/solutions/gaming/minecraft-server https://cloud.google.com/storage/docs/quickstart-console https://codelabs.developers.google.com/codelabs/cloud-networking-101/ https://codelabs.developers.google.com/codelabs/cloud-compute-the-cosmos/ --- # PaaS https://cloud.google.com/python/getting-started/tutorial-app https://cloud.google.com/vision/docs/quickstart https://codelabs.developers.google.com/codelabs/cloud-hello-kubernetes/ https://codelabs.developers.google.com/codelabs/cloud-running-a-nodejs-container/