So I’m working on a shopping basket application that requires a persistent basket and am trying to decide whether to store my basket/items as a blob in the database or break them out into multiple tables (*e.g. – tbl_basket, tbl_basket_items, tbl_basket_item_variants*). I have no need for sorting or filtering of basket items. I will simply query the basket based on soldto (btw, there could be multiple baskets per soldto). Baskets will only be valid for a relatively short period of time (6-12 months max). They could have several hundred line items (rare case), but I don’t expect anything really all that big that it would degrade performance. The number of users is relatively small…400 concurrent users max. Typical usage would be somewhere around 50-100 concurrent users.
I’m leaning towards simply storing my basket as a blob simply because it’s simple and relatively clean (yes I’m lazy). My question is, am I missing something? What are the drawbacks to this approach. What are the benefits? The one drawback that comes to mind is if my Basket object changes, it could be a problem for active baskets.
Thanks for any insight you might have.
use a basket, basket_item table pattern, and leave blobs for database opaque data like images, documents, etc.. Eventually you will want to tie basket items to inventory control, or analytics, or…., and having that data in a blob will kill performance.