Question : You have developed Docker container and want to run application using this container with the pre-defined EC instance types, EBS volumes and ELB . However, you want to have fine grain control over the container you have created while deploying your application using Docker container. Which of the following service would be more suitable for given requirement?
1. Elastic Beanstalk
2. Amazon Cloudwatch
3. AWS Cloud Formation
4. Amazon Container Service
Correct Answer : 4 Explanation: You should prefer using Elastic Beanstalk even if you are using Container until and unless you need fine-grain control for custom application architecture.
Elastic Beanstalk is an application management platform that helps you to easily deploy and scale web application and services. If you use Elastic Beanstalk you will focus on writing code only, and all other headache like EC2, RDS, ELB, Auto Scaling and Cloudwatch, application deployment and application health monitoring etc. will be taken care by AWS Elastic Beanstalk.
If you have created container then you can specify the container image which needs to be deployed, CPU and memory requirement, posts mapping and container links that's all.
Elastic Beanstalk will handle all the details such as provisioning an Amazon ECS cluster, load balancing, auto-scaling, monitoring, and placing your containers across your cluster. Hence, we can say that Elastic Beanstalk is an ideal if you want to leverage the benefits of containers but just want the simplicity of deploying the applications from development to production by uploading container image.
Question : You have developed a mobile based gaming applications, where various users can participate and maintain their score. You wanted to show top scorer on a particular game, as your application is very popular and top 1000 scorers are keep changing (It's a leaderboard), however there are in total more than a million users who play this game on regular basis. Which of the following is most suitable data storage which can give result as fast as needed?
1. Amazon ElastiCache using Memcache protocol
2. Amazon ElastiCache using Redis protocol
3. Amazon DynamoDB having index on user id and score together
4. Maintaining data in MySQL RDS and creating primary index on user id and secondary index on score
5. You will use Lambda function which will sort user score in every minute which will be stored in a text file
Correct Answer : 2 Explanation: What is the latent requirement in this question?
- Fast retrieval of score - Always retrieve this score in sorted order - Score is regularly updated - Millions of users, with the scores
This all require good caching solution. Now in the given question only first two option represent caching (In memory data) solution. Now you need to find which one is more suitable for given requirement Memcache or Redis.
Memcache is just a Key-value store but Redis provide other data structure as well for caching like Queue, Sorted List other than key-value. Hence, you will be using Redis for given requirement as soon as new score will be added in the list it will be sorted automatically and you don't have to worry about sorting the data.
However, Redis is not an AWS feature. It is an open source caching solution, which you can use with AWS services. This is a managed service from AWS and you don't have to worry about the Node failure in ElastiCache cluster.
Other option can solve this problem but not easy to implement and complicated algorithms and solutions are needed.
Question : You have created Docker Image for your application and leverage the AWS ECR (Elastic container Registry). You created a private subnet and wanted to launch instance based on Docker images you created and registered with the ECR. But you are not able to access that Docker image?
1. You don't have proper IAM role to access this Docker image.
2. You don't have connectivity via internet between your VPC and ECR
3. Your Docker image could be corrupted
4. Datacenter where your Docker image is stored in ECR is down while you are trying to use it.
Correct Answer : 2 Explanation: This kind of questions are easy, but as soon as you see the available option, you will get confused and finding the most accurate option is challenging. If this would have given to select more than one option than first 3 option can be possible cause. However, we need to select only one most correct option. So you need to focus on the term used on question like
- Docker Image - Elastic Container Registry - Private Subnet - Not able to use Docker Image
Here, most important hint is Private subnet, private subnet means no direct internet connection. If you want to access the image stored in ECR (which is based on AWS S3) needs internet connection. If you still want to use private subnet than you must have Amazon VPC NAT Gateway so that Docker image can be downloaded.