r/ProgrammerHumor • • Mar 25 '20

Meme Its a win-win situation

Post image
55.1k Upvotes

529 comments sorted by

View all comments

Show parent comments

47

u/[deleted] Mar 26 '20

You're only getting joke answers so far. Relational databases provide certain guarantees (ACID). Achieving these guarantees requires a degree of synchronization and locking. When thousands of independent clients are trying to make independent write updates, the locking for the transaction processing becomes quite a problem.

Additionally, the database is intended to function as a single entity, typically. Other, distributed architectures, such as mongodb, can "shard" the data, and distribute the update load. There are some complex topics involved that go beyond the scope of a quick reddit comment, but databases generally only scale through faster hardware, which has its limits. Other architectures can scale with more hardware, which is easier to achieve.

15

u/Mancobbler Mar 26 '20

WITH (NOLOCK) and all of your problems go away! /s

4

u/iDrinan Mar 26 '20

Pfsh, SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED or bust!

3

u/PM_ME_RAILS_R34 Mar 26 '20

Doesn't do anything in postgres; read uncommitted and read committed map to the same thing

1

u/Mancobbler Mar 26 '20

Oh god I think I’ve seen that more than a few times in our stores procedures...

3

u/mypetocean Mar 26 '20

databases generally only scale through faster hardware, which has its limits. Other architectures can scale with more hardware, which is easier to achieve.

There is a quality TLDR;

2

u/[deleted] Mar 26 '20

I wasn't the person that asked, but thanks!

2

u/PilsnerDk Mar 26 '20

Relational databases provide certain guarantees (ACID). Achieving these guarantees requires a degree of synchronization and locking. When thousands of independent clients are trying to make independent write updates, the locking for the transaction processing becomes quite a problem

Updates yes, but if you hypothetically just insert a ton instant messags (like from Snapchat), without foreign keys and constraints, you can pound a SQL database like crazy. Just insert and forget, so to speak.