Why postgres service if If you buy a managed PostgreSQL database from DigitalOcean?
Why do we need to add postgres service if we buy postgress database on DigitalOcean ?
For me there is two ways to setup our database :
- Solution 1 : Let docker handle it by taking advantage of docker network. We configure Docker then to run PostgreSQL as a service. For this solution, no need to buy DigitalOcean database since we can map with volumes (./data/db:/var/lib/postgresql/data). Data persisted with volumes then
- Solution 2 : Buy DigitalOcean database. For this solution no need to setup postgress service with docker. PostgreSQL runs on DigitalOcean's infrastructure. We take advantages of DigitalOcean. DigitalOcean handles maintenance, backups, security, ... in this case. So for me, No PostgreSQL Docker service needed.
So I am in this django project and despite the fact that we have our PostgreSQL runs on DigitalOcean's infrastructure in the docker-compose we steel have postgres service. So my question is why then do we need postgress service if we decide to take DigitalOcean database offer ? why do we need postgress service in this case for docker ? Just wanna understand. My crew gave me some explanations but do not understand very well. So can anyone help me to understood ?