Deploy Data Availability
This section provides instructions for on-premises deployment of the Data Availability service, which extracts data from the modernized NBS cloud implementation so you can keep copies of selected tables from RDB, ODSE, and SRTE. Complete Validate API endpoints before starting this page.
This page is part of the optional NND Service (Data Sync) section. CDC is evaluating long-term support for this service. If your STLT has a use case, contact nbs@cdc.gov.
On this page
- Prerequisites
- Components for Data Availability service
- Set up the Data Availability service
- Appendix: Data Sync service
- Next steps
Prerequisites
- Complete Validate API endpoints.
- Keycloak client ID and client secret: Retrieve these from your Keycloak instance. In the NBS realm, navigate to Clients >
nnd-keycloak-client> Credentials > Client Secret. - Data service URL: Retrieve this from your NBS environment.
Components for Data Availability service
The Data Availability service includes:
data-sync-service.jar.cmdfiles (only for Windows environments).sqlfiles (for configuration table)
The service supports multiple options to download the data:
- Direct database sync
- Drop incremental
.JSONfiles into an AWS S3 bucket - Drop incremental
.JSONfiles into a local directory
Set up the Data Availability service
Download the Data Availability service files (.jar, .cmd, and .sql) from the NEDSS-NNDSS v7.13.0 release page. Under Assets, download the v7.13.0.NEDSS.NBS.Modernized.Documentation.zip file and locate the files in the data-sync/NND_SERVICE/ directory. Save the files to a secure directory with executable permissions to run the services.
Before you proceed, choose where to send the data:
- SQL database
- Amazon S3 bucket
- Local directory
The SQL database option uses a different setup (see Appendix). For AWS S3 bucket and local directory options, pass the appropriate arguments in the .cmd file based on the selected option. Templates are provided in the release documents and README.md.
Step 0: Choose the option for Data Availability service
Use one of these three download options:
- Direct insert into the database:
- Default setup: Syncs all tables into one database
- Custom setup: Syncs tables into separate databases as preferred (e.g., target databases match source databases)
- Drop JSON files in S3 bucket
- Drop JSON files in a local file system
Step 1: Create the data config table
This step is important because this config table ensures that tables sync correctly.
Default setup for Data Availability
- Use this if downloading data into S3 bucket or file location, or if having all tables in one database is acceptable.
- Use the
.sqlfile (create_data_config.sql) provided in the release package to create a new database (optional) and the required config table. - You can name your local database as preferred.
- Ensure the
poll_data_sync_configtable is created. - Run the script
poll_config_insert.sqlto insert the static/lookup data into the config table.
Custom setup for Data Availability
- Use this if you prefer multiple databases and want to redirect table inserts per your preference.
- Create any sync database with your chosen name.
- The service requires the
poll_data_sync_configtable (create_data_config.sql). - For each new database, create this configuration table and update its records as needed (
poll_config_insert.sql), depending on sync requirements.
Example: By default, Data Availability syncs all tables in the RDB database, without considering their original source.
To direct SRTE table data into a separate SRTE database:
- Create the SRTE database in the on-premises environment.
- Create the
poll_data_sync_configtable in that database. - Insert only SRTE-specific configurations into the table.
- These can be identified by the
source_dbfield (e.g.,source_db = SRTE).
- These can be identified by the
Config table scripts
-
Create config table create_data_config.sql
-
Insert config records (pick only the tables you want to download into that database, for example, only SRTE tables) poll_config_insert.sql
Step 2: Configure the .cmd files
- Find the configurable
.cmdscript file in the release materials. - Replace the argument values with your own.
- Important: Do not include spaces between argument name and value. The proper format is:
arg_name=arg_value.
- Important: Do not include spaces between argument name and value. The proper format is:
- For customizations, refer to the README.md file.
Appendix: Data Sync service
Setup for downloading data into SQL database (on-premises)
- Use this setup if the SQL sync option is chosen.
- Ensure relevant tables exist in the designated database before sync.
-
Execute the following
.sqlscripts to create necessary tables required to download the data. - Database creation scripts (includes RDB, SRTE, and RDB Modern) create_test_db SQL scripts
Next steps
Continue to Case notifications.