Search code examples
amazon-web-servicesazureamazon-s3cloudservicebus

Single codebase for applications that target AWS as well as Azure for pass services such as service bus, blob, SQS/SNS etc


I am having multiple applications which are deployed in Microsoft Azure. These applications are using various libraries from Microsoft for interacting with services such as Azure Servicebus (Topic & Queue), Blob, etc. There is a new requirement that these applications should run on AWS as well on Azure. Since service bus, blob are very specific to Azure. They are not available in AWS. AWS has equivalent services such as SNS/SQS, S3 bucket etc. AWS has different SDK's/libraries for interacting with there services.

This is a problem since I will have to maintain two different versions of the applications one for Azure and another for AWS. This is difficult to maintain and I want to avoid.

Is there any framework/pattern/approach which abstracts vendor-specific details to service bus or blob and work both with AWS & Azure using a single code base


Solution

  • There are 2-3 ways if you want to target Azure, Aws or any other cloud using a single code base

    1. Libraries such as Simple.Bus targets Azure Service bus and RabbitMQ. But they are limited to message brokers. For storage, you may need to find another library that targets both environments.
    2. More appropriate solution is Dapr (Distributed application portable runtime) which not only facilitates microservice service-based development but also helpful in developing cloud-agnostic code. It has various building blocks such as State management and Pubish and Subscribe which can target Azure, AWS using a single code base. By replacing an appropriate component, You can switch from one cloud to another cloud without code change.
    3. If none of the above solution is not working for you for some reason, you may need to implement your own facade layer to target multiple clouds.