The WelcomeSurvey feature in GrowthExperiments currently relies on storing responses in the user_properties table. This was never intended to be a long term storage option, but now that we are on most Wikipedias, it's more urgent to set up storage that can scale alongside the feature usage.
The proposal is:
- create a database table for growthexperiments_welcome_survey_responses with columns for ID, user ID, timestamp of submission, group name, and survey_submission JSON blob
- implement a migration pattern to write to new storage, read from old; write new storage, read new; read/write new storage, drop old values from user_properties
Example submission:
{ "reason": "placeholder", "edited": "placeholder", "languages": [ "en" ], "mailinglist": true, "_group": "exp2_target_specialpage", "_render_date": "20220315204755", "_submit_date": "20220315204822", "_counter": 2 }
Note that submit date, group and counter can be removed, since those will have dedicated columns in the table (or in the case of counter, multiple rows in the table).
So the table might look like:
ID | user ID | submit date | group | values |
1 | 1 | 20220315204822 | exp2_target_specialpage | {"reason":"placeholder","edited":"placeholder","languages":["en"],"mailinglist":1, "_render_date":"20220315204755" } |