2

Idea

Users can upload lots of items and send them from processing. From the upload settings I can set a channel to which the uploaded items belong to. Channel is a separate entity. Currently I set the chosen channelfor each uploaded item. Having **Many To One** relationship betweenitemandchannel`.

There actually exists upload_process table as well. When upload is started, a process is created to capture any metadata and store the state of the running process.

Currently all the queries that deal with Items, directly use the channel_id from on the item itself, but all the items that are uploaded in one process always have the same channel.

Example

  • User uploads 100 items and chooses Channel 1.
  • Upload process is created, storing information like process status, who uploaded, upload date...
  • When processing, each item channel is set to Channel 1.
  • I end up having 100 items with foreign keys pointing to Channel 1

Question

Should I move the channel relationship to the upload_process entity and store that there instead of each individual item?

There are over 10 million items in the database. Currently there are max 2 joins on all the queries that deal with items and queries run max 2 seconds, adding another join table shouldn't hurt the performance that much.

What is better here design wise? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.