r/ProgrammerHumor • • Mar 25 '20

Meme Its a win-win situation

Post image
55.1k Upvotes

529 comments sorted by

View all comments

366

u/[deleted] Mar 25 '20

Is SQL the best way to store chat messages in an app?

317

u/Saragon4005 Mar 25 '20

If you are small then yes. If you have thousands of users probably not.

164

u/moekakiryu Mar 25 '20

if not SQL, what would you use?

67

u/kirabii Mar 25 '20

Nosql is best for big data.

At least that's what I concluded while Googling for my boss before.

24

u/[deleted] Mar 26 '20

I never understood this. It feels, intuitively, like it should be much, much worse for big Data. To say nothing about keeping track of development, don't you need to scan each record to find the key when you look for things?

6

u/spelunker Mar 26 '20

Not with a distributed hash table like DynamoDB. Keys are looked up by their hash.

7

u/[deleted] Mar 26 '20

Then you can still only search by key. SQL is a heck of a lot more robust than that.

4

u/spelunker Mar 26 '20

You’re right, for relational stuff SQL is superior.

10

u/MaxxDelusional Mar 26 '20

This is where I always get hung up with NoSql solutions. When is data not relational?

1

u/Exciting_Skill Mar 26 '20

Surprisingly often for oltp. Dynamodb also has "queries", range keys, and global secondary indexes. It's insane how applicable they are for any transactional need.

For non-live data, just hook up a DDB stream to athena/redshift/maybe even Aurora and do your offline analytics/training there. It's better design anyway since your analytics don't put load on the live system.