Comments (6)
This sounds like something that should not be implemented in the core. It would require stopping the database to get a consistent disk snapshot, and thats something you can orchestrate already using the provided interfaces.
from dokku-mariadb.
But not really in a nice way and to be honest:
Making a difference between sql dumps and filesys dumps: In both cases "you stop" the database. If the SQL Dump is overwriting and deleting/truncating tables you use, you also need to stop working with your application. Making changes at the database with zero downtime is the job of migrations though not of dumps. Those are for initialization or seeding tasks.
However will still fork it, but will not open the PR, may be a hard fork.
from dokku-mariadb.
Calling mysqldump
on a database doesn't require downtime in all cases. For InnoDB, it will lock the table to make a consistent snapshot. Depending upon the amount of data, yes, it may pause writes for you, but imo that's a tradeoff you have to make when using the plugin.
Here is a short script you can put somewhere to run maintenance on your database. As you can see, this would require orchestration with your application to ensure users don't just get 500 pages and instead get an error page. An alternative would be to slave a database to your mysql instance and run backups against that to ensure your site stays up during deploys.
# using the official maintenance plugin
dokku plugin:install https://github.com/dokku/dokku-maintenance.git
# some configuration
SERVICE=service-name
BACKUP_DATE=$(date +%Y-%m-%d-%H.%M.%S)
APP=app-name
# enable maintenance on linked applications
dokku maintenance:on $APP
# actually do the backup
dokku mysql:stop $SERVICE
tar -zcvf "$SERVICE-$BACKUP_DATE.tar.gz" /var/lib/dokku/services/mariadb/$SERVICE
dokku mysql:start $SERVICE
# some command to disable maintenance mode for your database
dokku maintenance:off $APP
The goal of the official datastore plugins is to provide primitives for building out datastore setups, not to solve every problem. For instance, we also don't have clustering, or master-master setups. This is a complex topic, and handling all cases for each plugin is out of scope for sure.
Note: you can also probably use something like Percona Xtrabackup for faster database backups, as documented here.
from dokku-mariadb.
I'm only interested in this plugin for test instances and yes mysqldump doesn't "require" a downtime, a lock still is kind of a downtime, especially if you need to lock everything to ensure integrity of the backup. And still importing a sql dump to create schemas and seed always doesn't seed in a zero downtime friendly manner, unless this dump was explicitly crafted to perform like that.
I will still fork the plugin and buld the filesys dumps and restores into it to have fast boot up of new test instances at any wished time. For this use case this plugin is useful, haven't found it useful for real productive scenarios yet, unless the app is very very small.
By providing this functionality within the plugin I provide also all developers/qas the possibility to initilialize dumps without waiting forever for the instance. It's actually in this case 15minutes vs. 20 seconds. And on the test instance that would be even worse, as it is way less powerful than the production dbs.
And how I archive a filesys dump is already known to me, and percona xtrabackup is not an option.
from dokku-mariadb.
If you want to add that functionality in a PR, I would definitely accept it.
from dokku-mariadb.
Ok, then I'm going to open that PR, I need to take a look at generalizing this functionality a bit more, there are already changes I have made https://github.com/wzrdtales/dokku-mariadb/tree/mariadbFileSys, but those are still designed to some of our processes, such as using pixz to compress as it supports multi core decompression and not only mutli core compression which 7z and others do not. Also to note that these changes are also not yet final.
from dokku-mariadb.
Related Issues (20)
- ADD bash_completion support: autocomplete mariadb service names HOT 2
- one service with multiples databases HOT 7
- How to connect with client via ssh tunnel? HOT 17
- After installing, I get error when running any docker command HOT 10
- Kills itself when not enough memory? HOT 4
- dokku mariadb:create <service> freezes HOT 2
- Diagnosing database status HOT 2
- How to configure my.cnf HOT 8
- Locking tables HOT 8
- How to override plugin alias HOT 2
- Error while trying to setup backup - Container is restarting HOT 3
- Consider to change default character set to utf8 HOT 6
- Consider having single-instance mode HOT 3
- Database stuck in 'Restarting' HOT 3
- What is the format of schedule exactly? HOT 1
- dokku mariadb:export locks tables HOT 1
- Shared database container? HOT 1
- ERROR: unable to connect HOT 20
- Allow to override user on create HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokku-mariadb.