this post was submitted on 03 Apr 2024
9 points (61.5% liked)

Ask Lemmy

27100 readers
2259 users here now

A Fediverse community for open-ended, thought provoking questions

Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

EDIT: You don't have to answer for my specific purposes, if you use a database for any purpose yourself then please share and tell what and why.


I'm not planning to host any fediverse or mastodon instances just yet, but maybe a private email server and porting a discord channel to matrix might be in my future.

What do you use and why? Is it limited to a specific OS, and if you were on a different OS then what would you be using instead? Do you think server hardware is required for most operability or can a good desktop computer and internet speed suffice as long as downtime isn't a problem?

top 33 comments
sorted by: hot top controversial new old
[–] themoonisacheese@sh.itjust.works 12 points 8 months ago (1 children)

If I'm writing an app and need it to embed a db, SQLite. If it's running on a server, postgres.

[–] Australis13@fedia.io 6 points 8 months ago
[–] amio@kbin.social 9 points 8 months ago (1 children)

SQLite for almost everything I've ever done that wasn't professional. In those cases it's "whatever the project already uses, or else postgres".

As long as it isn't a shoehorned-in freaking document database that's being used on relational data.

[–] FiniteBanjo 2 points 8 months ago

Is Excel a good database? /s

[–] breadsmasher@lemmy.world 9 points 8 months ago (1 children)

There isn’t a one size fits all database. It really depends on what you want to do

[–] FiniteBanjo 2 points 8 months ago* (last edited 8 months ago) (1 children)

I'm gonna try to port a discord channel over to Matrix, never attempted anything like it before.

Also, if you use a database for literally any specific reason, then feel free to answer the prompt with that information.

[–] themoonisacheese@sh.itjust.works 2 points 8 months ago (1 children)

Are you doing that as a challenge? Because there are multiple tools that do that already, discord/matrix bridges are a dime a dozen

[–] FiniteBanjo 1 points 8 months ago (1 children)

I'm not making the bridge, just a database. Some other users have informed me that as long as I can use Docker or equivalent then running the compose will generate a database on its own, which was news to me but I'm still learning a lot about databases and maintaining with this discussion so I think it was a worthy discussion.

[–] themoonisacheese@sh.itjust.works 2 points 8 months ago (1 children)

Seeing your other comments on this post, I urge you to think twice about embarking on whatever it is you're about to attempt, because it is clear you have no idea what's in store for you. I really don't mean it as a demeaning thing, what you're describing is hard.

I suggest looking into a postgres tutorial first and foremost, it will teach you the basics of DBMS and how to use SQL, and when you understand that and what the database does for the applications you're used to, revisit this project. Being a database administrator is a literal full time job in the enterprise world, and for good reason, and you don't sound like you know enough about it to go in guns blazing.

[–] FiniteBanjo 1 points 8 months ago

No worries I'm not the person to jump in head first, clearly.

[–] aldalire@lemmy.dbzer0.com 6 points 8 months ago (1 children)

Postgres is what the cool kids use these days i think

[–] FiniteBanjo 3 points 8 months ago

Never heard of it, so you must be correct.

[–] tal 4 points 8 months ago (1 children)

What do you use and why?

I've used sqlite for structured storage by scripts and the like. From a performance standpoint, it's not amazing, but easy to set up and doesn't have resource usage if it's not actually being used.

If I were going to use an always-active daemon, I'd probably default to PostgreSQL, mostly because decades back, the last time I looked at it, it was considered to have some technical advantages over MySQL. And at one point I did some hacking on its scheduler, so I have a bit of a warm feeling for it.

Do you think server hardware is required for most operability or can a good desktop computer and internet speed suffice as long as downtime isn't a problem?

I probably wouldn't think of things as "server" hardware" and "desktop" hardware. That's really a product of vendors trying to segment the market up, which lets them engage in price discrimination, as business buyers tend to be less price sensitive. Maybe you want more memory or a faster form of storage or something.

As to performance, I mean, it depends entirely on your use case. I would guess that the vast majority of database-using software out there has performance be a non-issue.

If you're looking for potential land mines, I'd suggest making sure that your backup system is aware of the database and can take an atomic snapshot, so that you don't get a garbled, being-written copy every time you do a backup.

If you're trying to figure out whether to buy a lot of hardware, though, I can tell you that without knowing what you're doing, I would not go out and buy new hardware just over performance concerns until you've actually tried doing your project on existing stuff and found that it's inadequate. People have run useful, large databases for many decades on much weaker hardware and slower storage than is generally-available in 2024.

[–] FiniteBanjo 1 points 8 months ago

(•̪ o •̪)

[–] slazer2au@lemmy.world 3 points 8 months ago (1 children)

Those services come with their own databases that you don't have to directly manage.

Grab their respective Docker compose files and run them up and let the app handle the db.

The !selfhosted@lemmy.world communities can give far better answers than a generic community like this.

[–] FiniteBanjo 2 points 8 months ago* (last edited 8 months ago) (1 children)

All the discussions I saw about it said that I would have to make a new table in a database to store it on, but I guess that's only if adding it to an existing database instead of letting it make a new one? Should I be letting it set up its own database without understanding database maintenance to begin with?

[–] slazer2au@lemmy.world 3 points 8 months ago (1 children)

I don't mean to sound rude but because you are asking what db to use it sounds like you don't know what you are doing. In that case let the individual apps run their own db.

Yes you are using more compute resources running several dbs at once but if a db falls over only one app is effected.

[–] FiniteBanjo 4 points 8 months ago

I absolutely have no idea what I'm doing, asking questions is evidence of lack of knowledge, couldn't possibly be considered rude.

[–] solrize@lemmy.world 3 points 8 months ago* (last edited 8 months ago) (1 children)

Is this for hosting at home with a home internet? Use a PC or even something like a raspberry pi. Just be frequent about backups if there is anything important on it. It might be easier to use a cheap VPS though, even if that doesn't qualify as total self-hosting.

If the software you want to run recommends a particular database, use that. Otherwise, for small stuff, SQLite is good enough for most purposes, and less hassle than most alternatives.

[–] FiniteBanjo 2 points 8 months ago* (last edited 8 months ago)

You're cool and I want you to appreciate yourself at least as much as I appreciate you right now.

[–] xia@lemmy.sdf.org 3 points 8 months ago

PostgreSQL. It's head and shoulders above the competition... clearly superior. :)

[–] assassinatedbyCIA@lemmy.world 2 points 8 months ago (1 children)

The correct term is lemrade

[–] FiniteBanjo 1 points 8 months ago

Milk Milk Lemrade Around the Corner Fudge is Made

[–] stoy@lemmy.zip 2 points 8 months ago (1 children)

The only database I have worked with is MariaDB/MySQL, I use it as a database to a temperature logger that logs the temp of water at a swimming hole and uploads the data to website.

The logger is ab rpi zero, with a timer and a DS18B20 under water temperature probe.

The timer will turn on the rpi once every 30 min, I set up a bash script that gets the temp data, formats it, checks for errors, if found, checks again, up to three times in total if needed then using curl connects to a webpage to send the data (Name, Temp and Status), waits 30 sec, then shuts down the rpi, shortly before the timer cuts power.

The script is run a on startup as a systemd service, the reason for the 30 sec wait before shutting off the pi is to give me time to logon to the pi and stop the script if I need to do maintenence on it.

The website it built in PHP and MySQL/MariaDB, and runs on a webhotel, there are a few pages, one to upload data, one to get a list of the latest 40 readings, snd one mobile page that shows the current temp in larger font and a graph of the temperature changes.

[–] FiniteBanjo 2 points 8 months ago

I bet the swimmers really take that reading for granted, that's the work of some truly competent people and we thank you.

[–] FiniteBanjo -4 points 8 months ago (1 children)

Downvoted because people didn't like my attempt at a "hook" tagline, darnit

[–] bjoern_tantau@swg-empire.de 7 points 8 months ago (1 children)

They're probably downvoting because your question shows such a vast lack of knowledge that any attempt at a serious answer would exceed the time anyone would be willing to invest.

[–] FiniteBanjo -4 points 8 months ago (1 children)

I think the lack of contextual information in the question itself is evidence of beginner and hobbyist categorization, though? After all, it would be silly to ask things we already know about. I tried searching for database recommended on all the instances and didn't see any other posts about it, but I value Lemmy user's opinion on this subject very highly.

[–] bjoern_tantau@swg-empire.de 5 points 8 months ago (1 children)

To make a bad car analogy, your question reads like this:

What steering wheel do you recommend?

I'm not planning to drive a Formula 1 car yet, but maybe a dirtbike and a superbike might be in my future.

What do you use and why? Is it limited to a specific fuel and if you were on a different fuel what would you be using instead? Do you think a truck motor is required or can a good engine and road suffice?

Please don't try to run a service that is accessible from the internet. It would probably be taken over by hackers very quickly and be used to distribute spam or worse.

[–] FiniteBanjo -2 points 8 months ago (1 children)

Okay but TBF if a person were going to use some motorbikes and a Formula 1 car in the near future then they would certainly benefit from knowing the different fuel types as well as general maintenance/operation. Complexity of topic is no excuse to shun questioning.

[–] ThisIsNotHim@sopuli.xyz 2 points 8 months ago (1 children)

You may have missed the point of the example. It asks about steering wheels, and immediately transitions to vehicles that don't have steering wheels.

[–] FiniteBanjo 0 points 8 months ago (1 children)

Are you implying that databases don't exist for private email and hosting a matrix channel? Because if so then you're just blatantly wrong.

[–] bjoern_tantau@swg-empire.de 1 points 8 months ago

What do you even think a database is?