DavidAJohn / BookwormsLendingLibrary

Blazor Server client UI with a .NET Web API backend for an imaginary online library.
https://bookwormslibrary.azurewebsites.net
7 stars 4 forks source link

Adding a message queue/broker #20

Open DavidAJohn opened 1 year ago

DavidAJohn commented 1 year ago

As part of adding an inventory system to the application (eventually!) I'd like to have a message queue available, so that lending requests and admin changes to the inventory can be processed in a more de-coupled manner.

That would allow us to potentially set up additional things like email notifications to users when their lending request is authorised, or if the status of a book or author changes.

There are a few different options for doing this. I would prefer to use a separate third-party cloud service to do it, rather than necessitating the use of a docker container for RabbitMQ (or similar) during development.

So the options I'm considering are: AWS SQS/SNS, Azure Service Bus, or CloudAMQP.

Ideally, the initially cost would be zero (or close to it), with the ability to easily ramp up capacity if needed. All three options are effectively free up to 1 million requests a month - Service Bus costs £0.03 on the Basic tier - if you're using a simple queue without topics or a publisher/subscriber model.

The costs can differ though if you want to use topics and subscriptions. This application would probably need to use a pub/sub model. It depends on whether the features being added generate sufficient complexity to warrant using a library like MassTransit (which tends to assume use of topics and pub-sub).

Although just setting up separate queues and using the native SDKs for AWS or Azure could be good enough as well.