dokku-postgres
dokku-postgres copied to clipboard
Single container with multiple databases
I've really wanted this plugin to be able to this for a long time. When I found @josegonzalez's helpful outline in https://github.com/dokku/dokku-redis/issues/64 (Single Container Usage), I decided to give it a go.
Usage is like this:
dokku postgres:create db
dokku postgres:create-database db app --database db_name --user user_name
dokku postgres:link db app --database db_name --user user_name
It's also possible to unlink in the same way as linking above, and the same goes for destroying a single database with postgres:destroy-database
.
See also: https://github.com/dokku/dokku-postgres/issues/49
Can you reimplement this as a pr to my redis pr? That way I can apply this uniformly everywhere.
Any updates?
This is great, what is the blocker here (besides the obvious rebase/merge conflict?)
Thats the blocker.
Any updates? @kane-c Need help wrapping this up?
Any updates on this? Also, why https://github.com/dokku/dokku-postgres/pull/138 closed? Is it a no-go?
@pavolzbell a few things:
- if there is an update, it would be posted.
- it hasn't been reviewed heavily since it needs a rebase.
- the other user closed their PR on their own. I do not know why, not up to me.
I can not see the benefit of this.
@pynixwang You don't need to see the benefit of running multiple databases in a single container. Some of our users might do so in order to use fewer resources. Thats enough for me.
@josegonzalez yes. reduce a very very little resource. but increase complexity
For my use case - multiple sites on a EC2 micro instance - memory is very limited so having a single Postgres server with multiple databases is a lot better than one Postgres server per database. Add Docker into the mix as well and it's a lot of overhead I'd rather avoid if possible.
@kane-c if you have a chance to rebase this, I might be able to just take a look and potentially do the migration to the redis service/others.
@josegonzalez I'll have some time over the next few days, I'll see what I can do.
@kane-c Any updates? Do you need some help?
@pdomagala Sorry, life got in the way! If you would like to help then please do!
Can you reimplement this as a pr to my redis pr? That way I can apply this uniformly everywhere.
@josegonzalez What exactly needs to be done to have this feature merged? I'll put in the time to fix it, if I can.
What Redis PR?
Lets ignore redis for now.
The feature needs to be rebased, and in a way that makes it easy to apply the change to all datastore plugins. Ideally you apply it here and maybe memcached? Or some other datastore that doesn't use users in the same way.
Generally speaking, I should only need to write a few custom functions in the functions
file to add this to every plugin. If the functionality shouldnt be supported, there should be a way to turn it off (maybe via a variable in the the config
file?).
Might be good to reach out to me on slack (I'm savant
there) so we can discuss it further :)