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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:33:59+00:00 2026-05-27T03:33:59+00:00

Which would scale better for recording votes and subscriptions of a question? A. 2

  • 0

Which would scale better for recording votes and subscriptions of a question?

A. 2 tables, 1 for each subscriptions and votes, each with foreign keys to join questions, in which case I’d query with a union of 2 queries to each table to get all the activity for the question.

OR

B. 1 table with 1 foreign key to join to questions and a field to record if the row is a vote or subscription. In this case there will be an extra join condition for some of my other queries too.

  • 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-27T03:34:00+00:00Added an answer on May 27, 2026 at 3:34 am

    When you talk about ‘scaling’, you have to be more precise on what operations you want to scale?* Do you need to optimise read, write, both? file dumps? fetch external content?

    Once you know what you want to scale, often you’ll also need or want to figure out how much you want to scale to, and if your tweaks offer any benefit at all, by benchmarking and profiling.

    This is fun, depending on the context. Benchmarking on a saturday night is not allright.

    Some of the database optimising techniques I am aware of involve denormalisation and such tricks that you don’t see much in ordinary environnments, so using those “hacks” for better performance sometimes (often) bring a price on code maintainability for example. In the case of denormalisation technique I mention above, you lose some of the data-integrity your database offers and then have to implement it in your application code.

    Not so good for the developper, he has to replicate a DB’s data integrity just to have a faster database query time. In light of the above, friend it is my humble opinion (being a lazy developer), many scaling problems can be avoided by disregarding scaling problems in the first place, until they occur.

    If you want to talk of standard, good db building practices, from a general sql perspective, I only know of the 2 main ways, the normalised way and the non normalised way. Both have sub-variants but I guess that would look like your A, and your B. Both are valid options, and both have pros and cons, but if your application is not to be flooded by thousands of hits a minute I would say use A, maybe something similar to this:

    Table votes – has primary key vid,

    Table questions – has primary key

    Table subscriptions – has primary sid, foreign key vid, qid

    Good-luck, happy coding!

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

Sidebar

Related Questions

Which would be a neat implemenation of a N-ary tree in C language? Particulary,
which would you recommend? which is faster, reliable? apache mod_python or nginx/lighttpd FastCGI?
Which would be quicker. 1) Looping a datareader and creating a custom rows and
Which would be the correct format for this XML data, are they equivalent or
Which would be a more appropriate repository to host a small, XCode, Objective-C based
I would like to create a simple file format/DSL which would allow my users
I was just wondering which would be cheaper, using a try catch block for
I need some library which would be able to keep my urls Indexed and
Do you know any implementation / technique which would provide similar behavior as Viewstate
I'm working on a tool which would need to communitacte: send and recieve files

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.