best way to handle multiple codebases interacting with same db?
Hi everyone, I’m working on a “bank” project that has two codebases, the first is an ASP.NET based API that the website front end interacts with, and the second is an Azure Functions based service worker that is used to run scheduled tasks, such as interest payments. Both use EF Core to talk to the DB
Essentially, I have the API ready to go, but it has several data validation checks when interacting with the database, such as source account has enough currency to cover the transaction etc.
I’m not sure what would be the most scalable way to replicate that code to the Azure Function, so that if I make any changes to the model used or something, how can I make sure that the function’s code stays in sync without manually copying it across?
Here’s a basic diagram of the app if that helps clear it up:
3 Replies
Usually you move common code to a shared library and both codebases reference that library.
Didn’t even think of that!
Now I just need to work out how to do that..
You can make a separate project and either publish it as nuget or have a git submodule