Score:0

Real time synchronization of databases with different data structure

co flag

I'm rewriting a legacy web application. At some point in time, I want old and new app, to work in parallel, on databases with different structure (both mysql). The troublesome part is that the databases needs to be synchronized, preferably in real time. So, if a new user is created in old app, I want him also in new one.

Have anyone struggled with similar issue? I'm thinking about some sort of middleware in between those two databases, that would 'translate' inserts and updates between schemas but maybe there is something else?

Cheers and thank you :)

ua flag
Consider adding TRIGGER(s) to one version to update data in the other version.
Score:1
us flag

I think the only reasonable option is to abstract all database operations in your application in a way that they update both databases.

The database structure is often coupled with the business logic. Therefore if you implement a separate middleware, then that middleware might need to duplicate business logic from the application.

This increases possibility to create errors, when application business logic is updated and then the middleware is not updated.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.