11
Hi everyone !
Intro
Was a long ride since 3 years ago I started my first docker container. Learned a lot from how to build my custom image with a Dockerfile, loading my own configurations files into the container, getting along with docker-compose, traefik and YAML syntax... and and and !
However while tinkering with vaultwarden's config and changing to postgresSQL there's something that's really bugging me...
Questions
- How do you/devs choose which database to use for your/their application? Are there any specific things to take into account before choosing one over another?
- Does consistency in database containers makes sense? I mean, changing all my containers to ONLY postgres (or mariaDB whatever)?
- Does it make sense to update the database image regularly? Or is the application bound to a specific version and will break after any update?
- Can I switch between one over another even if you/devs choose to use e.g. MariaDB ? Or is it baked/hardcoded into the application image and switching to another database requires extra programming skills?
Maybe not directly related to databases but that one is also bugging me for some time now:
- What's redis role into all of this? I can't the hell of me understand what is does and how it's linked between the application and database. I know it's supposed to give faster access to resources, but If I remember correctly, while playing around with Nextcloud, the redis container logs were dead silent, It seemed very "useless" or not active from my perspective. I'm always wondering "Humm redis... what are you doing here?".
Thanks :)
Hi! Boy, I can't wait to see the other comments.
You can add another abstraction layer to your DB interface, and write a bunch of tests for it; if I really thought I'd ever need to change DB backbends, that's what I'd do.
Redis is a very simply DB for very simple data. It's a persistent key/value cache. It's not meant to fulfill the role of a relational or structured data database. It's meant to be for fast lookups of simple data. It has a trivial query language. It's a hash map.