Hi Dave - I'm just working my way through your "MySQL and JSON" book and have a question. I'm at MySQL 5.7.30. Is there any advantage/disadvantage to using multiple json columns in a table? 1/
@stoker
For example, creating an order with line items. I would normally (old school) create an order table and an order-line-items table with one-to-many relationship. But, as you explain, the line items could as well be inside a json field in the order table row. 2/
That makes sense. The order is a single document, so think nosql document store. That makes sense. But, then, I also want to maintain an order event history (create order, pay for order, etc.). The question is... 3/
Would it make more sense to keep order line items as one json column and order history as a separate json column, or drop everything into a single json column? Order history, meta data (purchaser, address, etc.), line items might all be updated at separate times, so 4/
I could see separating things out for CRUD reasons... but am I over-thinking it? My gut feel is that storing everything as a single json column would be cleaner. I'm only on Chapter 5 so there may be an answer later in the book! Thanks again :) 5/end
https://www.amazon.com/David-Stokes/dp/1260135446/
You can follow @ewbarnard.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.