{"id":50351214,"url":"https://github.com/kxsystems/kdbx-db-service","last_synced_at":"2026-05-29T21:01:39.962Z","repository":{"id":360182926,"uuid":"1217866019","full_name":"KxSystems/kdbx-db-service","owner":"KxSystems","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-21T10:43:19.000Z","size":3621,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T12:05:32.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KxSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T09:46:01.000Z","updated_at":"2026-05-21T10:43:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/KxSystems/kdbx-db-service","commit_stats":null,"previous_names":["kxsystems/kdbx-db-service"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/KxSystems/kdbx-db-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdbx-db-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdbx-db-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdbx-db-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdbx-db-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KxSystems","download_url":"https://codeload.github.com/KxSystems/kdbx-db-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdbx-db-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-29T21:01:37.250Z","updated_at":"2026-05-29T21:01:39.950Z","avatar_url":"https://github.com/KxSystems.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KDB-X DB Service - Public Preview 1\r\n\r\nThe DB Service is a self-contained variation of the KDB-X [tick-based architecture](https://code.kx.com/kdb-x/how_to/manage_streaming_data/architecture.html), with many useful built-in features accessible via a well-documented API. It is a simple way to quickly deploy a fully-implemented KDB-X database to capture and query streaming and batch data.\r\n\r\n![KDB-X DB Service architecture](architecture.png)\r\n\r\nFull documentation available at [code.kx](https://code.kx.com/kdb-x/services/db-service/introduction.html)\r\n\r\n## Prerequisites\r\n\r\nBefore starting the DB Service, you must have your local environment ready. Ensure the following:\r\n\r\n- **License**. You have a valid [KDB-X license](https://code.kx.com/kdb-x/get_started/kdb-x-install.html#license-requirements). Set in the `.env` file. If it is a Community Edition license it should be assigned to `KDB_LICENSE_B64`. For a k4 license, use `KDB_K4LICENSE_B64`. *NOTE: if you're using a Community Edition license from before May 2026, you'll need to generate a new one to use the DB Service. You can get a new automatically-generated license by visiting the [KDB-X Install page](https://developer.kx.com/products/kdb-x/install).*\r\n\r\n- **Docker**, with `docker compose` available. Refer to the [Docker installation](https://docs.docker.com/get-started/get-docker/) guide and the [`docker compose` installation](https://docs.docker.com/compose/install/) instructions.\r\n\r\n- **KDB-X installed**, if you'd like to interact with the service via q. Refer to the [KDB-X installation guide](https://code.kx.com/kdb-x/get_started/kdb-x-install.html) for instructions.\r\n\r\n## Configuring usage restrictions\r\n\r\nDB Service is configured by default to enforce the [usage restrictions](https://code.kx.com/insights/licensing/usage-restrictions.html) of the KDB-X Community Edition license. If you are not using Community Edition you should edit `.env` and delete the indicated variables (`DS_SM_MEM_LIMIT`, `DS_DA_MEM_LIMIT` and `DS_OTHER_MEM_LIMIT`) to disable the restrictions.\r\n\r\nIf you are using Community Edition you are permitted to edit these restrictions so long as you remain within the 16GB total limit. If you are running on a typical Linux system, the [systemd slice](#using-systemd-slices-for-community-edition-usage-limits) approach outlined below is more flexible.\r\n\r\n## Starting the DB Service\r\n\r\nThe DB Service runs as a containerized service and is distributed using Docker Compose.\r\n\r\nTo start the DB service:\r\n\r\n1. Clone this repo.\r\n\r\n2. Log in to the KX docker registry. If you don't already have an account, you can sign up for free at the [KX Developer Center](https://developer.kx.com). A login token can be created at https://portal.dl.kx.com/auth/token, if you need to generate a new one.\r\n\r\n```bash\r\nEMAIL=email@example.com\r\nBEARER=BEARERTOKEN\r\ndocker login -u $EMAIL -p $BEARER portal.dl.kx.com\r\n```\r\n\r\n3. Add your license to the `.env` file (see note above):\r\n\r\n```bash\r\nexport KDB_LICENSE_B64=LICENSE\r\n```\r\n\r\n4. Run the initialization script - this command initializes the database directories, and copies sample data to the import path:\r\n\r\n```bash\r\n./init-db.sh\r\n```\r\n\r\n5. Start the service:\r\n\r\n```bash\r\ndocker compose up -d\r\n```\r\n\r\n## Using the DB Service\r\n\r\nYou can connect to the DB Service using one of the following interfaces. There is a basic import and query workflow available in the documentation's [quickstart](https://code.kx.com/kdb-x/services/db-service/quickstart.html). Example notebooks are also bundled with the service.\r\n\r\n### q client\r\n\r\nDownload the q client from the [q client repo](https://github.com/KxSystems/kdbx-db-service-q-client) and load it into your q session.\r\n\r\n```q\r\ndbs:use`kx.dbservice_client\r\n```\r\n\r\nFull client documentation and usage examples are available in the [q client repo](https://github.com/KxSystems/kdbx-db-service-q-client).\r\n\r\n### Python client\r\n\r\nThe Python client can be installed directly from https://portal.dl.kx.com.\r\n\r\n```bash\r\npip install --pre --extra-index-url https://portal.dl.kx.com/assets/pypi/ kdbx_db_service_client\r\n```\r\n\r\nFull client documentation and usage examples are available in the [Python client repo](https://github.com/KxSystems/kdbx-db-service-python-client). For additional KDB-X Python installation and environment setup, refer to the [KDB-X Python install guide](https://code.kx.com/kdb-x/get_started/kdb-x-python-install.html).\r\n\r\n### REST API\r\n\r\nYou can interact with the DB Service using HTTP requests. Send requests to the service endpoint on port `8080`. For example:\r\n\r\n```bash\r\ncurl -X GET \"http://localhost:8080/api/v0/tables\"\r\n```\r\n\r\nFor full request and response examples, refer to the [OpenAPI documentation](https://code.kx.com/kdb-x/services/db-service/api/dbservice.html).\r\n\r\n## Example notebooks\r\n\r\nNotebooks are included in this repo with end-to-end examples using the q client, Python client, and cURL.\r\n\r\n- `notebooks/qClient_notebook.ipynb`\r\n- `notebooks/python_notebook.ipynb`\r\n- `notebooks/curl_notebook.ipynb`\r\n\r\n### Notebook setup\r\n\r\n1. Install the requirements into a virtual environment\r\n\r\n```bash\r\ncd notebooks\r\npython3 -m venv venv\r\nsource venv/bin/activate\r\npip install -r requirements.txt\r\n```\r\n\r\n2. Launch Jupyter\r\n\r\n```bash \r\njupyter lab\r\n```\r\n\r\nEnsure DB Service is running at `http://localhost:8080`, then open the URL printed by Jupyter.\r\n\r\n## Sample data feed\r\n\r\nThere is a sample data feed in the `samples/` directory, demonstrating how to use the Python RT library to send streaming data to the DB Service. To run the sample feed:\r\n\r\n1. Install dependencies\r\n\r\n```bash\r\ncd samples\r\npython3 -m venv venv\r\nsource venv/bin/activate\r\npip install -r requirements.txt\r\n```\r\n\r\n2. Start the feed \r\n\r\n```bash\r\npython3 fxfeed.py\r\n```\r\n\r\n## Using systemd slices for Community Edition usage limits\r\n\r\nIf you have root access and are on a systemd-based Linux system you can use its slices functionality to restrict the total memory usage of the whole service rather than the default approach of configuring individual limits. To enable it, run:\r\n\r\n```bash\r\nsudo cp kx-db-service.slice /etc/systemd/system/\r\n```\r\n\r\nThen edit `.env` and uncomment the line\r\n\r\n```\r\n#export DS_CGROUP_PARENT=kx-db-service.slice\r\n```\r\n\r\nYou should also disable the individual CE memory limits, as they are unnecessary when using the slice.\r\n\r\n## Resetting the service\r\n\r\n⚠️ Resetting the service permanently deletes all data and RT client logs, and re-initializes directories. If you need to reset the database, run:\r\n\r\n```bash\r\n docker compose down \r\n./reset-db.sh\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fkdbx-db-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkxsystems%2Fkdbx-db-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fkdbx-db-service/lists"}