Crazylife's avatar

Storing data as json or separated as column better in database?

I am using MySQL as my database. I am thinking to store user details in json type instead of create multiple column to store data. I am storing the details such as tax_number, company_name, address...etc in my order table.

May i know better to separate it out or it's fine to store as json format?

0 likes
3 replies
MichalOravec's avatar

Better for maintain and performance is to use a separated table. In this case user_details with user_id as a foreign key.

Crazylife's avatar

Erm, what i mean i have this details like order_id, customer_id, customer_name, customer_address, etc... in my Order table. Can i store the customer_name and customer_address under json column or as separated column?

Please or to participate in this conversation.