Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:38:13+00:00 2026-06-07T12:38:13+00:00

Suppose I am building a website for an online store and have a database

  • 0

Suppose I am building a website for an online store and have a database of products. All these products have their own pages, with their own respective URLs.

If the URL can always be derived from other data in the database (let’s pretend every product can be found at http://example.com/%5B PRODUCT.CATEGORY ]?prod=[ SHA1(PRODUCT.NAME) ]), would it be wise to store the URL in another field of the table?

On one hand, it is duplicate data (it can easily be derived from other existing fields in the table). On the other hand, these URLs are used everywhere and it seems wasteful re-deriving them every single time they are needed.

Is there a best-practice for this scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:38:16+00:00Added an answer on June 7, 2026 at 12:38 pm

    You should not store ANY urls in the database.

    You should create the urls at runtime based on the data you are looking for.

    The page that displays the product can ignore any fields it doestn’ need.

    You should also use an ID field not product.name. Unless you are trying to hide certain products from users, there is no reason to sha1 the key.

    Remember using the primary key to lookup a record is the fastest way possible to get that record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I am building an app using current mysql database tables. I have this
Suppose you're building an HTML form and you want to have 2 or more
I learned play by following the tutorial on their website for building a little
Suppose I have the following XML <building> <phonenumber></phonenumber> <room> <phonenumber></phonenumber> </room> </building> Using building.getElementsByTagName('phonenumber')
I'm building a mobile website using FancyBox , which works fine on all Android
I'm building a mobile website using FancyBox , which works fine on all Android
Suppose we are building an E-commerce site that allows consumers to search for products
Suppose, I have a singly linked list and its basic building block is, struct
I am building a website similar to yellow pages were users or visitors can
Suppose you are building a web application that is going to be a packaged

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.