This file is a lab walkthrough on using the Ed-Fi Data Management (DMS)
Platform. These instructions rely on a compatible docker compose command, for
example coming from Docker Desktop or Podman. See the docs/ for
additional developer information.
There are two parts to the lab:
- This markdown file provides context and instructions on running the DMS Platform.
- File
getting-started.httpprovides annotated HTTP commands demonstrating how to interact with the DMS and the DMS Configuration Service.
These instructions have been tested in Windows with current (April, 2025) versions of both Docker Desktop and Podman. This repository uses PowerShell for scripting, which should work on any OS where PowerShell Core 7+ is installed.
Tip
If using Podman without Docker in Windows, you can create either
- Find and replace "docker compose" with "podman compose" in the
eng/docker-composedirectory, or - In Windows, create a
docker.cmdfile containing the following command:podman %*and add the location of this file into your Path environment variables.
The companion file [getting-started.http] can be executed in VS Code with the
humao.rest-client or similar extension. Visual Studio and Rider also have
support for this file format. This file contains all of the HTTP commands found
this lab exercise. In VS Code with Rest Client, you can generate Curl commands
from the .http file or generate code snippets in over a dozen languages.
We use the bierner.markdown-mermaid extension in VS Code for viewing Mermaid
diagrams in Code's built-in Markdown preview tool.
Elasticsearch is also available, as an alternative to OpenSearch shown in the C4 deployment diagram below. In summary:
- There are two custom .NET applications in this repository:
- The Data Management Service (DMS), which is an "Ed-Fi API" application. It supports the following API definitions: Ed-Fi Resources API, Ed-Fi Descriptors API, and Ed-Fi Discovery API. It includes Ed-Fi Data Standard 5.2 out of the box. It will be capable of supporting other Data Standard versions at a future date.
- The DMS Configuration Service, which implements a form of the Ed-Fi Management API, whose specification is derived from the legacy Ed-Fi Admin API 2 application.
- Both systems rely on the open-source Keycloak identity provider for authentication and OAuth 2.0 compatible token management.
- Both systems use PostgreSQL for online transaction processing (OLTP) data
storage. All Ed-Fi Resources and Descriptors are stored together in a single
table, called
dms.document. - The DMS's database is replicated to OpenSearch via:
- Change data capture (CDC) using Debezium, which reads the transaction log
to copy data from
dms.document... - and pushes these records into a Kafka topic called
edfi.dms.document. - A connector reads from the Kafka topic and writes the data into either OpenSearch or Elasticsearch (OpenSearch is the default).
- Change data capture (CDC) using Debezium, which reads the transaction log
to copy data from
- The DMS uses the search database to support the "GET all" and "GET by query" HTTP requests.
- There are also optional user interfaces for viewing data in Kafka or OpenSearch (not shown below).
C4Deployment
Deployment_Node(network, "Private Network") {
Deployment_Node(dms, "DMS Services") {
Container(keycloak, "Keycloak")
Container(dms, "Data Management Service")
Container(config, "Configuration Service")
}
Deployment_Node(odsapi_c, "Kafka Services") {
ContainerDb(kafka, "Kafka Server")
Container(source, "Kafka Source Connector")
Container(sink, "Kafka Sink Connector")
}
Deployment_Node(db, "PostgreSQL Databases") {
ContainerDb(dmsdb, "DMS")
ContainerDb(configdb, "DMS Config")
}
Deployment_Node(os, "OpenSearch") {
ContainerDb(open, "OpenSearch")
}
}
Rel(dms, dmsdb, "read/write")
Rel(config, configdb, "read/write")
Rel(dms, keycloak, "discover")
Rel(config, keycloak, "discover")
Rel(source, dmsdb, "read")
Rel(source, kafka, "replicate")
Rel(sink, kafka, "read")
Rel(sink, open, "write")
Rel(dms, open, "query")
UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="4")
In a terminal, switch to the eng/docker-compose directory. Create a new file
.env as a copy of .env.example. There is no need to modify the file for
local execution. However, please change the passwords if using for anything
other than firewalled local development.
cd Data-Management-Service/eng/docker-compose
cp .env.example .envNow, start all of the required services, building from source code, with the following command. The .NET SDK is not required, as the build will occur inside a container.
./start-local-dms.ps1 -EnableConfig -EnableSearchEngineUIThis may take around a minute to startup. This script not only starts the containers, it also calls an additional script for configuring Keycloak.
Tip
Add -SearchEngine ElasticSearch to run Elasticsearch instead of OpenSearch.
Once started, try the following HTTP request, which will load the Ed-Fi Discovery API endpoint from the DMS.
curl http://localhost:8080Please open getting-started.http for detailed instructions and sample HTTP commands. If using the Rest Client extension, you can right-click on any command to generate a Curl command. Alternatively, you can create a code snippet in one of more than a dozen supported languages, including C# and Python.
For the most part, interacting with the Data Management Service is the same as interacting with the Ed-Fi ODS/API. The following ODS/API documentation pertains to the Data Management Service and will provide additional background information on developing client integrations:
- Basics
- Authentication
- Date and Datetime Elements
- Descriptor References
- Error Handling and Best Practices
- Error Response Knowledge Base
- Resource Dependency Order
- Using Code Generation to Create an SDK
In the DMS we have not included the v3/ segment that is present in the
ODS/API. This segment was never part of a formal standard, and we felt that it
was a leftover vestige from the change between ODS/API 2.x and ODS/API 3.x.
Explore the .env file you just created to see what configuration options are
available; however, most of them should not be altered. After editing the
.env, stop and then restart the containers.
To load initial seed data into the database, set the appropriate database template package name using the .env variable:
Example:
DATABASE_TEMPLATE_PACKAGE=EdFi.Dms.Minimal.Template.PostgreSql.5.2.0Then, run the following command in PowerShell to start the local DMS instance and load the seed data:
./start-local-dms.ps1 -EnableConfig -EnableSearchEngineUI -LoadSeedDataThis will ensure your environment is initialized with the required schema and data from the specified template package.
When you are ready to stop the containers, append the -d ("down") flag to the
command:
./start-local-dms.ps1 -EnableConfig -EnableSearchEngineUI -dAnd to shut down and delete all data, add the -v ("volumes") flag. This is
useful when you need to start over with a clean slate.
./start-local-dms.ps1 -EnableConfig -EnableSearchEngineUI -d -v