C
C#11mo ago
M B V R K

❔ What is available approaches to communicate between Microservices

Hello dear friends, Let's assume we have a project has the following Microservices (AuthMicroservice, ServiceA, ServiceB) Lets assume that AuthService responsible about authentication and it contains an entiti/table called User. In the service A and B there are some entities/tables which need the UserId of the User who is stored in AuthService, In both service A and B when a new yser created in the AuthService's DB it automatically addded to tables (Users) in Services A and B, but without all the detailed info as in AuthService's DB So what is best approach when a User created in the AuthService sent automatically to other services to store it in their tables? I'm thinking to use the functionality of a message broker like RabbitMQ. So from your experience what do you think?
11 Replies
Mayor McCheese
Mayor McCheese11mo ago
microservices.io
Microservices Pattern: Event sourcing
Use event sourcing, which persists aggregates as a sequence of domain events
Mayor McCheese
Mayor McCheese11mo ago
This is a bit different than you likely mean; but is frequently used to create such info stores.
Mayor McCheese
Mayor McCheese11mo ago
either approach can work with rabbitmq
M B V R K
M B V R K11mo ago
I already Implementing the Event-sourcing in my project It looks like that the RabbitMQ is the better way that fit any use By the way what, I want service A to fetch/get some data from service B, is the best way for this purpose to call the API of the service B?
Mayor McCheese
Mayor McCheese11mo ago
that's going to be use case dependent; I'm going to hazard, yes, but there could be other considerations.
M B V R K
M B V R K11mo ago
Hmmmm can you give me some heads of threads by sharing your experience to understand And massive thanks in advance
Mayor McCheese
Mayor McCheese11mo ago
so, in the event sourcing or event notification model http calls are fine because they aren't adding relevant latency, they're all participating in eventual consistency. In the event of a human consumer focused api, you have other potential considerations; you want the already consistent data to read from ( ideally ), so you don't add latency; layer7-http-api's are too slow to keep calling under the covers in many cases, user expectations aren't met because it takes too long.
M B V R K
M B V R K11mo ago
Alright got it Massive thanks man I appreciate
Mayor McCheese
Mayor McCheese11mo ago
I have a couple inherited api's that make numerous calls under the covers to other api's via http; in cases of high traffic, it's 4-5 seconds to return. These all need to be rewritten.
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
✅ Could not load assembly UWP [Mysql Data] (Resolved alone)Hello everyone. I reached something interesting this last hours. I can't work anymore on my project.❔ How to implement an "undo move" function in a game where I need to keep track of multiple objects?PS: I'm using Unity by the way. tldr; In my game, every time the player moves one tile, different o❔ ✅ 'Engines' does not exist in the namespace 'BenchmarkDotNet'Other than a problem, I'm not sure what I've got going on here. In the terminal, I've tried `dotnet❔ nuget doesnt work anymore. IHi, I checked the settings and it seems good. https://api.nuget.org/v3/index.json I get the follow❔ EF Core: Owned property with converter expression cannot be convertedHey guys, we're having this issue. ShoppingCart is an owned entity and Items is a List of objects,❔ Amazon SP APIAnyone have use the "papi" before? I don't usually use people's open api so I don't know how to auth❔ Concepts to know for 2year experience on C# and .Net.Hi, I have worked on winforms to create few desktop apps and created few APIs using C# and a crud we❔ Maui Alignment Within HorizontalStackLayoutSimply put, I'm currently attempting to create a kind of header/navbar for my Maui app. However, I a✅ Adding a delete function to Todo applicationI followed the avalonia tutorial for creating a todo app, but it only has ways to add items to the l✅ WPF thinks my collection has no itemsIt's a bit much to explain with full context, but the gist is: An `Action` has a `Fields` which has