0% found this document useful (0 votes)
5 views

Backend For Frontend Using Api Gateway Ra

The document describes an architecture for frontend applications to load and refresh user interface data from backend services using a backend for frontend (BFF) pattern with AWS services. The BFF pattern involves using API Gateway and Lambda functions to fetch and update projections of data from microservices in DynamoDB and send real-time notifications via websockets when data changes.

Uploaded by

abhishek.singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Backend For Frontend Using Api Gateway Ra

The document describes an architecture for frontend applications to load and refresh user interface data from backend services using a backend for frontend (BFF) pattern with AWS services. The BFF pattern involves using API Gateway and Lambda functions to fetch and update projections of data from microservices in DynamoDB and send real-time notifications via websockets when data changes.

Uploaded by

abhishek.singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Catch the events from your application

Backend for frontend using API Gateway 1


with purpose-built BFF event consumers.
These are responsible for updating
Improve customer experience on your User Interfaces (UI) by providing real-time visual updates when your microservices denormalized data projections in Amazon
raise events about mutations in domain aggregates. This architecture describes how frontend client applications can apply DynamoDB for frontend consumption.
the Backend for Frontend (BFF) pattern to load UI-ready data projections and refresh the UI with event-driven notifications. On UI load, frontend clients authenticate
2 with Amazon Cognito, then query the
AWS Cloud data by invoking the BFF API built with
Amazon API Gateway. The data is then
AWS Lambda projection microservice fetched in DynamoDB, either directly by
BFF API Gateway or via a BFF query handler
query handler on UI load updates events built with AWS Lambda.
authenticate pre UI load pre UI load
2 1 1 Frontend clients subscribe for any
3 subsequent data changes by connecting
Amazon Cognito Amazon to a BFF WebSocket endpoint provided
authorization 2 by API Gateway, which triggers the
DynamoDB update of the “connected clients” table.
Amazon API 2 projection microservice
2 Continue to consume and process all
Gateway updates events 4 relevant events from your application
initial query alternative projection tables
4 4 using the BFF event consumers. These
on UI load REST or direct query X X
consumers continuously update the
HTTP proxy denormalized frontend data view in the
BFF database in real time.
event-driven stream BFF event microservice
notifications handler Subscribe to all events resulting from
7 5 consumers event 5 data changes in the BFF database using
sources
6 Amazon DynamoDB Streams, then
change register a trigger in AWS Lambda to
notifications WebSockets query change asynchronously invoke a BFF stream-
Users endpoint stream handler Lambda function when it
connection detects new stream records.
connect to handler clients table
3 WebSocket update Your BFF stream handler then pushes
6 notifications to clients connected to API
Gateway’s WebSockets.
When the change notification from API
7 Gateway is received by the frontend
Reviewed for technical accuracy April 27, 2022
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Reference Architecture clients, they can refresh the UI content.

You might also like