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 8121757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:35:59+00:00 2026-06-06T05:35:59+00:00

I’d like some opinons on whether I’m over-modeling my app. In this app, I’m

  • 0

I’d like some opinons on whether I’m over-modeling my app. In this app, I’m saving off html meta data I download from websites. I download the meta tags and make them part of an an array. For each element in the meta_tags array, I want to save that element. But I need to account for situations where, for instance, there are two robots meta metas (one for index and one for follow). So my initial thought was to solve this by creating a “meta_tags” table and saving any meta tags off to their. That woud keep the sites table lean. I would just specify that the site table has many meta_tags.

But then I realized that the meta_tags is going to have a lot of duplicate entries. For instance, if I have two websites that have two robots meta tags (again, one for index and one for follow), then I’ve got four rows on that table, when I only have two unique records. So now I’m thinking that I should have the sites model do the downloading of html and then have a separate model called “meta tags” that lists all unique meta tags. And then I would associate the sites table with the meta_tags table through a join table called “site_meta_tags” that identifies which site had which meta tags. Is that the best way to set this up? Or am I making this too complicated?

UPDATE: I posted a follow up question here: Rails app has trouble with inter-model saving

  • 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-06T05:36:01+00:00Added an answer on June 6, 2026 at 5:36 am

    The “right” number of models and associations depends on your use cases and constraints. If database space is at a premium, database normalization might make more sense. If you want faster lookups, denormalization might make more sense. If you need to optimize certain kinds of lookups, arrange your models and relations for that. All of this said, if you are just prototyping, don’t worry too much right now — start with something that makes sense and see what happens.

    The way you described (a many to many relationship) sounds fine to me if you want to be able to lookup in both directions:

    1. for a meta tag first and then find the associated sites
    2. for a site first and then find the associated meta tags

    (Note: don’t forget to add your indexes.)

    By the way, in Rails, for a many to many join table, the Rails convention is to alphabetize the two table names before sticking them together. So it would be “meta_tags_sites” not “sites_meta_tags” by default. See the “has_and_belongs_to_many” section in A Guide to Active Record Associations.

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

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,

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.