dokku-postgres icon indicating copy to clipboard operation
dokku-postgres copied to clipboard

Single container with multiple databases

Open kane-c opened this issue 8 years ago • 17 comments

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

kane-c avatar Jan 25 '17 23:01 kane-c

Can you reimplement this as a pr to my redis pr? That way I can apply this uniformly everywhere.

josegonzalez avatar Jan 25 '17 23:01 josegonzalez

Any updates?

kevinresol avatar Aug 21 '17 04:08 kevinresol

This is great, what is the blocker here (besides the obvious rebase/merge conflict?)

jsuchal avatar Sep 22 '17 09:09 jsuchal

Thats the blocker.

josegonzalez avatar Sep 22 '17 14:09 josegonzalez

Any updates? @kane-c Need help wrapping this up?

lostb1t avatar Feb 06 '18 15:02 lostb1t

Any updates on this? Also, why https://github.com/dokku/dokku-postgres/pull/138 closed? Is it a no-go?

pavolzbell avatar Mar 21 '18 14:03 pavolzbell

@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.

josegonzalez avatar Mar 21 '18 16:03 josegonzalez

I can not see the benefit of this.

pynixwang avatar Oct 07 '18 03:10 pynixwang

@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 avatar Oct 07 '18 18:10 josegonzalez

@josegonzalez yes. reduce a very very little resource. but increase complexity

pynixwang avatar Oct 08 '18 04:10 pynixwang

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 avatar Oct 08 '18 04:10 kane-c

@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 avatar Oct 08 '18 04:10 josegonzalez

@josegonzalez I'll have some time over the next few days, I'll see what I can do.

kane-c avatar Oct 08 '18 04:10 kane-c

@kane-c Any updates? Do you need some help?

pdomagala avatar Jan 13 '19 12:01 pdomagala

@pdomagala Sorry, life got in the way! If you would like to help then please do!

kane-c avatar Jan 13 '19 22:01 kane-c

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?

ezra-obiwale avatar Jun 23 '20 23:06 ezra-obiwale

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 :)

josegonzalez avatar Jun 24 '20 00:06 josegonzalez