dirtsimple / poste.io

poste.io mail server, but with IP management and custom webmail plugins
153 stars 28 forks source link

Redis Service #6

Closed AndresJ551 closed 4 years ago

AndresJ551 commented 4 years ago

Hello @pjeby great work with Poste.io, I'm trying it on one server with a container already running Redis, can I set that to be the service for Poste.io? I really want to remove any duplicated services if I can.

Thanks!

pjeby commented 4 years ago

I don't know how you'd do that, nor why. Redis can serve multiple databases, but that feature is deprecated because Redis itself is single-threaded and thus will not scale well with multiple apps talking to the same server, vs. one server per app.

Also, managing multiple databases with Redis is a pain because they are identified by number, not name, so you have to manually assign the numbers, and only use apps that support configuring the database number.

However, I don't know if the various poste.io tools allow configuring the database number, nor how to disable the internal redis server, so the issue is likely moot. (If your goal is simply to avoid duplicated services you are probably better off not using docker, since the entire point of docker is to isolate apps from each other, not tie unrelated apps to the same backend service.)

But anyway, using multiple databases in Redis is a deprecated feature for good reason, and you will be creating way more problems for yourself sharing a Redis server between multiple applications than can be made up for by having fewer containers. Tools like docker-compose and kubernetes exist to manage application-specific sets of containers, each with their own database servers or redis instances, and this approach is what docker is made for.

AndresJ551 commented 4 years ago

Great answer, so far all has been working perfectly. Thanks!