3 ms·
Yes, I selfhost Postgres/Redis/Mongo for small projects (db + app server on the same machine or a small number of VMs). Usually in docker, sometimes systemd uni
by vbsteven 5y ago
Yes, I selfhost Postgres/Redis/Mongo for small projects (db + app server on the same machine or a small number of VMs). Usually in docker, sometimes systemd units. It's amazing what you can do on a single $5-50/month machine if HA isn't super important.
On larger projects (typically once k8s gets involved) I'm running on a cloud provider anyway and I might as well use a hosted version like RDS for the main database.
It comes down to the importance/budget of the project. I'm not a Postgres expert by any means but I'm confident enough that for simple use cases I can manage selfhosted. And if I need more, hosted versions are available at a cost.
However, any hosted DB product I use has to be open source and in theory easily replaceable with a selfhosted version. After the Parse.com fiasco I'm averse to closed/proprietary components in my infrastructure.
- geostar 5y agoDo you prefer docker over systemd units?
- strzibny 5y agoI am not OP, but I prefer systemd unit myself. I can use stock CentOS/Rocky/RHEL/Fedora, install the database package and be running in no time.
- mekster 5y agoI always wonder what the point of running a docker version of a daemon you can easily run with OS package manager, especially for those well tested packages like databases. And then security patches are rolled out accordingly to be updated automatically by the OS service. Not sure how good with docker container is on this part.
- geostar 5y agoThough I don’t use docker extensively anymore , but I think people generally new to tech use it to prevent any haywire situations that happen during configs
- andix 5y agoThe great benefit of docker is, that you can replicate the exact same environment on a number of different machines. So the developer on Windows has exactly the same database version and configuration as the production server. Especially useful if you use some extensions or external modules for your database. If you host something serious and you don't need special builds of databases it is probably better not to use docker. But it's a bit more effort.
- mekster 5y agoI always thought using a local machine is an anti pattern. There are plenty of virtualization software, one should just run the same OS as the production via VMware locally or give each person their own dev environment in the cloud with the same OS and be done with it than trying to align the environment partially.
- andix 5y agoDoesn't docker do that for developers? You run a container and then applications run in a defined environment. I don't know how you wan to enforce that all developers and all production machines use the exact same environment. Maybe your production still runs RHEL 7, so all the developers need to run their desktop on CentOS 7? Or take open source projects. Isn't it easier to put in the readme: "To start developing install docker and run 'docker-compose up'" vs. "Please install Ubuntu 18.04 into a VM, those 100 packages, but make sure this 50 packages are not installed." In my experience virtualized desktop environments are very painful to work on, even with fast connections. Docker (or containerization in general) is very useful for development. Much more useful than for deployment/production.
- vbsteven 5y agoIt depends. Many small projects I'm involved in already have a docker-compose.yml with database, backend and other services. Combined with a private docker registry somewhere (Gitlab, ECR). If that is available I will use docker to deploy. If that is not available, then it depends on how complex the dependency graph is. If it is simple and I can just `apt install` all dependencies then I'll wrap the install in an Ansible Playbook and use systemd. If not I create my own docker-compose.yml for deployment. edit: when multiplexing multiple projects on the same host (happens with very small projects) I always use docker.