Decoupling Workflows Flashcards

1
Q

What is meant by tight coupling?

A

One application (or instance) talking directly to another application (or instance).

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

What is meant by loose coupling?

A

Not having one application (or instance) talk directly to another. Instead you want highly available, scalable, managed service in between resources (like ELB)

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

What is Simple Queue Service (SQS)?

A

SQS is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems and serverless applications

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

What is Simple Notification Service (SNS)?

A

SNS is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication

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

What is API Gateway?

A

API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor and secure APIs at any scale

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

Which is preferred: tight or loose coupling?

A

Loose coupling is ALWAYS preferred. Don’t select answers that include instance-to-instance communication.

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

Where is important for applications to be loosely coupled?

A

Every layer, both internal and external

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

What is poll-based messaging?

A

A producer of messages writes a message into a queue (SQS) and a consumer can retrieve the message whenever it is ready

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

What is Simple Queue Service (SQS)?

A

Simple Queue Service is a messaging queue that allows asynchronous processing of work. One resource will write a message to an SQS queue, and then another resource will retrieve that message from SQS.

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

What is the delivery delay in SQS?

A

The queue hides messages for this period of time before making them visible. Default is 0 and maximum is 15 minutes.

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

What is the message size in SQS?

A

Messages can be up to 256KB in any format

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

What encryption is provided by default in SQS?

A

Messages are encrypting in-transit by default, but you can add at-rest

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

What is message retention setting in SQS?

A

The length of time that a message can be kept in SQSl. Default is 4 days; can be set between 1 minute and 14 days.

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

What is the difference between long and short polling in SQS?

A

Short polling checks for messages and exits if none exists, which burns extra CPU cycles. Long polling isn’t the default in SQS, but it should be (setting the connection time window).

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

What is the queue depth in SQS?

A

This is a value, not a setting. This can be a trigger for autoscaling.

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

What is the visibility timeout in SQS?

A

A lock on a message (default 30 seconds) where no other consumer can receive the message while a consumer is processing it and reaches out to say it is done.

If the message is successfully processed within the visibility timeout, the message is deleted from the queue.

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

If you are asked a question about what to look for if you are burning too much CPU (cash) with an SQS queue, what setting would you recommend looking at?

A

The connection time window (set it for long polling)

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

What is a dead letter queue in SQS?

A

An SQS queue that you can temporarily sideline messages into when they can’t be processed successfully from the main queue.

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

What is the dead letter queue setting, maximum receives, used for?

A

The maximum number of times the message can be read before it gets sidelined to the dead letter queue

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

What is an important metric to monitor on a dead letter queue in SQS?

A

Queue depth

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

Can you use dead letter queues with SNS?

A

Yes, on SNS topics

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

What type of message ordering is guaranteed with Standard SQS queues?

A

Best effort ordering

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

Is there a guarantee around not receiving duplicate messages with Standard SQS queue?

A

No

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

What type of SQS queue guarantees messages are delivered in order?

A

FIFO queue (and also guarantees no duplicates)

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

What is the guaranteed number of transactions per second processing in a Standard SQS queue vs a FIFO SQS queue?

A

Standard queue has nearly unlimited transactions per second where the FIFO queue guarantees 300 messages per second

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

What is the message deduplication Id in FIFO SQS queues?

A

A unique value that ensures that all of your messages are unique. The deduplication interval is a five minute window, where if we see the same deduplication id multiple times, it will receive the message successfully but will not pass it along to the consumer

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

If you are given a scenario where it is important that messages are processed in order, or they not be duplicates, what type of SQS queue would you recommend?

A

FIFO

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

If you are given a scenario where you must have thousands and thousands of transactions per second processing in an SQS queue, what type of queue would you recommend?

A

Standard (FIFO maxes out at 300 messages per second)

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

What is the message group id used for in FIFO queues in SQS?

A

It is the identifier that ensures that all messages with that same id are received and processed in order.

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

Which costs more, standard for FIFO queues in SQS?

A

FIFO

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

What is push-based messaging?

A

A producer of messages writes a message into a topic (SNS) and the topic delivers it to its subscribers whenever it is ready; the subscribers must be ready and waiting to receive the message

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

What services can subscribe to an SNS topic?

A

Kinesis Data Firehose, SQS, Lambda, email, HTTP(S), SMS (text), platform application endpoint

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

What is the maximum message size allowed in SNS?

A

256KB of text in any format

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

Does SNS support a Dead Letter Queue?

A

Yes, messages that fail to be delivered can be stored in an SQS DLQ

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

Does SNS offer retries of deliveries?

A

No, except for HTTP(S) option

36
Q

What are the two types of topics in SNS?

A

Standard and FIFO (only supports SQS as a subscriber)

37
Q

Is encryption offered by default for SNS?

A

Yes, messages are encrypted in-transit by default, but you can add at-rest

38
Q

Can access be restricted to an SNS topic?

A

Yes, a resource policy can be added to an SNS topic

39
Q

Can an SNS topic have multiple subscriptions?

A

Yes

40
Q

If you set up an email subscription to a topic in SNS, will it work immediately?

A

No, the email address must accept delivery before messages will be sent

41
Q

If you given a scenario relating to alerts or notifications, what service would you recommend?

A

SNS

42
Q

If you are given a scenario requiring push based notifications, what service would you recommend?

A

SNS

43
Q

If you are given a scenario about sending emails to customers or subscribers, what service would you recommend?

A

SES (based around marketing emails)

44
Q

If you are given a scenario about sending notifications from a CloudWatch alarm, what service would you recommend?

A

SNS

45
Q

What is API Gateway?

A

Amazon API Gateway is a fully managed service that allows you to easily publish, create, maintain, monitor and secure your API. It allows you to put a safe “front door” on your application.

46
Q

What are the key features of API Gateway?

A
  1. Security - allows you to easily protect your endpoints by attaching a web application firewall (WAF)
  2. Stop abuse - can easily implement DDoS protection and rate limiting to curb abuse of their endpoints
  3. Ease of use
47
Q

What are stages used for in API Gateway?

A

They are different versions of an API

48
Q

What is the main purpose of API Gateway?

A

It is useful to front applications in AWS (aka “front door”)

49
Q

If you are given an option of whether to hardcode secret access keys or use API Gateway, which would you choose?

A

API Gateway

50
Q

How can you configure an API Gateway to prevent a DDoS attack?

A

Configure a web application firewall (WAF)

51
Q

What is the AWS Batch Service?

A

An AWS service that helps you run batch computing workloads within AWS (on EC2 or ECS/Fargate)

It automatically provisions and scales workloads, making it simple to configure and maintain

No installation is required!

52
Q

What are the four main components of AWS Batch?

A
  1. Job - unit of work that is submitted to AWS batch (shell scripts, executables, Docker images, etc)
  2. Job Definitions - specify how your jobs are to be run (blueprint for resources)
  3. Job Queues - jobs get submitted to specific queues and reside there until scheduled to run in a compute environment
  4. Compute Environment - set of managed or unmanaged compute resources used to run your jobs
53
Q

What type of compute is recommended for AWS Batch?

A

Fargate (because it launches and scales better)

54
Q

When is EC2 the best choice for a compute environment in AWS Batch?

A
  1. When you need a custom AMI
  2. When you have specific vCPU requirements (anything needing more than 16 vCPUs)
  3. When you have memory requirements where you need more than 30GB of memory
  4. If you need a GPU or an Arm-Based Graviton-based CPU
  5. When you need Linux parameters
  6. For large numbers of jobs
55
Q

When would you use AWS Batch of AWS Lambda?

A
  1. AWS Lambda currently has a 15 minute timeout, so if your job takes longer, AWS Batch does not have this
  2. AWS Lambda has limited disk space
  3. AWS Lambda has limited runtimes (AWS Batch uses Docker so any runtime can be used)
56
Q

What is the difference between a managed compute environment and an unmanaged?

A

Managed

  1. AWS manages capacity and instance types
  2. Compute resource specs are defined when an environment is created
  3. ECS instances are launched into a VPC subnet
  4. Default is the most recent and approved Amazon ECS AMI
  5. You can use your own AMI, but it has to meet the requirements of an Amazon ECS optimized image
  6. You can leverage Fargate, Fargate Spot, and regular Spot instances

Unmanaged

  1. You manage your own resources entirely
  2. AMI must meet ECS AMI specs
  3. Less commonly used
  4. Great for complex or specific requirements
57
Q

If you are given a scenario about running a long-running, event driven workload, what service would you recommend (more than 15 minutes)?

A

AWS Batch

58
Q

What is the Amazon MQ Service?

A

A managed message broker allowing easier migration of existing application to the cloud

59
Q

What programming languages, operating systems and messaging protocols can be used in Amazon MQ Service?

A

A variety of programming languages, operating systems and messaging protocols can be used

60
Q

What engine types are available in Amazon MQ Service?

A

ApacheMQ and RabbitMQ engine types

61
Q

Why would you use Amazon MQ vs SNS/SQS?

A

Topics and queues are offered in both that allow for one-to-one or one-to-many messaging designs. Therefore, if creating new applications, look at SNS/SQS because they are simpler.

And if you need public accessibility, you might consider SNS/SQS because they are publicly accessible by default, and Amazon MQ requires private networking like VPC, Direct Connect or VPN.

Also, Amazon MQ has NO default AWS integrations.

But, if migrating existing applications with messaging systems in place, you might consider AmazonMQ.

62
Q

What are the different ways to configure brokers in Amazon MQ?

A
  1. Single Broker Instance - one broker lives within one availability zone, which would be perfect for a dev environment (RabbitMQ has a network load balancer in front)
  2. Highly Available Architectures - depends on the broker engine type
  3. Amazon MQ for ActiveMQ - with active/standby deployments, one instance will remain available at all times (configure a network of brokers with separate maintenance windows)
  4. Amazon MQ for RabbitMQ - has cluster deployments and they are logical groupings of three broker nodes across multiple AZs sitting behind a network load balancer
63
Q

If you are given a scenario where you must use JMS (or messaging protocols like AMQP 0-9-1, AMQP 1.0, MQTT, OpenWire or STOMP, what service would you recommend?

A

Amazon MQ

64
Q

What is AWS Step Functions?

A

It is a serverless orchestration service combining different AWS services for business applications

65
Q

What is a State Machine in AWS Step Functions?

A

A particular workflow with different event-driven steps

66
Q

What is a Task in AWS Step Functions?

A

Specific states within a workflow (state machine) representing a single unit of work

67
Q

What is a State in AWS Step Functions?

A

Every single step in a workflow (state machine) is considered a state

Leverage states to either make decisions based on input, perform certain actions or pass output

Elements within your state machines and they are referred to by a name

68
Q

What are the two different types of workflows in AWS Step Functions?

A

Standard

  1. Have an exactly once execution
  2. Can run for up to a year
  3. Useful for long-running workflows that need to have an auditable history
  4. Rates up to 2,000 executions per second
  5. Pricing is based per state-transition

Express

  1. At-least-once workflow execution
  2. Can run for up to 5 minutes
  3. Useful for high event-rate workloads (IoT data streaming and ingestion)
  4. Pricing is based on number of executions, durations and memory consumed
69
Q

What are Executions in AWS Step Functions?

A

Instances where you run your workflow in order to perform your tasks

70
Q

What language are States and State Machines defined in Amazon Step Functions?

A

Amazon States Language (similar to JSON)

71
Q

What services integrate nicely with AWS Step Functions?

A

AWS Lambda, AWS Batch, Amazon DynamoDB, Amazon ECS/AWS Fargate, Amazon SQS, Amazon SNS, Amazon API Gateway, Amazon EventBridge, AWS Step Functions, and many more

72
Q

What are the different states in AWS Step Functions

A
  1. Pass - Passes any input directly to its output- no work done
  2. Task - Single unit of work
  3. Choice - branching logic (yes/no, etc.)
  4. Wait - creates a time delay
  5. Succeed - stops execution successfully
  6. Fail - stops execution and marks them as failures
  7. Parallel - run parallel branches of executions within state machines
  8. Map - runs a set of steps based on elements of an input array
73
Q

If you are given a scenario where you need to add a wait into a workflow, what service would you recommend?

A

AWS Step Functions

74
Q

What is Amazon AppFlow?

A

Fully managed service that allows you to exchange data between SaaS apps and AWS services (Salesforce, etc.)

Allows you to pull data from third-party SaaS vendors and stores them in S3

It is bi-directional with limited combinations

75
Q

What is a Flow in Amazon AppFlow?

A

Flows transfer data between sources and destinations; a variety of SaaS applications are supported

76
Q

What is a Data Mapping in Amazon AppFlow?

A

Determines how your source data is stored within your destinations

77
Q

What are Filters in Amazon AppFlow?

A

Criteria to control which data is transferred from a source to a destination

78
Q

What is a Trigger in Amazon AppFlow?

A

How the flow is started

Supported types:
1. Run on demand
2. Run on event
3. Run on schedule

79
Q

What are use cases for using Amazon AppFlow?

A
  1. Transferring Salesforce records to Amazon Redshift
  2. Ingesting and analyzing Slack conversations in S3
  3. Migrating ZenDesk and other help desk support tickets to Snowflake
  4. Transferring aggregate data on a scheduled basis to S3 (100GB per flow)
80
Q

If you are given a scenario where an application needs to reference large amounts of SaaS data regularly, and the data needs to be accessed within S3, what service would you recommend?

A

Amazon AppFlow

81
Q

What are 4 questions to ask when answering questions regarding workloads?

A
  1. Are the workloads synchronous or asynchronous?
  2. What type of decoupling makes sense (pub/sub like SNS/SQS, or ordering of workflows like Step Functions, etc)
  3. Does the order of messages matter?
  4. What type of application load are we going to see?
82
Q

If you are given a scenario where you are seeing a large number of duplicate messages in a queue, what setting would you recommend looking at?

A

The queue visibility timeout or the developer is not deleting the message after processing

83
Q

If you are given a scenario about batch workloads needing queues, what service would you recommend?

A

AWS Batch

84
Q

If you are asked about an alternative solution to AWS Lambda due to runtime requirements or execution timeouts, what service would you recommend?

A

AWS Batch

85
Q

If you are given a scenario that requires different states or logic during workflows (e.g. condition checks, failure catches or especially wait periods), what service would you recommend?

A

AWS Step Functions