App Integration Flashcards
What is Event Bridge?
Event bridge uses events to connect application components
The 4 types of event sources are: AWS Services, Custom Apps, SaaS Apps, Microservices
What is Step Function?
Looks like a flow chart
Ie., can wait up to 356 days - inventory management could take ages so helps with real world interactions
or
If lambda took longer than 15 mins to run it would enter fail state because its the max length of time it should take
Can you do branches or loops within a Step Function?
Yes
Who puts messages into SQS queue
Producers
Who do producers send messages to?
Producers -> SQS -> consumer
One benefit of SQS and SNS is that
SQS decouples consumers and producers
SNS decouples publishers and subscribers
What is a Dead Letter Queue?
It could be something failed that a human looks at or something we set up to automatically
What is the idea of ‘fanout’ in SNS?
Fanout is when a message published to an SNS topic is replicated and pushed to multiple endpoints
How can you use SNS and SQS?
You could upload SNS ( a new image to process) this could fan out to 3 SQS queues and then EC2 could be processing and making EC2 thumbnails at same time lambda could be processing one of the sqs queues
Order (producer)
Chef (consumer)
What is App Sync?
App Sync is a managed Graph QL interface get or set aggregated data and display it in our apps
Used in things like social media
When should you use SNS and SQS?
If you need to make sure the message is processed
What is the difference between short polling and long polling in SQS
Short polling - client sends frequent requests ie., <1sec. SQS responds immediately even if blank.
Long polling - unless poll times out, only responds when a message arrives in queue. It can reduce costs
When would you use long polling instead of short polling in sqs?
When you have high traffic use long polling
When you can afford frequent messages use short Polling
A high resolution video is from ec2 to s3 and waits for s3 to provide data
What should you use to process videos without waiting for a response
SQS
Whst would be the best service for suggestion clothes for users based on what they have in their shopping cart?
Step Function (think of flow chart with branches and loops)
An app that processes customer orders is moving from on-premises to aws.
Order is received, processed, label created and then a confirmation email is sent to customer
What solution creates a maintainable app that completes all steps in this order and doesn’t need self managed cloud infrastructure
Create a lambda function for each task
Use a Step Function to invoke Lambda functions in order
You’re able to take info in from sources such as (AWS services, external SaaS and your own custom apps) and perform actions (filter, manage and direct) them to other systems
These systems listen and take action based on the info
What service is this
Event Bridge
Can you convert scripts to Lambda functions and schedule them with Event Bridge
Yes
Name the states of a Step Function?
CW PPT FM
choice (rule)
wait
pass
parallel
task
fail
map (iterate)
What is short polling?
Short polling is when the client sends frequent requests ie., <1sec. SQS responds immediately even if blank.
What is long polling?
Long polling - unless poll times out, only responds when a message arrives in queue. It can reduce costs
When would you use a lambda function ?
When you have a single stand alone function that responds to an event
When do you use Step Functions?
It’s usually used to help you overcome the issue that lambda has a max 15min execution time
Benefit of SQS is
it builds decoupled apps
What can you use to send an email notification when a Cloud Watch alarm is triggered?
SNS
How would you describe Step Functions?
order processing workflow
What is an event?
An event is a record of a change that has happened in the past.
The event could be in the AWS environment (ie., s3), SaaS partner service/app (ie., Zendesk) or your service/app
Example:
- EC2 instance changes state from pending to running
- Step Function finishes execution
Scheduled events
- CloudTrail publishes events when you make API calls
The event is a JSON string
What is the event bus?
The event bus is where events land once they’ve been triggered
What is the max number of rules an event bus can have associated with it?
100
What is the purpose of rules on the event bus in event bridge?
Rules allow you to filter events on the event bus
You must specify target for events to be passed on to ie., ec2 instance
In Event Bridge, are rules for the event bus processed in any particular order?
No
In Event Bridge can you send events to other accounts
Yes this is known as Cross Account Events
Name the only AWS services integrates directly with third party support ie. AuthO?
Event Bridge
What is Event Bridge Archive?
It let’s you archive events and easily replay them by sending them back to event bus it came from at a later time
Name 2 benefits of event bridge archive
disaster recovery
bug fixes
What is schema registry feature of Event Bridge
collects and stores event schema patterns
What is code bindings feature of event bridge?
checks variables are the correct type
When would you use SNS instead of Event Bridge
Use SNS for simple app and Event Bridge for more complex app
What helps you move from a monotloitihc system to something that’s more decoupled
event bridge
What is a task state
A single unit of work
What is a choice state
like if statement
What is wait state
delays for certain amount of time
What is map
Like a for loop
Can you use Event Bridge to schedule a lambda function to be invoked every 10 mins?
Yes
Can you use Event Bridge to listen for changes in patterns ie., a change to the state or AWS KMS?
Yes
What happens after you create an event.json as part of event bridge?
You can run cli command to put the event onto the event bus and you will see response to say if it worked
The event can only be associated with 1 event bus
what is a common pattern for event bridge?
Set a rule on the event bus, when it is met the event is passed as an input to a step function
Can you set a rule on an event bus to send failed messaged to a dead letter queue
yes
What is the difference between SQS and Event Bridge
Event Bridge processed 1 at a time, SQS processed in batches
Event Bridge can match multiple rules and be sent to multiple targets, SQS events not available after they have been processed
What are event bridge rules based on?
Event patterns
or
Event schedules