Skip to main content

How do I keep a research platform from losing student data mid-study?

Five rules protect student data mid-study: automated backups with a tested restore, additive-only schema changes, a feature freeze during data collection, a build version stamped on every logged event, and a staging environment every release passes first. Setting them up typically takes 40 to 80 hours of engineering before the pilot starts.

Why lost data is a validity problem, not an IT problem

An efficacy study rests on the claim that every student in a condition got the same intervention and that every response was recorded. If a release silently drops saves for one week, or a bug changes how one condition behaves, the gap is in your analysis, not just your database. Missing data that correlates with a school, a device type or a condition is the hardest kind to defend.

Program officers and reviewers read reliability as a sign of research maturity. A platform that can show what code ran, when, and that nothing was lost is the difference between a pilot that produces usable data and one that produces a limitations section.

The checklist

Rule What it means Done before the pilot when
Automated backups Scheduled database and file-storage backups, kept outside the production project A backup has run every day for at least a week
Restore test Restore a backup into a separate environment and check record counts Someone has restored it and written down how long it took
Schema migration rules Changes add fields or tables; nothing is renamed or deleted during collection The rule is written in the repository and the team has agreed to it
Feature freeze No feature releases during data-collection windows; only reviewed fixes Freeze dates are on the pilot calendar teachers see
Versioned logging Every event carries the build version and git commit that produced it You can query any data point and get its code version
Staging before production Every release runs in a copy of production with test accounts first Production deploys only come from the staging-tested build

Backups that you have actually restored

Managed databases such as Firebase Firestore and AWS RDS offer scheduled backups and point-in-time recovery, but they are often off by default or kept for too short a window. Turn them on, set retention to cover at least the full data-collection period plus a month, and back up file storage too: audio recordings, uploaded work and images usually live outside the database.

A backup you have never restored is a guess. Before the pilot, restore last night’s backup into a separate environment, compare record counts per table against production, and open a few student records end to end. Repeat the restore test once mid-study.

Also queue every save on the client and retry until the server confirms it. Much mid-study loss is not a database failure; it is a save that failed quietly on a weak school network.

Schema changes and feature freezes during collection

Migration rules

  • Add, never rename or delete. A new field gets a default value; old records stay readable.
  • Run every migration against a copy of production data in staging first, and compare counts before and after.
  • Take a backup immediately before any migration runs in production.
  • Keep the old field until the study’s data has been exported and archived.

Freeze windows

Set a feature freeze for each data-collection window, typically the pre-test, the intervention weeks and the post-test. During a freeze, only fixes for bugs that block students or lose data ship, and each one is reviewed, tested in staging and logged with a reason. New features wait for a scheduled break, such as between study waves.

Versioned logging and the staging-to-production pipeline

Stamp every logged event with the app’s build version, the git commit hash and the study condition. Store the release history alongside the data. When an analyst sees an odd pattern in week three, they can check whether a release went out that day and which students were on which build.

Run two environments with separate databases: staging, with test accounts, and production, where only real participants exist. Releases move one way, from main branch to staging to production, through one automated pipeline. Nobody deploys from a laptop, and test accounts never touch the data your IRB protocol covers.

We applied this pattern when stabilizing an NSF-funded React/Firebase research platform used across several universities: saving and loading student work became 100% reliable, and the distributed research groups moved onto one deployment pipeline.

A worked timeline before 20 teachers log in

Weeks before pilot Work Typical hours
6 Turn on backups, set retention, back up file storage 6–10
5 Build staging environment and one deployment pipeline 12–24
4 Add build version and commit to every logged event 6–12
3 Client-side save queue with retries and confirmation 10–20
2 Restore test, migration rules written, freeze dates set 6–10
1 Full dry run in staging with test classes 4–8

That totals about 44–84 hours. The top of the range is when the prototype has no tests, stores data in several places, or was deployed by hand from a graduate student’s machine.

Frequently asked questions

How often should a research platform back up student data during a pilot?
Daily at minimum, with point-in-time recovery turned on if the database supports it. Keep backups for the whole data-collection period plus a month, outside the production project. Back up file storage such as audio and uploads as well as the database.

Can we ship bug fixes during a feature freeze?
Yes, if the bug blocks students or loses data. Each fix should be reviewed, tested in staging, and logged with the date, build version and reason. That record lets you explain any change in the data later.

Why log the app version with every data point?
Because the intervention is the software, and the software changes. Stamping each event with the build version and commit lets an analyst tie any pattern to the exact code students used. Without it, you cannot rule out a release as the cause of a shift in results.

Do we really need a separate staging environment for a small pilot?
Yes. Testing in production mixes test accounts with participant data your IRB protocol covers, and a bad release reaches students immediately. A staging environment with its own database usually takes 12 to 24 hours to set up.

Who decides how long student data backups are kept?
Your IRB protocol, data use agreements with districts and your institution’s data policies set retention and deletion rules. Engineering configures backups to match them. Your institution’s compliance office or counsel signs off on FERPA and retention questions.

Related answers

Planning a pilot and worried about the data?

We offer a free 30-minute review of your pilot plan or the technical section of your proposal. Bring the prototype’s repository or a demo, the pilot timeline and your funder’s requirements. Start a conversation.