Here the deal: I've got a table Billing
, which is basically a receipt (for different types of transaction). The app has a feature that you can create new charges (well, all charges except for tax and other constants). Since there would be a dynamic number of charges, we decided to store the charges for a billing on a single text field with a json structure. So the Charges
column contains stuff like this:
{"CrateFee":50,"DeliveryFee":90,"PackagingFee":20} {"DeliveyFee":90,"ServiceCharge":200}
Our alternative would be to create a separate table for these charges, with this structure:
Charges BillingId | ChargeName | ChargeValue 1 CrateFee 50 1 DeliveryFee 90 1 PackagingFee 20 2 DeliveryFee 90 2 ServiceCharge 200
But we decided to use the first one because if we use the second method, it will be populated by tens of thousands of rows in just a single day (estimate is about a thousand transactions in a day). I know we'll be limited with what we can do with the data if we use the first one, so I really want to push the separate table method. But I have no idea on scaling, optimizing, etc when it comes to databases, so I need some help with this.
So tell me, is it ok to use the second method? How about the performance hit? Are there other alternatives?