Live data from Hacker News

Things to know about databases

architecturenotes.co

21–30 of 247 posts

Re: Things to know about databases

#21
Not sure how to use these recommendations in practice though even if the info is somewhat correct. SQL is a beast of tech and it is used because of battle history and since there is simply no other viable tech replacing it when it comes to transactions and aggregated queries.

Indexes are a nightmare to get right. Often performance optimizations of SQL databases include removing indexes as much as adding indexes.

Re: Things to know about databases

#23
#1 thing you should know, RDBMS can solve pretty much every data storage/retrieval problem you have.

If you're choosing something other than an RDBMS - you should rethink why.

Because unless you're at massive scale (which still doesn't justify it), choosing something else is rarely the right decision.

Re: Things to know about databases

#24
To go big picture; I'm kind of glad databases are largely like cars in this respect, in ways that other software tooling isn't.

Which is to say they're frequently good enough such that the human working with them on whatever level can safely not know a lot of these details and get a LOT done. Kudos to whoever deserves them here.

Re: Things to know about databases

#25

#1 thing you should know, RDBMS can solve pretty much every data storage/retrieval problem you have. If you're choosing something other than an RDBMS - you should rethink why. Because unless you're at massive scale (which still doesn't justify it), choosing something else is rarely the right decision.

Good point. Its often the problem space and other constraints that usually drive these decisions. Its important that you deal with problems when you have them.

Re: Things to know about databases

#26

Not sure how to use these recommendations in practice though even if the info is somewhat correct. SQL is a beast of tech and it is used because of battle history and since there is simply no other viable tech replacing it when it comes to transactions and aggregated queries. Indexes are a nightmare to get right. Often performance optimizations of SQL databases include removing indexes as much as adding indexes.

It's not that SQL is all that beastly, it's that most tutorials fail to explain the internals and basics and so you just see all these features and interfaces of the system and can't build a mental model of how the system works.

Re: Things to know about databases

#27
Introductory material is always welcome, but I suspect this isn't going to hit the target for most people. For example:

> Therefore, if the price isn’t an issue, SSDs are a better option — especially since modern SSDs are just about as reliable as HDDs

This needs a tiny extra bit of detail: if you're buying random IO (IOPS) or throughput (MB/s), SSDs are significantly (orders of magnitude!) cheaper than HDDs. HDDs are only cheaper on space, and only if your need for throughput or IO doesn't cause you to "strand" space.

> Consistency can be understood after a successful write, update, or delete of a row. Any read request immediately receives the latest value of the row.

This isn't the ACID definition of C, and is closer to the distributed systems (CAP) one. I can't fault the article for getting this wrong, though - it's super confusing!

Re: Things to know about databases

#28

Not sure how to use these recommendations in practice though even if the info is somewhat correct. SQL is a beast of tech and it is used because of battle history and since there is simply no other viable tech replacing it when it comes to transactions and aggregated queries. Indexes are a nightmare to get right. Often performance optimizations of SQL databases include removing indexes as much as adding indexes.

Indexes aren't a "make my DB faster" magic wand. They have benefits and costs.

If you are seeing performance gains from removing indexes, then I'm assuming your workload is very heavy on writes/updates compared to reads.

Re: Things to know about databases

#29
post #27

Introductory material is always welcome, but I suspect this isn't going to hit the target for most people. For example: > Therefore, if the price isn’t an issue, SSDs are a better option — especially since modern SSDs are just about as reliable as HDDs This needs a tiny extra bit of detail: if you're buying random IO (IOPS) or throughput (MB/s), SSDs are significantly (orders of magnitude!) cheaper than HDDs. HDDs ar…

You are absolutely right about the C being more inline with CAP one.

I have a post in draft to discuss disk trade offs which digs into this aspect, its impossible to dig into everything in this level of a post.

Re: Things to know about databases

#30
post #3

Great post. Also highly recommend Designing Data-Intensive Applications by Martin Kleppmann ( https://www.amazon.com/Designing-Data-Intensive-Applications... ). The sections on "Storage and Retrieval", "Replication", "Partitioning" and "Transactions" really opened up my eyes!

Absolutely loved the book. Can someone recommend similar books?
Post reply on HN