this post was submitted on 28 May 2024
37 points (84.9% liked)
Technology
59092 readers
4909 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related content.
- Be excellent to each another!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, to ask if your bot can be added please contact us.
- Check for duplicates before posting, duplicates may be removed
Approved Bots
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
A good ELI5 is to imagine a couple of Excel sheets. Each sheet is a "table" and each row is a record. So you're gonna have a column for the first name, a column for the last name, a column for the email address and so on. That'd be your users table/sheet.
Then you would have another Excel sheets that contains posts. Each post record references the row number of the users sheet so you can cross-reference the user record of the author of the post record.
And so on. It's a way to store, lookup and retrieve records, usually cross-referencing other records until you have all the information you need to serve a particular request. There's an index like the table of content of a book that lets you quickly find on which page the record you're looking for is.
We use databases because they're engines designed to ensure data consistency, and fast access to the data in a structured manner. Usually that runs on some server that other servers connect to to access the database, so all servers can have the same view of the data. That can be a VM in the cloud, that can be a cluster of VMs in a cloud, it can be Docker containers. It's just software that manages data so we don't have to reinvent the wheel everytime we need to store stuff. Then you just ask questions to the database, like, "what's all the last 50 posts made by this user number" (
SELECT user.username, post.title FROM posts LEFT JOIN users USING (user_id) WHERE posts.user_id = 42 ORDER BY posts.date_inserted ASC LIMIT 50
).