The FDA MyStudies Study datastore makes APIs available for client applications to obtain the content of studies configured with the Study builder web application. For example, the iOS and Android mobile applications interact with the Study datastore to obtain the study schedule and tasks. The Study datastore serves the content and configuration of your organization’s studies - it does not process participant data. The Study datastore is a Java application built on the Spring framework. The backend database is MySQL, which is shared with the Study builder web application. The Study datastore uses basic authentication bundle_id and app_token to authenticate calls from client applications.
The Study datastore client applications are:
The Study datastore provides the following functionality:
- Serve study settings to client applications
- Serve study eligibility and consent data to client applications
- Serve study schedule to client applications
- Serve study activities to client applications
- Serve study status to client applications
NOTE: Holistic deployment of the FDA MyStudies platform with Terraform and infrastructure-as-code is the recommended approach to deploying this component. A step-by-step guide to semi-automated deployment can be found in the
deployment/directory. The following instructions are provided in case manual deployment in a VM is required. Google Cloud infrastructure is indicated, but equivalent alternative infrastructure can be used as well. It is important for the deploying organization to consider the identity and access control choices made when configuring the selected services. If pursuing a manual deployment, a convenient sequence ishydra/→auth-server/→participant-datastore/→participant-manager-datastore/→participant-manager/→study-datastore/→response-datastore/→study-builder/→Android/→iOS/.
To deploy the Study datastore manually:
- Create a Compute Engine VM instance with your preferred machine type and OS (for example, e2-medium and Debian 10), then reserve a static IP
- Verify that your VM instance has the
Stackdriver Logging APIwrite access scope (on by default) and that your VM’s service account has theLogs Writerrole (off by default) - Check out the latest code from the FDA MyStudies repository
- Create a Cloud SQL instance with MySQL v5.7 (instructions)
- Configure the
Study datastoredatabase on the Cloud SQL instance- Create a user account that the
Study datastoreandStudy builderapplications will use to access this instance (instructions) - Run
sudo ./create_superadmin.sh <email> <password>in the/study-builder/sqlscript/directory to createsb-superadmin.sql, which you will use to create the firstStudy builderuser (you may need to install htpasswd, for examplesudo apt-get install apache2-utils) - Run the
/study-builder/HPHC_My_Studies_DB_Create_Script.sqlscript to create a database namedfda_hphc(instructions) - Run the
/study-builder/version_info_script.sqlscript - Run the
/study-builder/procedures.sqlscript - Run the
sb-superadmin.sqlscript that you created in the step above - Enable the database’s private IP connectivity in the same network as your VM (instructions)
- Create a user account that the
- Configure blob storage for public study resources by creating a Google Cloud Storage bucket and granting your VM’s GCE service account the
Storage Object Adminrole and setting public read access - Deploy the
Study datastorecontainer to the VM- Create the Docker image using
sudo mvn -B package -Pprod com.google.cloud.tools:jib-maven-plugin:2.5.2:dockerBuild -Dimage=study-datastore-imagefrom thestudy-datastore/directory (you may need to install Docker and Maven, for examplesudo apt install maven) - Update the Docker environment file
variables.envwith values to configure theapplication.propertiesfile for your deployment - Run the container on the VM using
sudo docker run --detach --env-file variables.env -p 80:8080 --name study-datastore study-datastore-image
- Create the Docker image using
- Test if the application is running by running
curl 0.0.0.0/study-datastore/healthCheck - You can review application logs in the logging directories you specified, or with
sudo docker logs study-datastore; audit logs are available in Cloud Logging
Copyright 2020 Google LLC