8000 GitHub - ThaminduDisnaZ/cloud-local-db-sync
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ThaminduDisnaZ/cloud-local-db-sync

Folders and files

NameName
Last commit message
Last commit date 8000

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Environment Variables:

Set environment variables in your development environment or use a .env file and load it using a library like dotenv-java. The environment variables are: LOCAL_DB_URL, LOCAL_DB_USER, LOCAL_DB_PASS CLOUD_DB_URL, CLOUD_DB_USER, CLOUD_DB_PASS README.md: Create a README.md to describe the project, how to run it, and its purpose. Here's an example template:

markdown Copy Edit

Database Sync Service

This project provides a service that synchronizes data between two MySQL databases (local and cloud). It periodically checks for missing records in each database and inserts them into the other.

Features:

  • Syncs tables between two databases (local and cloud).
  • Prevents primary key violations by using INSERT IGNORE.
  • Syncs data every minute.

Setup Instructions:

  1. Clone the repository:
    git clone https://github.com/ThaminduDisnaZ/cloud-local-db-sync.git

Set up environment variables:

Set the following environment variables: LOCAL_DB_URL, LOCAL_DB_USER, LOCAL_DB_PASS CLOUD_DB_URL, CLOUD_DB_USER, CLOUD_DB_PASS Run the application:

Compile the code: bash Copy Edit javac DatabaseSyncService.java Run the application: bash Copy Edit java DatabaseSyncService License: This project is licensed under the MIT License.

markdown Copy Edit

  1. .gitignore: Add a .gitignore to exclude unnecessary files:

Ignore compiled class files *.class

Ignore environment files .env

Ignore IntelliJ IDEA files .idea/

Ignore Eclipse project files *.project *.classpath

shell Copy Edit

Final Folder Structure:

/database-sync-service ├── src/ │ └── DatabaseSyncService.java ├── .gitignore ├── README.md └── .env (optional)

css Copy Edit

Now you have a GitHub-friendly version of your DatabaseSyncService code that follows best practices! Let me know if you need further adjustme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0