Deploy real-time reporting (RTR)
Real-time reporting (RTR) is an NBS 7 capability that reduces reporting latency from as long as 24 hours to between 5 minutes and 1 hour. RTR uses Change Data Capture to detect row-level changes in source tables, publishes those changes to Kafka topics, and loads the data into the reporting database. This section covers steps to install RTR with Helm charts.
On this page
Complete the sections on this page in order. Each section depends on the previous one. If you encounter issues during database setup, contact support at nbs@cdc.gov.
Prerequisites
Before you begin, verify that your environment meets the following requirements and choose a database installation method. The method you choose applies throughout this guide.
To reduce risk, consider setting up RTR in a testing environment before moving to production. This lets you run RTR alongside MasterETL and compare results, then turn off MasterETL only after you are satisfied with those results.
-
RTR installation requires a supported NBS 6 version. See the Supported NBS versions page. To verify your NBS release version, run the following query:
USE NBS_ODSE; SELECT max(Version) current_version FROM NBS_ODSE.dbo.NBS_Release; - Run the ETL jobs one final time and make sure they complete successfully.
PHCMartETL.batMasterETL.batcovid19ETL.bat
-
Choose a reporting database. RTR can write to your existing
RDBdatabase, or to a new database you create by duplicatingRDB. Pick one option and use it consistently throughout this guide.Back up the
RDBdatabase before you proceed. This step cannot be undone.- Create a new reporting database (suggested): Duplicate your existing
RDB. This lets you run RTR alongside MasterETL to compare results before fully committing. You can use any name for this reporting database, but for the remainder of this guide, we refer to it asRDB_MODERN. The exact steps for database duplication depend on your SQL Server version and hosting environment. If your database is on Amazon RDS, see Back up and restore on Amazon RDS. For other environments, see Microsoft’s documentation on backup and restore operations.- Use your existing RDB database: RTR takes over writing to
RDB. Turn off theMasterETL.batandcovid19ETL.batjobs and proceed to the next step. MasterETL remains available for manual recovery runs if needed.
- Use your existing RDB database: RTR takes over writing to
If you use a new reporting database, you must use the new reporting execution server to run reports.
- Create a new reporting database (suggested): Duplicate your existing
Create service user
Create a database service user that the RTR services use to read source data and write to the reporting database:
- Name: Any name works. A name descriptive of the role, such as
rtr-service-user, is suggested. -
Database permissions:
NBS_ODSE:db_datareaderNBS_SRTE:db_datareaderRDB/RDB_MODERN:db_owner
Enable Change Data Capture
In this section, the terms
cdcandCDCappear as part of SQL Server column and parameter names and refer to Change Data Capture, not the Centers for Disease Control and Prevention.
Change Data Capture (CDC) streams row-level changes from NBS_ODSE and NBS_SRTE to Kafka, where RTR services load them into the reporting database. Change Data Capture was already enabled on NBS_ODSE in the Case Notification service deployment. Running the bootstrap script again on NBS_ODSE has no additional effect. The script also enables CDC on NBS_SRTE, which is required for real-time reporting.
To enable CDC on NBS_ODSE and NBS_SRTE:
- Using a
sysadminaccount, apply Bootstrap script 101. CDC requiressysadminpermissions.
Deploy RTR services
Now that you have completed database setup and onboarding, deploy the RTR services. Some services depend on the previous ones completing successfully, so complete the pages in the following order: