- Newest
- Most votes
- Most comments
Hi rePost-User-9416263,
Could you please confirm if I understand the problem statement correctly ? I took an example of the retrieve customer information flow, for better understanding of the scenario.
Scenario :
- There is a LEGACY APPLICATION deployed on one EC2 instance with a dedicated LEGACY CUSTOMER DATABASE.
- There is a MODERNZED NEW APPLICATION on another EC2 instance with a dedicated MIGRATED CUSTOMER DATABASE.
- Each of these EC2 instances are behind AWS Application Load Balancer (ALB).
- Consumer applications makes call to AWS ALB to retrieve customer information based on the customer number.
- If the customer number exists in the MIGRATED CUSTOMER DATABASE, then ALB should route the call to MODERNZED NEW APPLICATION.
- If the customer number exists in LEGACY CUSTOMER DATABASE, ALB should route the call to LEGACY APPLICATION.
Problem Statement:
- The information about legacy/migrated customer numbers is in the respective databases of the legacy / modernized applications.
- How will ALB know, if the customer number is migrated or not ?
- How will ALB decide, whether to route the call to new modernized application OR to old legacy application.
Regards, Prince Arora
Hi prince thanks for your reply.
box A and Box B are ec2s in ourside we have full control over them. Both A and B has seperate applications with its own dbs. Both boxes should expected to do calls with third-party legacy endpoint via (webhooks/websocket /rest). This third party endpoint is hosted by different company don't know anything about it's hosting environment or we don't have any access to that third party API. We just could call it via dedicated IP address or it could call us via webhooks That's about it
Problem we face is when we receive a response from third party API how do we send it to Box A or Box B. Only way we could think of is storing body data of the request in DB and when response comes back checking to understand where response should go. But how do we redirect reroute responses, how do we check this response against db on the fly is what we are trying to figure out
Hi,
The third party application is a rest API call. Isn't it a synchronous API ? If the 3rd party rest api call is triggered from Box A the response will be received by box A, if its a sync API. similarly if it is initiated from Box B, the response will be back to box B. Am I missing something ?
It has three types rest API, webhooks and websockets. So like you said if it's REST it's all good as the calls are synchronised but if it's webhook where third party calling with data we don't know how to redirect to the relevant box. It could be something to do with data that should go to A or Box B. That case we need to find by querying db where should this go
Without further detail, I would suggest you take a look at EventBridge and StepFunctions to see what fits best.
With StepFunctions you can create a workflow that helps you manage calls to third parties and receive calls or responses and route it as needed. In Serverless Land you can find workflow examples that can accelerate you.
With EventBridge, you can think with Event-Driven in mind and create rules to route events as desired.
Perhaps you would need to persist some information about calls to use for routing as responses are received, DynamoDB might be good for this.
Both approaches are different and sometimes they are better together.
Relevant content
- asked 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
So a webhook event will be an asynchronous response from the third party. Below can be a possible solution for this asynchronous communication:
While sending the request from Box (A or B) to 3rd party
When the response is received from the 3rd party application to AWS ALB:
For all incoming events from external party:
Hope this helps.
Cheers! Prince Arora