Wk 7 Cloud Computing And Wk 8 Testing In Production Flashcards
Serverful model
- IaaS : infrastructure as a service
- Paas : platform as a service
- Saas : software as a service
Iaas
Cloud provider gives access to bare servers
Paas
Provider gives access to servers with operating systems and tools
Saas
Provider gives access to applications on a subscription bases
Severful implementation
Makes use of multi tenancy by virtualization using :
- Virtual machines
- Containers
- orchestration and version control
Virtual machine multi tenancy :
A Number of virtual machines VM⁰…VMN may be run on a physical machine by a hypervisor
Fine for sharing performance but not good for sharing network
What is a hypervisor?
Maps virtual resources to physical ones ensuring they are shared fairly
Why would you want to move a virtual machine between physical ones ?
So you may shut a physical one down.
Disadvantages of virtual machines
Virtual machines are heavy and inconvenient for small computations.
Containers
Many containers may run on a physical machine. Each container does not have a kernel and rater it has the same operating system as the kernel of the physical machine.
The physical machine’s operating system maps the resources to the containers ensuring fairness.
Pro and cons of containers
Pro faster than VMs
Con if the kernel crashes all the containers crash with it
Serverful cost model
Charges resource allocation on a rental bases
Serveful microservice potential implementations:
- one service per virtual machine
- one service per container
Serverful : one service per virtual machine
- expensive as you would have many machines🫰🫰🫰
- issues with one machine would not affect other machines
Serverful: one service per container
- fast
- cheaper
- if server crashes so do all other containers
Serverless computing:
As a user you don’t have to worry about operational concerns.( Servers are still used )
Models :
- Baas
- Faas
Baas : Backend as a service
Cloud provider gives access to a service such as authentication or database storage.
Faas: Function as a service
Cloud provider rents custom code in response to requests and events
Serveless costs
Per function application
For execution time
Pay as you go
Microservices Serverless implementation:
- map a single function instance to a single microservice ( wasteful)
- map multiple functions per machine
( Maintenance and performance issues )
API Gateway
Acts as a proxy trough which http requests and responses are used to make function calls.
IaC : infrastructure as a code
Configures ( virtual) infrastructure using executable code, which can be stored in version control
( Scripts for virtual machines)
Why test in production?
- Volume
- Real users (powerful feedback)
Types of testing
- Blue Green testing
- Canary testing
- A/B feature testing
- resiliance testing
Blue green
Staging ( 🍏 ) gets uploaded to production ( 🔵) .
If an issue arrises the changes are switched back to staging. This happens through a routing table.
Canary testing
A small percentage of customer traffic is sent to a new version of the system ( tinker with load balance)
( error testing)
A/B feature testing
A small percentage of the customer traffic is sent to a new version of the production environment. (Used for UI testing )
Resiliance testing
Random VM or containers are terminated in the production environment.
Netflix test strategies
- caos monkey
- caos gorilla
- latency monkey
Caos monkey 🐒
Terminates random VMs. This ensures that the recovery plan is constantly tested.
Caos gorilla 🦍
Terminates network connections between zones ( geographical potentially such as Devon region is disconnected traffic should be redirected)
Latency monkey 🐵
Delays client server communication, measures upstream and downstream services and checks that they respond appropriately
Staging environment
Scale down replica of the production environment
Cloud computing
Many enterprises don’t own the infrastructure that provides the staging environment but rent it in the “cloud ☁️”
Cloud architecture provides
- broad network access
- on demand self service
- measured services
- rapid elasticity
- resource pooling
- assurance
broad network access
Cloud is available over standard networks
on demand self service
Often you get free trials. Very easy entry requirements.
measured services
The provider monitors and charges for what is used
rapid elasticity
Easily acquire or release machines
resource pooling
Achieve multi tenancy on one physical machine to multiple virtual ones
Assurance
Cloud services are staffed by the top people in the field.
Can afford the best and most up to date equipment.
Hardened by continuous hacking.
Cloud computing reasons to adopt it :
- shift from expenditures on datacenters to steady operational spendure
- avoid being locked by one company who can charge what they like
- increase security
- availability multiple datacenters
- performance
A/b vs Blue Green
Ab : compare between two versions , user experience comparison
Blue green switching of production with staging.