I'm working on a project that, when all boiled down, is essentially a raffle. The twist is that due to the way we've set the ticket value, a user may be casting 10,000+ tickets.
Essentially, a user can chose to cast a certain number of tickets for any given raffle. At the end of a period of time, a winning ticket is chosen randomly. A users' likelihood of winning is proportional to the number of tickets he/she casts.
My issue is that due to the volume of tickets, storing each ticket individually in the database seems out of the question, but in some way every ticket needs to be accounted for because it will affect the odds.
My fallback option is storing "batches" of tickets per user, assuming that it's rare that a user casts a single ticket at once.
What would be the best and most efficient solution for storing a high volume of tickets in the database?