Skip to content

Best practice integration between to external services

0

I am building a integration between to external services.

In short service A triggers a webhook when an item is updated, I am formatting the data and sending it to service Bs api.

There is a few of these flows for different types of items and some triggers by service A and some by service B.

What is the best way to build this? I have thought about using hono.js deployed to lambda or just using AWS SDK without a framework. Had someone mentioning Step Functons, but doesn’t exactly know how that would benefit the case.

Any thoughts or best practices? Is there a different way you would recommend to do this?

1 Answer
1

For integrating two external services as you've described, there are several approaches you can consider, each with its own benefits. Here's an overview of some best practices and recommendations:

  1. AWS Lambda with API Gateway: This is a popular and flexible approach. You can use Lambda functions to handle the webhooks from Service A, process the data, and then make API calls to Service B. API Gateway can be used to expose endpoints for the webhooks. This serverless approach is cost-effective and scales automatically.

  2. AWS Step Functions: While Step Functions can be beneficial for complex workflows, it might be overkill for simple integrations. However, if your integration involves multiple steps, error handling, or conditional logic, Step Functions could be valuable. It allows you to visually design and manage the flow of your integration, making it easier to understand and maintain complex processes.

  3. Amazon EventBridge: This is an excellent choice for event-driven architectures. You can use EventBridge to receive webhooks from Service A, then trigger Lambda functions or other AWS services to process the data and send it to Service B. EventBridge is particularly useful if you have multiple types of events that need different handling.

  4. AWS AppFlow: If Service A and Service B are popular SaaS applications, AWS AppFlow might be a good fit. It's a fully managed integration service that enables you to securely transfer data between SaaS applications and AWS services.

  5. Custom solution with AWS SDK: Building a custom solution using the AWS SDK (with or without a framework like Hono.js) gives you the most flexibility. This approach is good if you have very specific requirements or if you're more comfortable with direct control over your code.

Best practices to consider:

  1. Use asynchronous processing where possible to handle high volumes of data.
  2. Implement proper error handling and retries.
  3. Use AWS CloudWatch for monitoring and logging.
  4. Ensure secure handling of any sensitive data.
  5. Consider using Amazon SQS or SNS for decoupling if needed.

The best choice depends on your specific requirements, the complexity of your integration, and your team's expertise. If your integration is relatively straightforward, a Lambda function with API Gateway might be the simplest and most cost-effective solution. If you need more complex orchestration, consider Step Functions. For a purely event-driven approach, EventBridge could be ideal.
Sources
Community | The essential guide to application integration on AWS
Integrating services with Step Functions - AWS Step Functions
Community | Understanding Integration Patterns in Event-Driven Architecture
Best AWS service to pull data from external api | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.