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

  • SEARCH
  • Home
  • 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 896221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:41:34+00:00 2026-05-15T14:41:34+00:00

I’m sure there’s an easy answer here and i’m just over-complicating things, but i

  • 0

I’m sure there’s an easy answer here and i’m just over-complicating things, but i am in the process of writing a Django module responsible for storing and tracking user usage statistics which can then be displayed to users on certain pages.

Simplest example of this might be tracking which products a user has purchased and looked at so that when someone else is looking at a product we can display “products other people bought that also bought this”… etc

My uncertainty is to do with the best data model approach. I am thinking that it might not be efficient to write to a table every time someone looks at a product, but then i do need to display this data in some form to users. I’m looking for a strategy that is easy to manage and that is efficient from the bottom up. Any suggestions?

EDIT:
By ‘efficient from the bottom up’ – i’m basically just talking about adopting a solution that is efficient to both store and retrieve – probably should have just said that 🙂

Also, to add another complication, let’s say i want to track viewing relationships between products rather than simply logging that an individual product was viewed. So, for example i might want to show on product A’s page that people who viewed product A also viewed product b c and d. On the back of some of the comments below i was thinking about creating a table / django model with 2 simple fields (product_name and last_viewed_date), that way i can run a job to consolidate all views of a single product into one row (with the last_viewed_date taking the date of the most recent record)… BUT if i also want to store the history of each of those views, as explained above, how might i do that?

  • 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-05-15T14:41:34+00:00Added an answer on May 15, 2026 at 2:41 pm

    A database table design would be the best thing to do. That way you can recommend similar items that people browse.

    Sometimes people might log into the site, sometimes just browse so you would need a table by session-id and another by user-id to track the items browsed.

    Also you would want categorization of items and only display related items. That way if one customer looked at gardening tools and iPhones you wouldn’t suggest to the next person looking for an iPhone to buy a Rake.

    Answer edited for comments

    You can retrieve data from a database much faster that you can do with a log file. With the help of proper indexing and good normalization / denormalization of your structures, you will be able to do this for a huge number of rows. A database scales much better than text files.

    If you create an INSERT style model rather than an update model, you will deal with less contention too. You will have to build up an archiving mechanism to ensure that the table does not grow wildly if you are restricted by space.

    I would personally go with an RDBMS rather than a text file any given day for this scenario.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.