I'm working on a C++ code which communicates with a MySQL server. The C++ code and MySQL server has dependencies on each other. I'm using git for version control of the C++ codes, and use MySQL Workbench for managing database. Whenever I make changes on Db queries, tables or Stored Procedure's; Db and C++ code must be at the matching state. I don't know how to manage database with git. And this allows for possibility of making mistake when moving from Dev environment to Prod. What is the best practice of version controlling a distributed system like this?
How to version control a source code which communicates with database?
49 Views Asked by cinargursoy At
1
There are 1 best solutions below
Related Questions in GIT
- problem to push files on a repository git
- diff3 output in git conflict style, including mergeable hunks
- Git Not In Sync with Local Branch
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How to fix overriding the main branch in Git?
- I can't add text to "Message" in VS Code when committing to Git
- How can i redirect pull request from main branch to another branch
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?
- How can I reintroduce username an password on git using fedora?
- GIT SKIP EMPTY DIRECTORIES
- Git smudge run once per checkout or per commit?
- I can't find ~/.profile or ~/.bashrc in C:/Users/<user>/.ssh folder
- Set environment variable during push for GitHub Actions
- Android WebRTC compile
Related Questions in MYSQL-WORKBENCH
- Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
- Creating Relationship Creates Additional Columns in MySQL Workbench
- MySQL Workbench [BUG]
- Error in releasing pool connection in node project
- MySQL Workbench not showing Apply and Revert buttons while creating a table
- How I can store multilevel comments of user in MySQL dB
- MySQL Workbench gives duplicate warnings when there should not be any
- How to Revert import Schema in Mysql Work Bench
- Error 29 on mysql workbench, how to fix it?
- I want to call a my secure Rest API created in Spring boot using Javascript but its giving error
- Statement incomplete in mysql
- Load data local infile with double quotes and commas in fields
- There was an error while applying the SQL script to the database
- MYSQL won't allow me to create a table
- I am trying to connect to remote server using mysql workbench but i can't. I am using ubantu 22
Related Questions in DISTRIBUTED-SYSTEM
- How to avoid duplicates with the pull-based subscribe model?
- Micrometer & Prometheus with Java subprocesses that can't expose HTTP
- SQL connection throws error when adding DistributedSession, SessionMiddleware
- How to use NFS locks or any other mechanism to keep data in sync on multiple mountpoints
- The two data nodes return different results
- How to run an MPI program across multiple docker containers without manually ssh'ing
- How do I parallelize writing a list of Pyspark dataframes across all worker nodes?
- Does AWS use distributed systems?
- How to version control a source code which communicates with database?
- Searching for succ(p+1) in Chord systems
- How to design a long running process that can continue after an outtage?
- akka.cluster.ddata.Replicator$Internal$DeltaPropagation message from clusterReceptionist replicator is dropped because it exceeds the size limit
- In the storage-computing separation deployment mode, why does one of the three nodes have no disk space?
- Out-of-order AppendEntries in Raft
- Automatic Load Balancer with Locust 2.20.0 on Windows - High Ping and Scaling Challenges
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Both database congfigs/scripts/schemas and C++ code typically reside in different code repositories.
First step is to keep in sync both deployed code and database in sync with their corresponding repositories (but not to each other, more on this later). Typically, there are two options: manual - via some kind of SOP (standard operation procedure), or automated - have a pipeline/tool which monitors changes in those repositories and builds&tests&deploys these changes via step by step process over stages (dev/preprod/prod).
The second step is who to keep DB and the code in sync. For example, if a table is renamed, the code need to know that the name changed. The big question to answer: do we want the system to be online (operational) while we migrate the change.
If the system may be taken offline, it's good as it simplifies things. The operator or the automation would cut the usage for the system and separately update DB (schema migration) and deploy new code. The system is brought back online after.
If the system must stay available, there are two items to cover. First the database migration, that may be tricky and tools like copy-on-update may help. This is tricky and depends on the database and the nature of db change.
The second part of keeping the system operational is to have the deployed code to be working while db is being updated. When the code is deployed, it sees the older DB, and then the DB is updated while the code is already there. Basically, the code need to be written to support DB in state of both before and after change. That's approach is called backward/forward compatibility.