This forum is archived and no longer active. You can visit us in our Discord Server here!

Topic: User Data issue (Projections, Exposures, Randomness, Custom Columns)

1

We have had a couple of users that reported issues with losing their data. First, we never want this to happen to anyone so we will look into a solution for recovering old data. Second, I want our users to understand the most likely cause of this issue so they can avoid it. I wanted to also explain some of the technical details and decisions that went into this most recent update in regards to data storage for those that are interested.

tldr; Using multiple tabs / devices on the same cruncher or rewind page can lead to data loss. If you close a page that does not have data uploaded, that will overwrite any existing data you have uploaded.


Technical Details
=========================================================================================================
We used to store your data in a database table that would have a row for each player you uploaded projections/exposures for. The structure was something like this:



There were a few issues with this design. First, you would need a row for every player, every period for every FC user. This amounted to a very large table, some 60 million rows of data.

Second, and the bigger issue, all the columns needed to be statically set. I am only showing the Fanduel and DK in the above image, but we had columns (22) for every site we supported, including variations (eg. DK showdown). This posed a few problems, if we ever wanted to add a new variation, we had to create a new column. If we wanted to allow users to upload randomness, we needed to add 11 new columns (dk_randomness, fd_randomness etc.)

This really limited how we could easily grow things in the future, and users being able to upload any columns would be challenging with this design.


Our new design looks more like this:



This design lets us store your columns in the single json object, which makes adding any columns easy and can be unique for each user. The json object currently holds projections, exposures, randomness and any other column you upload. It looks like this:


{
"945161": {
"proj": "9",
"rdmpct": "10",
"exp": 0.45
},
"945493": {
"proj": "10",
"rdmpct": "10",
"exp": 0.5
}
}


This works great, however it does provide a new challenge. When you first load any lineup cruncher/rewind page, we load a copy of the {json object} if you have one stored in the database for that League/Period/Site. If you do not, you will start with an empty object.

When you update your data (change a projection for example), we update your browsers copy and then we will send the entire object to the server to be saved in the database. We bundle up the changes, so if you make several in a row, it will send all the updated data at once. We also save the object one last time as you exit the page, just to try and ensure your data has been saved if you had made several changes and refreshed quickly.

The scenario where this becomes an issue is if you are working on multiple tabs or devices simultaneously.

Take this example:

  • Open FC on 2 tabs where you haven't uploaded any data.

  • Update projections on first tab. You can refresh this page and see they are there. Then close this tab.

  • When you go to the second tab, you won't have projections because when you loaded the page you didn't have any. When you refresh this page, your data from this page will be saved, which is empty and your projections from the first tab will be wiped out.



This should not become an issue unless you are specifically working in multiple tabs or devices at the same time. You can update data, close the browser (or leave it open) and then if you load a new window elsewhere (say traveling home from the office) it will pull all your data in from the last save as a starting point.


Hopefully this helps explain it all a little better if anyone is running into an issue.