this post was submitted on 04 Sep 2025
500 points (97.0% liked)

Selfhosted

51254 readers
408 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Nextcloud asked in a poll at https://mastodon.social/@nextcloud@mastodon.xyz/115095096413238457 what database its users are running. Interestingly one fifth replied they don't know. Should people know better where their data is stored, or is it a good thing everything is running so smoothly people don't need to know what their software stack is built upon?

you are viewing a single comment's thread
view the rest of the comments
[–] dustyData@lemmy.world 53 points 3 days ago (2 children)

Yeah, that is the kind of concern for the service developer or a very opinionated sys admin. For self-hosting, few people will reach the workload where such a decision has any material or measurable impact.

[–] stardreamer@lemmy.blahaj.zone 16 points 3 days ago* (last edited 3 days ago) (1 children)

Exactly. Unless you are actively doing maintenance, there is no need to remember what DB you are using. It took me 3 minutes just to remember my nextcloud setup since it's fully automated.

It's the whole point of using tiered services. You look at stuff at the layer you are on. Do you also worry about your wifi link-level retransmissions when you are running curl?

[–] IncogCyberspaceUser@lemmy.world 1 points 3 days ago (1 children)

Sorry for the newbie question, but how is your nextcloud setup automated? Is that like a compose/yaml file?

[–] stardreamer@lemmy.blahaj.zone 4 points 2 days ago

stares at 300 line shell script+ansible mess that updates/sets up Forgejo, Nextcloud, ghostcms

"Yes... It's automated"

[–] u_tamtam@programming.dev 3 points 3 days ago (2 children)

Self hosting doesn't mean "being wasteful and letting containers duplicate services". I want to know which DB application X is using, so I pool it for applications Y and Z.

[–] Ajen@sh.itjust.works 22 points 3 days ago (2 children)

For most applications the overhead of running a second DB server is negligible.

[–] absentbird@lemmy.world 5 points 3 days ago

And if it's SQLite (which I believe is the default) it's really just reading and writing a file on the file system.

[–] u_tamtam@programming.dev 1 points 2 days ago (1 children)

I disagree. You are just entertaining the idea that servers must always and forever be oversized, that's the definition of wasteful (and environmentally irresponsible). Unless you are firing-up and throwing-away services constantly, nothing justifies this and sparing the relatively low effort it is to deploy your infrastructure knowingly.

[–] Ajen@sh.itjust.works 4 points 2 days ago (1 children)

Do you have the data to back that up? Have you measured how much of an impact on system load and power consumption having 2 separate DB processes has?

Roughly the same amount of work is being done by the CPU if you split your DBs between 2 servers or just use one. There might be a slight increase in memory usage, but that would only matter in a few niche applications and wouldn't affect environmental impact.

[–] u_tamtam@programming.dev 1 points 1 day ago (1 children)

Do you have the data to back that up?

I mean, you are the one making the exceptional claim that unnecessarily running multiple instances of programs on a device with finite resources has no practical adverse effect. Of course, the effects can be more or less drastic depending on the many variables at play (hardware, software, memory pressure, thread starvation, cache misses, …) and can indeed be negligible in some lucky circumstances. The point is that you don't call that shot, and especially not by burying your head in the sand and pretending it's never gonna be a problem.

Effective use of computing resources requires tuning. Introduction of a new service creates imbalance. Ensuring that the server performs nominally and predictably for all intended services is a balancing act and a sysadmin's job. Services whose deployment settings are set by someone with no prior knowledge of the deployment constraints can't be trusted to do a good job at it (that's the nature of the physical world we live in, not my opinion), and promoting this attitude promote the kind of wasteful and irresponsible computing I was on about.

Now, I'll give you the link to this basic helper for tuning a PostgreSQL server: https://pgtune.leopard.in.ua/
Will you tell me what are the correct inputs for my homelab (I won't tell you the hardware, the set-up, the other services running on it, the state of the system, etc)?
And later, when you will distribute your successful container to millions of users, what will you respond to the angry ones that will complain that your software is slow, to no fault of your coding, because they happen to pile up multiple DBs, web servers, application servers, reverse proxies, … on their banana SoCs?

[–] Ajen@sh.itjust.works 1 points 1 day ago (1 children)

I'm saying this based on real world experience: after a certain point you start to see deminishing returns when optimizing a system, and you're better off focusing your efforts elsewhere. For most applications, customizing containerized services to share databases is far past that point.

[–] u_tamtam@programming.dev 1 points 19 hours ago (1 children)

I’m saying this based on real world experience

And do you think I would spend my time engaging if that wasn't from my own very "real world experience" of lessons learned the hard way?

Bringing-up "diminishing returns" as if this was an optimisation game also doesn't do this justice. Take the typical "household FOSS package" with software names often brought up in here: a nextcloud instance, a photo-sharing service like immich, private instant messaging, a software forge, a subsonic-compatible audio/video streaming server, a couple php websites like wallabag and RSS aggregators.

An Intel Atom CPU and 4GB of RAM is plenty sufficient for all that, and will cost you single digit USD a month, granted you put the (one-time) effort to tune and balance those services. Would you run all the above from upstream's docker files, I can guarantee you that you would deem this (perfectly fine otherwise) server underpowered for the task at hand (and would probably go for a 10th gen or so Intel Core CPU, quadruple the RAM and 3-6× the energy cost in the process).

And that's the point I'm making here: a self-hosting community of tinkerers should (ideally) know better, for the ethics' sake of keeping the process environmentally friendly, and not wasting other people's money.

[–] Ajen@sh.itjust.works 1 points 18 hours ago (1 children)

You seem to be obsessed with optimising one resource at the expense of others. Time is a limited resource, and even if it only takes 5 minutes to configure all of your containers to share a single db backend (it will take longer than that even if you just have 2), you're only going to save a few MB of RAM. And since RAM costs roughly $2.5/GB (0.25 cents/MB) your time would have to be worth very little for this to be worthwhile.

On the other hand, if you're doing it to learn more about computers then it might be worthwhile. This is a community of hobbiests, after all...

[–] u_tamtam@programming.dev 1 points 15 hours ago

You seem to be obsessed with optimising one resource at the expense of others.

If you want to push it and paint me as obsessed about something, then let it be this: providing this community with on-topic and reasonable advice

you’re only going to save a few MB of RAM.

This is false, and you should read once again my previous message illustrating why: on a decent "self-host"-friendly machine, the same software may work very well, or not at all, depending on whether the user would engage with very basic configuration. This goes beyond RAM (memory isn't the sole shared resource), and I'm adamant that the alternative (which was "pretending that the problem doesn't exist" turned into "throwing money at the problem") is unreasonable.

On the other hand, if you’re doing it to learn more about computers then it might be worthwhile. This is a community of hobbiests, after all…

Or more importantly: the extent to which you can self-host out of sheer luck and ignorance like you suggest is very limited. If you don't want to engage with a minimum amount of configuration, you might bump into security issues (a much broader and complex subject) long before any of the above has a material impact.

[–] tburkhol@lemmy.world 4 points 3 days ago (1 children)

This is one of my pet peeves with containerized services, like why would I want to run three or four instances of mariadb? I get it, from the perspective of the packagers, who want a 'just works' solution to distribute, but if I'm trying to run simple services on a 4 GB RPi or a 2 GB VPS, then replicating dbs makes a difference. It took a while, but I did, eventually, get those dockers configured to use a single db backend, but I feel like that completely negated the 'easy to set up and maintain' rationale for containers.

[–] u_tamtam@programming.dev 4 points 2 days ago

Precisely what pre-devops sysadmins were saying when containers were becoming trendy. You are just pushing the complexity elsewhere, and creating novel classes of problems for yourself (keeping your BoM in control and minimal is one of many others that got thrown away)