Other AWS Services (ACG) Flashcards

1
Q

What is Amazon SQS?

A

A distributed message queue service which can be used to store messages while waiting for an app or a computer to process them.

Think of SQS as a way of assigning tasks for an app to complete.

Allows us to decouple the components of an app so that they are independent.

AKA Decoupling Your Infrastructure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Is SQS a pull-based or push-based service?

A

Pull-based service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What AWS service is a push-based service?

A

Amazon SNS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which AWS service is a pull-based service?

A

Amazon SQS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is visibility timeout?

A

When an app pulls a message from SQS, the message turns invisible so no other servers can process the same message. The visibility timeout is the amount of time the app server gets to process the message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How large can SQS messages be?

A

Messages can be up to 256KB in size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What format are SQS messages?

A

Messages are always text data, including XML, JSON, and unformatted plain text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SQS messages are processed only once. True or False?

A

FALSE

Messages will be processed at least once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How long are messages kept in the queue?

A

Messages can be kept in the queue from one minute to 14 days. The default retention period is 4 days.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the two types of queue?

A

Standard Queues (best-effort ordering) and FIFO (ordering is strictly preserved)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the limit for FIFO queues?

A

300 TPS (transactions per second)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the default visibility timeout and max limit?

A

30 seconds default, maximum 12 hours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you save money and avoid empty responses with SQS?

A

Configure long polling (always go for long polling on exam)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the disadvantages of using short polling?

A

A response is returned immediately even if no messages are in the queue. You will accrue a cost per response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When should you use a Delay Queue?

A

For large distributed applications. When you need to delay or postpone messages in SQS. You might want to introduce a delay of a few seconds in order to allow for updates to a database before sending out notifications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is best practice for managing large SQS messages over 256KB?

A

Use an S3 bucket to store the messages 256KB up to 2GB.

Use Amazon SQS Extended Client Library for Java to manage them.

You’ll also need AWS SDK for Java to utilize the S3 API.

*You can’t use the CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the range of the delay period for messages in the Delay Queue?

A

0 - 900s

Messages in the Delay Queue remain invisible for the duration of the delay period (0 - 900s).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Describe SNS in 3 bullet points at a high-level.

A
  1. Messaging service.
  2. SNS is push-based.
  3. Think push notifications.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Describe SQS in 3 bullet points at a high-level.

A
  1. Messaging service.
  2. SQS is pull-based.
  3. Think polling the queue for messages.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What formats does SNS support?

A
  • SMS text message
  • Email
  • SQS queues
  • Any HTTP endpoint
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What model does SNS use?

A

Pub-sub model whereby users subscribe to topics. Push mechanism, rather than a pull/poll mechanism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is Amazon SES?

A

Amazon Simple Email Service (SES)
Scalable and highly available email using a pay-as-you-go model delivered to an S3 bucket. Incoming emails can be used to trigger Lambda functions and SNS notifications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

SES Use Cases

A

Automated Emails

Online purchase/shipping/order status confirmations

Marketing Emails

All you need to know is the email address to start sending messages (not subscription based)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Fanout?

A

SNS can fanout messages to a large number of recipients, e.g. to multiple SQS queues, HTTP endpoints, and email addresses simultaneously).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is Amazon Kinesis?

A

Kinesis is a family of services that’s all about analyzing streaming data in real-time.

Such as, financial transactions, stock prices, game data, social media feeds, location tracking data, IoT sensors, log files, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What are the four core services in Kinesis?

A
  1. Kinesis Data Streams
  2. Kinesis Video Streams
  3. Kinesis Data Firehose (capture/transform/load data streams into AWS data stores for near-real-time analytics with BI tools)
  4. Kinesis Data Analytics (analyze/query/transform streamed data in real-time using SQL then store the results in AWS data stores like S3, Redshift or Elasticsearch)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

As the number of shards increases in a Kinesis data stream, what should drive the quantity of consumer instances?

A

CPU utilization on your EC2 instances.

28
Q

What creates a record processor for each shard that is being consumed by your instance?

A

Kinesis Client Library running on your consumers is doing all the work of managing the number of record processors.

29
Q

If you increase the number of shards, the Kinesis Client Library (KCL) will add more record processors on your consumers. True or False?

A

TRUE

30
Q

What is best practice for scaling your consumers?

A

Use an Auto Scaling group and base scaling decisions on CPU load on your consumers.

31
Q

What is Elastic Beanstalk?

A

Allows you to deploy and scale your web apps onto widely used app server platforms without having to provision/manage EC2 instances. You focus on writing code, not servers.

32
Q

What programming languages does Elastic Beanstalk support?

A

Popular programming languages such as Java, PHP, Python, Ruby, Go, .NET, Node.js.

33
Q

What managed platforms does Elastic Beanstalk support?

A

Apache Tomcat, Docker.

34
Q

What AWS Resources does Elastic Beanstalk automatically provision for you?

A

EC2, RDS, S3, Elastic Load Balancers (ELB), Auto Scaling Groups, etc.

35
Q

With Elastic Beanstalk, you can take full admin control of the EC2 instances. True or False?

A

TRUE

Elastic Beanstalk can fully manage the EC2 instances for you, or you can take full admin control.

36
Q

When should you use an All at Once Deployment?

A

Test/Dev environments. It requires a total outage to deploy a new version of your app code to all your instances. Same outage occurs during rollback.

37
Q

When should you use a Rolling Deployment?

A

Deploys the new version in batches with no outage, but degrades performance. Good option for like a local library website, not an e-commerce site.

38
Q

When should you use a Rolling Deployment w/ Additional Batch?

A

Launches an addtl batch of instances then deploys in batches. Does not degrade performance, but rolling back takes time. Ideal for most apps, but not ideal for mission critical apps required 24/7.

39
Q

When should you use an Immutable Deployment?

A

Maintains full capacity with new instances. To roll back, delete the new instances. Preferred option for mission critical production systems.

40
Q

When should you use a Traffic Splitting Deployment?

A

Performs an immutable deployment and splits the traffic between the old and new deployment, enabling Canary Testing.

41
Q

How do you customize your Elastic Beanstalk environment for Amazon Linux 1?

A

Use the .ebextensions folder in the top level of your app source code bundle.

Files must have a .config extension, e.g. myhealthcheckurl.config.

42
Q

How can you customize your Elastic Beanstalk environment for Amazon Linux 2?

A

Create a Buildfile in the root directory of your app source for commands that exit upon completion, e.g. shell scripts.

Create a Procfile for long-running processes, e.g. commands to start your app.

Use Platform Hooks for custom scripts or executables that run at various stages when EC2 instances are provisioned, like so:

.platform/hooks/prebuild
.platform/hooks/predeploy
.platform/hooks/postdeploy

43
Q

What happens to your RDS within Elastic Beanstalk when you terminate the environment?

A

The database will also be terminated. This ideal for dev/test environments, not prod. Launch RDS outside of your Elastic Beanstalk environment for prod.

44
Q

How do you connect Elastic Beanstalk to an outside database?

A
  1. An addtl security group must be added to your environment’s Auto Scaling Group
  2. You’ll need to provide connection string info to your app servers using Elastic Beanstalk environment properties
45
Q

What is the Windows Web Application Migration Assistant for Elastic Beanstalk?

A

Formerly named the .NET Migration Assistant.

Open-source, interactive, PowerShell utility that migrates .NET aps from on-prem Windows servers to Elastic Beanstalk.

46
Q

What are Kinesis Shards?

A

Kinesis streams are made up of shards.

Each shard is a sequence of one or more data records and provides a fixed unit of capacity.

The data capacity of the stream is determined by the number of shards.

47
Q

What is the default visibility timeout for a message in an SQS queue?

A

30 seconds

48
Q

What are three ways that you can customize your Elastic Beanstalk Amazon Linux 2 environment?

A

ProcFile
BuildFile
Platform Hooks

49
Q

You can use SNS in conjunction with SQS to fan a single message out to multiple SQS queues. True or False?

A

TRUE

50
Q

You run a video-hosting website with two types of members: premium, fee-paying members; and free members. Each video that is uploaded is processed by a fleet of EC2 instances, which poll an SQS queue as videos are uploaded. However, you need to ensure that the videos uploaded by your premium, fee-paying members have a higher priority than those of your free members. How might you work with SQS to ensure priority treatment of the premium members’ videos?

A

Create two SQS queues — one for premium members, and one for free members. Program your EC2 fleet to poll the premium queue first and, if empty, to then poll your free members SQS queue.

51
Q

True or False. Elastic Beanstalk charges you both for the resources you deploy and a separate cost for deploying them.

A

FALSE

Elastic Beanstalk is free to use, just like CloudFormation. You only pay for the resources which are deployed as part of it

52
Q

You can subscribe endpoints that vary by protocol (http, email, sms, etc.) to an Amazon SNS topic. True or False?

A

TRUE

53
Q

What is used to capture and store streaming video and data for real-time processing and analysis?

A

Kinesis Streams is used to capture and store streaming video and data for real-time processing and analysis. Consumer applications process and analyze the data in real-time.

54
Q

A FIFO SQS message can be delivered multiple times. True or False?

A

FALSE

‘Unlike standard queues, FIFO queues don’t introduce duplicate messages’

55
Q

Your application is running on EC2 and consuming click stream data from a Kinesis stream, using the Kinesis Client Library. You have recently increased the number of shards in your Kinesis stream. When should you consider increasing the number of EC2 instances consuming the stream?

A

You should base scaling decisions on appropriate metrics for your application, like CPU utilization.

56
Q

You have a list of email addresses to which you need to push emails on a periodic basis. To which Amazon SNS resource can you subscribe the emails?

A

A topic

57
Q

Your EC2 instances download jobs from an SQS queue. However, they are taking too long to process the messages. What API call can you use to extend the length of time to process the jobs?

A

ChangeMessageVisibility

58
Q

You have a fleet of EC2 instances that are constantly polling empty SQS queues, burning CPU cycles and costing your company money. What should you do?

A

Enable SQS Long Polling.

59
Q

You have been asked to suggest a solution for storing large SQS messages. What is the most suitable?

A

S3

You can use Amazon S3 and the Amazon SQS Extended Client Library for Java to manage Amazon SQS messages. This is especially useful for storing and consuming messages up to 2 GB in size. Unless your application requires repeatedly creating queues and leaving them inactive or storing large amounts of data in your queue, consider using Amazon S3 for storing your data. This cannot be done natively with any of the other listed services.

60
Q

What is the Windows Web Application Migration Assistant for Elastic Beanstalk used for?

A

Migrating .NET applications from Windows servers to AWS Elastic Beanstalk

The Windows Web Application Migration Assistant for Elastic Beanstalk is a PowerShell utility that migrates .NET applications from Windows servers to AWS Elastic Beanstalk.

61
Q

Which of the following can be used to migrate .NET applications from Windows servers to AWS Elastic Beanstalk?

A

Windows Web Application Migration Assistant for Elastic Beanstalk

The Windows Web Application Migration Assistant for Elastic Beanstalk is an open-source PowerShell utility that migrates .NET applications from Windows servers to AWS Elastic Beanstalk. It was formerly named the .NET Migration Assistant.

62
Q

Elastic Beanstalk is object-based storage. True or False?

A

FALSE

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

63
Q

Which Amazon service can you use in conjunction with SQS to “fan out” SQS messages to multiple queues?

A

SNS

Amazon SNS provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications. It can be used with SQS to fan out messages to multiple queues.

64
Q

How large can an SQS message be, without referencing to a message payload in Amazon S3?

A

256KB

Amazon SQS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text. If you want to send messages larger than 256 KB, you need to use the Amazon SQS Extended Client Library for Java. This library lets you send an Amazon SQS message that contains a reference to a message payload in Amazon S3 that can be as large as 2 GB.

65
Q

Which is generally preferred: SQS long polling or SQS short polling?

A

SQS Long Polling

Long polling is preferred reduces the number of empty ReceiveMessageResponse returned which leads to lower cost and higher performance in most cases.

66
Q

SNS is pull-based rather than push-based. True or False?

A

FALSE

Correct. Amazon SNS offers instantaneous, push-based delivery (no polling).

67
Q

What is the maximum visibility timeout of an SQS message in a queue?

A

12 hours

While a message is being processed it is hidden from other Workers. This can be set or reset to a maximum of 12 hours