C
C#11mo ago
M B V R K

❔ Event-Sourcing for a Duplicated Topic between Two MicroServices

@Architecture Hi friends, I'm working on a project using Microservices architecture, I have AuthService, ExpenseService and EventSourcererService, the last one is used as a separated service for Event-Sourcing for all other services. The AuthService is responsible about the User management, it contains a table/entity called User. In the ExpenseService I need some user's data to be stored in another table inside this service's DB called User, and this data should be the same as in the User of the AuthService. Oncourse I use the RabbitMQ as the asynchronous communication between my services. In the EventSourcererService every table/entity in every other services will event-sourced ( their events will stored in the EventSourcererService's DB). Now the duplicated topic here is the User in the AuthService which the original, and the User in the ExpenseService. The Issue: I'm a bit confusing about should I continue with the same flow/method ( every table in every service should have its equivalent events table in the EventSourcererService including the booth users tables in both services) OR create only the event-sources table for only the User of the AuthService OR is there another good approach ? Please I need an experience share from you and massive thanks in advance <3
7 Replies
mtreit
mtreit11mo ago
I would have all of the services share a single database.
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.
M B V R K
M B V R K11mo ago
Sorry for the late, could you please provide a brief reason ?
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.
mtreit
mtreit11mo ago
It's simple, easy to implement and removes entire classes of engineering problems such as how to ensure multiple databases stay in sync. It's also a time-tested design that has been the normal approach for 30+ years. I think a more relevant question would be: what possible benefit does having multiple databases bestow, other than making everything harder? There are times for multiple databases: geo-replication being one, sharding due to extreme scale being another. In general, though, I don't know why you would want to go down that route.
M B V R K
M B V R K11mo ago
First of I really appreciate your time and answer, To be clear I go down to that route ( multiple databases ) because this is a project that I want to add into my portfolio as one of advanced projects I worked on, so the new adventure for me that I never worked on before is Microservices with isolated/multiple databases also an isolated Microservice for Event-sourcing is one of the approaches that I never worked on before. Hope you understand and if you have any suggestions or recommendations please feel free and share your experience with me Massive thanks in advance
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
✅ .EXE works in release but not publish?Hi, I have a WPF application, and I have made some stuff with the notification area (system tray), IRead file C#Without the Console.ReadLine(); the console closes immediately, So how can I get the code to read th❔ ✅ Can anyone solve this ?“InitializeComponent()“ dose not exist in the current context .Can anyone solve this ? “InitializeComponent()“ dose not exist in the current context .❔ Quality and free project planning toolsAre there any tools you could recommend for creating and managing use cases, process diagrams, etc? ✅ P/Invoke, changing values in a struct overwrites overwrites other valuesHeyo! I'm working on a P/Invoke library for libMPV and it has a way to send it structured data inste❔ OmniSharp is BrokeyI updated the C# extension on VS Code and it told me I needed to update my C# to get OnmiSharp to wo❔ Entity Framework, How To Join Second Table To Third Table In The First Table?Hi i want to join table city to area like picture below, but i got an error like this ```js System.✅ XML deserialization problemCan anyone please help me sleep again.... 🙂 When deserializing the following XML to the respective ❔ ✅ creating an update feature in my applicationhttps://github.com/mekasu0124/Todo I've created a todo application. I want to incorporate a feature❔ Unsafe Reading different types of structs from a byte arrayI'm currently using the `Unsafe` class to help me read (and also write) different types of structs i