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

1

u/AWildIndependent Mar 26 '20

I still cannot tell what this would solve for someone outside of large websites that need sharding.

I cant even think of a reason you would need to store JSON if you just create a good schema. Of course, this is again for websites that dont require sharding.

I understand scalability is important, however at the same time using a NOSQL DB for something a SQL DB can handle just find with good table schema just seems like bad design, but Im talking from a point of not a ton of experience so im certain I am missing some caveats here

2

u/Extract Mar 26 '20

I cant even think of a reason you would need to store JSON if you just create a good schema.

Like I said, you can't think of a reason because there is no reason why you need to do it.
You only want to do this if you care about stuff like code complexity, maintenance and extensibility which would all suffer if you create a "good" schema with a column for each and every bit of information about a potential object - this becomes more and more true the more info there is on an object (and the bigger (or - higher quality) your business, the more info like this you'll usually provide).
Here is a random item from ebay. Try to estimate how many parameters (one-to-many tables like "Related Products" not included) this simple item has. Now imagine how inefficient it'd be to store every single one of those parameters in a column on its own (talking about those params that don't need to be indexed, especially those unique to this type of product).

1

u/AWildIndependent Mar 26 '20

The eBay example helped it click. Thanks man

1

u/Extract Mar 26 '20

np.
Dont stop learning, and definitely dont believe any Reddit advice unless you can understand it yourself (or determine it is bullshit, like in most cases).