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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:06:50+00:00 2026-06-14T00:06:50+00:00

We are hosting the backend of a social game for iPhone on a Ruby

  • 0

We are hosting the backend of a social game for iPhone on a Ruby on Rails/postgres server.

Every game has 54 questions connected via a relation table in the database. Since we currently have about 2 Million ongoing games, the relation table contains about a 100M rows. This eats a lot of memory. We are now considering constructing an algorithm which generates 54 question ids using a pseudo-random sequence seeded by the game_id. The idea is to produce a seemingly random collection of question, without saving the explicit game-question-relations to the database. This way we can move load from the database to the application server. Is this a good idea?

Pseudo code:

r = Random.new(game_id)
q1_id = r.rand(n_questions)
q2_id = r.rand(n_questions)
... 
  • 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-14T00:06:51+00:00Added an answer on June 14, 2026 at 12:06 am

    Yeah, all you need is a deterministic function that takes the game ID and produces a sequence. Something as simple as adding a salt to the gameId and hashing the result should do just fine, then it’s just a matter of mapping the resultant value to the question IDs. (Take a look at combinatorics for that kind of thing.)

    If you’re then dealing with something that looks like a list of question identifiers keyed by game identifier, and you need persistence support for the answers, there are better options than an RDBMS. Take a look at Redis, for starters.

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

Sidebar

Related Questions

I'm trying to build an administration backend Rails engine. Suppose the Engine has the
I'm currently looking at hosting solutions for my Ruby on Rails SaaS web application,
My hosting company wants me to move from a MySQL 4 server to a
My hosting account has two folders for me to upload/installing websites onto: /httpdocs/ /httpsdocs/
I have a script that links to the server I am hosting (IP can
We have developed a .NET web application that uses SQL Server as a backend.
Many people have asked about Rails hosting on this site, but I'm not familiar
Please note: I am a game programmer, so backend development isn't my forte. There
I developed a board game app (for android/iphone) and added a multiplayer component to
My hosting provider (webhosting.uk.com) for security reason has disabled the PHP mail() function requiring

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.