I'm working on an iOS shopping application. And I use python to write my backend.
As for the cart part, I want to store a bunch of product ids in a list
object.
By the way, I use SQLAlchemy
to process sql queries.
As I don't have much experience in database design, I wonder what is the best way to store a list
object into mysql.
I think this is a one-many relationship issue and I'm wondering whether I need a third table except for a CartItem
table to store products' ids and a Product
table to store product's id?
Someone said that serialization
is a choice. What is serialization
?
Or can I just split list elements by comma and store as a string
?
I've referred some question answers like