1. Differentiate between on-demand instances and spot instances.
Spot Instances are spare unused Elastic Compute Cloud (EC2) instances that one can bid for. Once the bid exceeds the existing spot price (which changes in real-time based on demand and supply), the spot instance will be launched. If the spot price exceeds the bid price, the instance can go away anytime and terminate within 2 minutes of notice. The best way to decide on the optimal bid price for a spot instance is to check the price history of the last 90 days available on the AWS console. The advantage of spot instances is that they are cost-effective, and the drawback is that they can be terminated anytime. Spot instances are ideal to use when –
- There are optional nice-to-have tasks.
- You have flexible workloads that can run when there is enough computing capacity.
- Tasks that require extra computing capacity to improve performance.
On-demand instances are made available whenever you require them, and you need to pay for the time you use them hourly. These instances can be released when they are no longer required and do not require any upfront commitment. The availability of these instances is guaranteed by AWS, unlike spot instances.
The best practice is to launch a couple of on-demand instances which can maintain a minimum level of guaranteed compute resources for the application and add on a few spot instances whenever there is an opportunity.
2. Define and explain the three basic types of cloud services and the AWS products that are built based on them?
The three basic types of cloud services are:
- Computing
- Storage
- Networking
Here are some of the AWS products that are built based on the three cloud service types:
Computing – These include EC2, Elastic Beanstalk, Lambda, Auto-Scaling, and Lightsat.
Storage – These include S3, Glacier, Elastic Block Storage, Elastic File System.
Networking – These include VPC, Amazon CloudFront, Route53
3. What is the relation between the Availability Zone and Region?
AWS regions are separate geographical areas, like the US-West 1 (North California) and Asia South (Mumbai). On the other hand, availability zones are the areas that are present inside the regions. These are generally isolated zones that can replicate themselves whenever required.
4. What is the boot time for an instance store-backed instance?
The boot time for an Amazon Instance Store -Backed AMI is usually less than 5 minutes.
5. Is it possible to vertically scale on an Amazon Instance? If yes, how?
Following are the steps to scale an Amazon Instance vertically –
- Spin up a larger Amazon instance than the existing one.
- Pause the existing instance to remove the root ebs volume from the server and discard.
- Stop the live running instance and detach its root volume.
- Make a note of the unique device ID and attach that root volume to the new server.
- Start the instance again.
6. Differentiate between vertical and horizontal scaling in AWS.
The main difference between vertical and horizontal scaling is how you add compute resources to your infrastructure. In vertical scaling, more power is added to the existing machine. In contrast, in horizontal scaling, additional resources are added to the system with the addition of more machines into the network so that the workload and processing are shared among multiple devices. The best way to understand the difference is to imagine retiring your Toyota and buying a Ferrari because you need more horsepower. This is vertical scaling. Another way to get that added horsepower is not to ditch the Toyota for the Ferrari but buy another car. This can be related to horizontal scaling, where you drive several cars simultaneously.
When the users are up to 100, an Amazon EC2 instance alone is enough to run the entire web application or the database until the traffic ramps up. Under such circumstances, when the traffic ramps up, it is better to scale vertically by increasing the capacity of the EC2 instance to meet the increasing demands of the application. AWS supports instances up to 128 virtual cores or 488 GB RAM.
When the users for your application grow up to 1000 or more, vertical cannot handle requests, and there is a need for horizontal scaling, which is achieved through a distributed file system, clustering, and load balancing.
7. What is the total number of buckets that can be created in AWS by default?
100 buckets can be created in each of the AWS accounts. If additional buckets are required, increase the bucket limit by submitting a service limit increase.
8. What is auto-scaling?
Auto- scaling is a function that allows you to provision and launch new instances whenever there is a demand. It allows you to automatically increase or decrease resource capacity in relation to the demand.
9. What is geo-targeting in CloudFront?
Geo-Targeting is a concept where businesses can show personalized content to their audience based on their geographic location without changing the URL. This helps you create customized content for the audience of a specific geographical area, keeping their needs in the forefront.
10. What are the steps involved in a CloudFormation Solution?
Here are the steps involved in a CloudFormation solution:
- Create or use an existing CloudFormation template using JSON or YAML format.
- Save the code in an S3 bucket, which serves as a repository for the code.
- Use AWS CloudFormation to call the bucket and create a stack on your template.Â
- CloudFormation reads the file and understands the services that are called, their order, the relationship between the services, and provisions the services one after the other.
12. What are the important features of a classic load balancer in Amazon Elastic Compute Cloud (EC2)?
- The high availability feature ensures that the traffic is distributed among Amazon EC2 instances in single or multiple availability zones. This ensures a high scale of availability for incoming traffic.
- Classic load balancers can decide whether to route the traffic based on the health check’s results.
- You can implement secure load balancing within a network by creating security groups in a VPC.
- Classic load balancer supports sticky sessions, which ensures a user’s traffic is always routed to the same instance for a seamless experience.
13. How do you upgrade or downgrade a system with near-zero downtime?
You can upgrade or downgrade a system with near-zero downtime using the following steps of migration:
- Open EC2 console
- Choose Operating System AMI
- Launch an instance with the new instance type
- Install all the updates
- Install applications
- Test the instance to see if it’s working
- If working, deploy the new instance and replace the older instance
- Once it’s deployed, you can upgrade or downgrade the system with near-zero downtime.
14. What are the tools and techniques that you can use in AWS to identify if you are paying more than you should be, and how to correct it?
You can know that you are paying the correct amount for the resources that you are using by employing the following resources:
- Check the Top Services Table
It is a dashboard in the cost management console that shows you the top five most used services. This will let you know how much money you are spending on the resources in question. - Cost Explorer
There are cost explorer services available that will help you to view and analyze your usage costs for the last 13 months. You can also get a cost forecast for the upcoming three months. - AWS Budgets
This allows you to plan a budget for the services. Also, it will enable you to check if the current plan meets your budget and the details of how you use the services. - Cost Allocation Tags
This helps in identifying the resource that has cost more in a particular month. It lets you organize your resources and cost allocation tags to keep track of your AWS costs.
15. What parameters will you consider when choosing the availability zone?
Performance, pricing, latency, and response time are factors to consider when selecting the availability zone.
16. Which instance will you use for deploying a 4-node Hadoop cluster in AWS?
We can use a c4.8x large instance or i2.large for this, but using a c4.8x will require a better configuration on the PC.
17. How will you bind the user session with a specific instance in ELB (Elastic Load Balancer)?
This can be achieved by enabling Sticky Session.
18. What are the possible connection issues you encounter when connecting to an Amazon EC2 instance?
- Unprotected private key file
- Server refused key
- Connection timed out
- No supported authentication method available
- Host key not found, permission denied.
- User key not recognized by the server, permission denied.
19. Can you run multiple websites on an Amazon EC2 server using a single IP address?
More than one elastic IP is required to run multiple websites on Amazon EC2.
20. What happens when you reboot an Amazon EC2 instance?
Rebooting an instance is just similar to rebooting a PC. You do not return to the image’s original state. However, the hard disk contents are the same as before the reboot.