Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microservice architecture #10

Open
alindgren opened this issue Feb 17, 2018 · 6 comments
Open

Microservice architecture #10

alindgren opened this issue Feb 17, 2018 · 6 comments

Comments

@alindgren
Copy link
Owner

Perhaps use RabbitMQ? https://www.rabbitmq.com/

Check out https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/

@alindgren
Copy link
Owner Author

Decision: use RabbitMQ over NServiceBus so that we have the option of integrating microservices in other languages.

See if it's possible to create a layer that uses DI to optionally not use RabbitMQ. Perhaps create separate libraries that contain Mediatr handlers - one that uses RabbitMQ based microservices and another for handling the logic internally (or calls microservices synchronously).

@alindgren
Copy link
Owner Author

https://vimeo.com/183448835

Use Event Sourcing? https://eventstore.org/?

@alindgren
Copy link
Owner Author

Next step: move Requests and RequestHandlers into their own libraries.

Maybe Requests can go in Fundraise.Core, and have the existing RequestHandlers go into a new library (perhaps RequestHandlers.InProcess) with the goal of creating another library of request handlers that use RabbitMQ (perhaps RequestHandlers.RabbitMQ).

@alindgren
Copy link
Owner Author

MediatR requests and requesthandlers have been moved into their own libraries (Fundraise.Requests and Fundraise.RequestHandlers.InProcess). The "InProcess" handlers (maybe not the best name) are for the non-microservices (monolithic) version of the app. Next step is to add microservice versions of these request handlers.

Perhaps the microservice hanlders should be divided into two types: synchronous (HTTP-based) and asynchronous (utilizing RabbitMQ):

The two commonly used protocols are HTTP request/response with resource APIs (when querying most of all), and lightweight asynchronous messaging when communicating updates across multiple microservices.

from https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/communication-in-microservice-architecture

So next, create a project for handlers that use microservices (Fundraise.RequestHandlers.Microservices?). Perhaps first implement everything using synchronous communication by creating a WebAPI app. Basically move the logic in the handlers to the WebAPI and then have the handlers call those WebAPI methods. Then I can introduce RabbitMQ for updates/inserts. Queries should, I presume, should continue to use the WebAPI.

@alindgren
Copy link
Owner Author

alindgren commented Mar 21, 2018

As much as I would like to dive into microservices, I think that it makes sense to build out more of the functionality and look into using notifications with MediatR.

But maybe start small with a couple simple async microservices such as one for sending email notifications and one for logging donor events. These could be implemented while leaving the rest of the example app as a 'monolith'.

Update: Logging should probably be done within the service and aggregated using something like ELMAH https://elmah.github.io/.

Initial microservices should target integration. I think it would be easy to start with Airtable's Individual and Corporate Donations template and then do QuickBooks Online.

@alindgren
Copy link
Owner Author

alindgren commented Mar 27, 2018

https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/integration-event-based-microservice-communications

Probably should inherit from something like IntegrationEvent to create an ID and timestamp for each event object.

Each microservice should define it's own events though:

What is not recommended is sharing a common integration events library across multiple microservices; doing that would be coupling those microservices with a single event definition data library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant