Memo: Learn Cloud Concept
Cloud computing
is one practices to use a network of remote server hosted on internet to store, manage and process data.
characteristic of Cloud provider:
- Someone else owns the servers.
- Someone else hire IT People.
- Someone else pay or rent the real estate.
- You are only responsible for configuration cloud service and code.
Vs On-premise:
- You own the servers
- Your hire IT people
- You pay or rent the real estate
- You take all the risks.
The Evolution of Cloud Hosting
- Dedicate server — One physical machine dedicate to a single business. That you purchase and put to off and set up networking, install OS and software
Benefits: you will get full control over server and have the highest level of security.
Use case: run a single web app
Pros: High security
Cons: Very expensive and highly maintenance
2. Virtual Private Server (VPS)— One physical machine dedicate to a single business. Isolate the application by virtualize machine to sub-machine to run multiple workload (application).
3. Shared Hosing — One physical machine share by hundreds of business. Isolate the virtual for each customer or tenant each other by folder the machine, so it will have 100+ business on single machine and you will limit the system work.
pros: Very cheap
cons: Very limited, can’t access to underlying OS, has some change the customer use over utilizing the machine and impact the workload
4. Cloud Hosting — Multi physical machine act as one system. To resolve the problem the one customer use over utilizing the single machine. The system is abstracted into multiple cloud services.
pros: Flexible, Scalable, Secure, Cost-effective, Highly configurability.
Cloud Service Provider
CSP — is a company that provide multiple Cloud service and those service can be chained together to create cloud architecture. eg. GCP, AWS.
*1st service of GCP is “App engine”.
7 Benefit of Cloud computing
- Cost effective — you pay what you use (pay-as-you-go) with on-demand pricing, no up-front cost.
- Global — launch workload to distributed anywhere in the world.
- Secure — CSP take care of physical security. Service in cloud is secure by default.
- Reliable — Data backup, disaster recovery (DR), data replicate and fault tolerance.
- Scalable — Increase and decrease resource and service base on demand.
- Elastic — Automate scaling during spike and drop in demand.
- Current — underlying hardware and software is patched, upgraded and replaced by CSP without interrupt.
3 types of Cloud services
- SaaS — software as a service, it’s a product is run and managed by service
provider. “Just use the application, don’t worry about the service is maintained”
usage: FOR CUSTOMER
2. PaaS — Platform as a service, it’s a platform that help you to deployment. and management the application. “Focus on deployment, Don’t worry about provisioning, config or underlying hardware or OS”
usage: FOR DEVELOPER
3. IaaS — Basic building block for cloud. provide access to network, compute and data storage space. “Don’t worry about IT staff, data center and hardware”
usage: FOR ADMINS
4 common cloud services for Infrastructure as a Service (IaaS)
- Compute —having virtual computer that can run application, program and code.
- Storage — having virtual hard drive that can store files.
- Networking — having virtual network be able to define internet connection or network isolation
- Databases — having virtual database for storing data.
Google’s Shared Responsibility model
shared responsibility model — is a visualization to determine the customer’s responsible and google’s responsible for related to GCP.
- Customer’s responsible — about data and configuration of service and access control of user via permissions. “Responsibility in the cloud”
- Google’s responsible — for the underlying infrastructure “Responsibility of the cloud”
Share Responsibility model for Google Compute service
IaaS
Bare Metal
Customer: Host OS config, Hypervisor
Google: Physical machine
Virtual machine (compute engine)
Customer: Guest OS config, Container runtime
Google: physical machine, hypervisor
Container (GKE)
customer: config container, deploy container and storage container
google: OS, hypervisor, container runtime
PaaS
Manage platform (App engine)
customer: upload code, config the env
google: server, OS, network, storage, security
SaaS
Google docs
customer: content of doc, mange file, config sharing access control
google: server, OS, network, security
FaaS
Cloud Function
customer: upload ur code
google: deployment, container runtime, network, storage, physical machine
SRM Overview
Customer:
- IAM
- OS
- Network
- Firewall
- Client-side data encrypt
- Server-side data encrypt
- Networking Traffic protection
- Customer Data
Google:
- Compute
- Storage
- Network
- Database
- Region
- Zone
- Physical security
Cloud Computing Deployment model
4 models
- Public cloud — aka Cloud Native: everything built on the CSP.
- Private cloud — aka On-premise: everything built on the company’ data center.
- Hybrid — using on-premise and CSP
- Cross cloud — aka multi-cloud, hybrid-cloud: using multi CSP.
*Anthos is GCP service to handle to control across multi CSP and on-premise.
Cloud Computing Deployment models
- Cloud — fully utilizing cloud computing
use cases: start-up, New project
2. Hybrid — using both cloud and on-premise
use cases: Bank, Legacy on-premise, Fin tech, Investment management
3. On-premise — deploy resource on-premise
use cases: Public sector (government), Sensitive data (eg. hospital), compliance and regulation (eg. insurance company)
Total Cost of Ownership (TCO)
the total expense and actual cost of IT spend.
2 type of cost:
- CAPEX (on-premise) — spend money upfront for physical infrastructure:
software license, Phyiscal security, hardware, IT staff and maintenance.
server cost (compute), storage cost(hard drive), data center cost, techical staff
*with CAPEX: you have to guess upfront when you plan to spend.
- OPEX (cloud / GCP) — pay for non-physical cost (on-demand / pay-as-you-go): leasing software, train employee, pay for cloud support, billing base on cloud metric (compute usage, storage usage)
- with OPEX: you pay on service without investing in equipment.
Cloud Architecture Terminology
5 pillars
- Availability — is ability to ensure a service remain available (HA),
- Scalability — is ability to grow rapidly or unimpeded
- Elasticity — is ability to shrink and grow to meed on-demand
- Fault tolerance — is ability to prevent a failure
- Disaster Recovery — is ability to recover from a failure
High Availability (HA)
ability for service to remain available by ensure there is no single point of failure and ensure a certain level of performance.
eg. system has load balancer and has compute distribute in 3 zone. if we lose one or two zone , we would still a running service.
Because load balancer will detect that there are unhealthy and reroute the traffic to remaining server -> it help us to be HA.
*Running workload across multiple zone -> ensure if 1 or 2 zone become available , your service / app remain avaialble.
High Scalability (HS)
ability to increase the capacity base on increase demand with rapidly of traffic, memory and compute power with 2 options:
- Vertical scale — scaling up by increase the size of machine.
- Horizontal scale — adding additional server with same size.
High Elasticity (HE)
ability to automatically increase or decrease the capacity base on current demand of traffic, memory and compute power.
GCP service: Manage Instance Group (MIG)
only for horizontal scale
- scale out — add more server of same size.
- scale in — remove more server of same size.
High Fault tolerance (HF)
ability for service to ensure there is no single point of failure -> prevent chance of failure.
“Fail over “— is when you have plan to shift traffic to redundant system in case primary system is fail.
GCP service: Cloud Load Balancing
eg. having a copy (secondary) of database where all ongoing change are synced. The secondary database / system is not in-use until a failover occurs and it become the primary database
High Durability (HD)
ability to recover from failure / disaster and prevent the loss of data.
solution that recover from disaster aka Disaster Recovery (DR):
- Backup data ?
- How fast can restore the backup ?
- Backup is still work ?
- How to ensure live data is not corrupt ?
Evolution of compute
Dedicated — a physical server (sole-tenant / single tenant, single node cluster, bare metal) utilized by a single customer.
pros:
- Guarantee of security, privacy and full access underlying resources
cons:
- Have to guess capacity
- Overpay for underutilize server
- Get upfront to purchase guess capacity
- Can’t vertical scale -> need to manual migration
- Limited by ur Host OS
VMs — a one physical machine that can run multiple Virtual machine.
- add the software layer (Hypervisor) to handle to run the VMs
- one physical server shared by multiple customer
pros:
- Easy to Vertical or Horizontal scale
- Easy to image for migration
cons:
- Overpay for underutilized VM
- Limited by ur Guest OS
- Multi app on single VM can result in conflicts in resource sharing
Container — VM running multiple container, so has Docker Deamon layer that let multiple container run.
pros:
- can maximize the utilize of available capacity
- container share the same underlying OS -> containers are more efficient than multiple VMs
- one container can run multiple without being limited and not conflicts during resource sharing.
Functions — are manage VMs running managed container aka Serverless Compute
pros:
- you just upload the code and choose amount of memory + duration
- Very cost-effective -> only pay for time code is execute
cons:
- Cold start is a side effect.