Jump to content

API and DB best practice query


twsowerby

Recommended Posts

Hi Guys,

 

I have a query regarding best practice for performance on a web application I'm developing.

 

I am retrieving data via an API that I then need to display on a website.

 

The data retrieved all relates to a product ID. The issue I am having is that each product has a UniqueID, but also a GroupID. The GroupID is used to display the same products but of different colour/size combinations.

 

ie.

 

UniqueID

GroupID

Size

Colour

1

1

n/a

n/a

2

2

Small

Red

3

2

Medium

Blue

4

2

Large

Green

 

I need to display the products in a list, but where there are multiple products in a group, I need to provide a dropdown selector for size and a dropdown selector for colour.

 

I'm struggling a bit with how to structure it with just the array spat out by the API, so I was considering saving the data to a MySQL database and then querying that to get what I need.

 

Is this a good way to go or is the double query hit going to be horribly inefficient?

 

Cheers!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.