All Projects → dkulchenko → watchdb

dkulchenko / watchdb

Licence: MIT license
Keeping SQLite databases in sync

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to watchdb

Bank-Account-Simulation
A Bank Account Simulation with JavaFX and SQLite back-end. Material UX|UI.
Stars: ✭ 19 (-73.61%)
Mutual labels:  sqlite-database, sqlite3
mdb2sqlite
Conversion tool used to convert microsoft access database to sqlite.
Stars: ✭ 79 (+9.72%)
Mutual labels:  sqlite-database, sqlite3
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+43.06%)
Mutual labels:  sqlite-database, sqlite3
Wxsqlite3
wxSQLite3 - SQLite3 database wrapper for wxWidgets (including SQLite3 encryption extension)
Stars: ✭ 373 (+418.06%)
Mutual labels:  sqlite-database, sqlite3
Microservices With Lumen
A Lumen based microservice ready to deploy with guzzle for consumption of api and OAuth 2
Stars: ✭ 115 (+59.72%)
Mutual labels:  sqlite-database, sqlite3
Tuql
Automatically create a GraphQL server from a SQLite database or a SQL file
Stars: ✭ 526 (+630.56%)
Mutual labels:  sqlite-database, sqlite3
Squeal
A Swift wrapper for SQLite databases
Stars: ✭ 303 (+320.83%)
Mutual labels:  sqlite-database, sqlite3
SQLiteHelper
🗄 This project comes in handy when you want to write a sql statement easily and smarter.
Stars: ✭ 57 (-20.83%)
Mutual labels:  sqlite-database, sqlite3
food-sqlite-demo
This tutorial we will save text from EditText and Image from gallery into SQLite database
Stars: ✭ 58 (-19.44%)
Mutual labels:  sqlite-database, sqlite3
flow
C++14, header-only library for multi-stream data synchronization.
Stars: ✭ 26 (-63.89%)
Mutual labels:  synchronization
Python-Course
🐍 This is the most complete course in Python, completely practical and all the lessons are explained with examples, so that they can be easily understood. 🍫
Stars: ✭ 18 (-75%)
Mutual labels:  sqlite3
birthday.py
🎉 A simple discord bot in discord.py that helps you understand the usage of SQL databases
Stars: ✭ 30 (-58.33%)
Mutual labels:  sqlite3
datastation
App to easily query, script, and visualize data from every database, file, and API.
Stars: ✭ 2,519 (+3398.61%)
Mutual labels:  sqlite3
braid-spec
Working area for Braid extensions to HTTP
Stars: ✭ 179 (+148.61%)
Mutual labels:  synchronization
locize-cli
locize cli to import / export locales, add / edit / remove sync segments
Stars: ✭ 44 (-38.89%)
Mutual labels:  synchronization
checksync
A tool for detecting when related text blocks change
Stars: ✭ 14 (-80.56%)
Mutual labels:  synchronization
Zaloha2.sh
Small and simple directory synchronizer (a BASH script)
Stars: ✭ 50 (-30.56%)
Mutual labels:  synchronization
deployer-extended-database
Deployer tasks to manage database synchronization between application instances.
Stars: ✭ 32 (-55.56%)
Mutual labels:  synchronization
migration
Simple library writen in PHP without framework dependancy for database version control. Supports Sqlite, MySql, Sql Server and Postgres
Stars: ✭ 142 (+97.22%)
Mutual labels:  sqlite3
embedio-extras
Additional Modules showing how to extend EmbedIO.
Stars: ✭ 43 (-40.28%)
Mutual labels:  sqlite3

watchdb

A tool for easily replicating a SQLite database across a network.

Release

Overview

watchdb is a tool that enables quick setup of master-slave synchronization for SQLite databases across a network.

Synchronization is one-way only (changes made on the master will overwrite changes made on slaves). Slave databases are kept read-only to prevent accidental writes from application code.

watchdb replication is eventually consistent by design, so it's AP in CAP. If you need strong consistency (at the expense of performance and required changes to application code), take a look at rqlite.

Features

  • Works on Linux, OS X, Windows
  • No dependencies, just one binary
  • Replicates sqlite DB changes quickly across any number of nodes
  • No changes to application code required
  • Optional authentication and encryption supported

In the future:

  • Incremental (partial) DB syncing

Installation

Precompiled binaries for supported operating systems are available.

Alternatively, run go get github.com/dkulchenko/watchdb. You'll need a working sqlite3 binary in $PATH if you go this route. The precompiled binaries embed a copy of sqlite.

Usage

Watch a SQLite database:

watchdb watch mydb.sqlite

On a slave server, sync:

watchdb sync 127.0.0.1:8144 mydbcopy.sqlite

Easy as that. Any changes made to mydb.sqlite will quickly show up in mydbcopy.sqlite. Try it out!

Options

You can specify any option on the command line, or provide a configuration file (an example config is available at conf/example.yml):

watchdb watch --config-file=config.yml mydb.sqlite

Set a custom bind address/port:

watchdb watch --bind-addr=127.0.0.1 --bind-port=1234 mydb.sqlite

Authentication

Require an auth key to be sent before syncing is allowed (similar to Redis AUTH):

watchdb watch --auth-key 927bc430fc2195fa2f0caaf35d115c mydb.sqlite

and on the slave:

watchdb sync --auth-key 927bc430fc2195fa2f0caaf35d115c 127.0.0.1:8144 mydbcopy.sqlite

Or specify it in the configuration file using the auth_key parameter.

Encryption

watchdb supports SSL for encrypted syncing between nodes.

watchdb watch --ssl --ssl-key-file=key.pem --ssl-cert-file=key.crt mydb.sqlite

and on the client:

watchdb watch --ssl 127.0.0.1:8144 mydbcopy.sqlite

You may omit the ssl key file/cert file and a self-signed one will be generated for you at startup. Note that you'll need to provide the --ssl-skip-verify option on the client for this to work.

Why?

sqlite3 is an excellent database, and by far the easiest way to embed SQL into an app where using a larger DB like MySQL or PostgreSQL might not be possible. The downside, of course, is the single-node nature of the DB, which means that if the primary goes down, the data goes down with it.

I wanted to build a simple way to replicate a sqlite database across a network without requiring any special configuration or changes to application code. Hence, watchdb.

Contribute

  • Fork repository
  • Create a feature or bugfix branch
  • Open a new pull request

License

The MIT License (MIT)

Copyright (c) 2015 Daniil Kulchenko [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].