Antfly Data Operations API

Perform data operations including batch inserts/deletes, linear merge sync, backup/restore, and individual key lookups. ## Batch Operations Efficiently insert or delete multiple documents in a single request. The batch endpoint accepts both inserts (map of key-value pairs) and deletes (array of keys). ## Distributed Transactions Antfly provides atomic cross-shard write transactions using a coordinator-based 2-phase commit (2PC) protocol. When a batch operation spans multiple shards, Antfly automatically executes it as a distributed transaction. **How it works:** 1. Metadata server allocates HLC timestamp and selects coordinator shard 2. Coordinator writes transaction record, participants write intents 3. After all intents succeed, coordinator commits transaction 4. Participants are notified asynchronously to resolve intents 5. Recovery loop ensures notifications complete even after coordinator failure **Features:** - **Automatic**: No special API required - just use the batch endpoint - **Atomic**: All writes across all shards commit or abort together - **Recoverable**: Coordinator failures are handled via recovery loops - **Efficient**: ~20ms latency for cross-shard transactions **Performance:** - Single-shard batches: < 5ms latency - Cross-shard transactions: ~20ms latency - Intent resolution: < 30 seconds worst-case (via recovery loop) **Guarantees:** - All writes succeed or all fail (atomicity) - Coordinator failure is recoverable (new leader resumes notifications) - Idempotent resolution (duplicate notifications are safe) **Use Cases:** - Updating related records across shards (e.g., user profile + preferences) - Multi-table inserts that must succeed together - Bulk imports requiring all-or-nothing semantics ## Linear Merge (Data Sync) Synchronize and keep Antfly in sync with external data sources like Shopify, Postgres, S3, or any sorted record source. Also known as: data synchronization, database sync, incremental sync, e-commerce sync. Both source and Antfly must be sorted by the same key. Performs three-way merge: inserts new records, updates changed records, deletes records absent from source. **How it works:** 1. Query external source with pagination (sorted by key) 2. Send sorted page to linear merge endpoint 3. Antfly merges: upserts present records, deletes Antfly records absent from page 4. Repeat for next page - no sync state required between pages **Use Cases:** - **Postgres/MySQL**: `SELECT * FROM products ORDER BY id LIMIT 1000 OFFSET 0` - Sync production DB to Antfly for hybrid search - Run periodically (hourly/daily) to stay in sync - **Shopify API**: `GET /admin/api/2024-01/products.json?order=id&limit=250` - Sync e-commerce catalog with cursor pagination - Antfly becomes searchable product index - **S3 Data Lake**: Sorted JSON files (`data/0001.json`, `data/0002.json`, ...) - Batch import from data warehouse exports - Process files in order, send contents page by page - **Databricks**: `SELECT * FROM delta_table ORDER BY key LIMIT 10000` - Sync data warehouse tables to Antfly - Enable low-latency search over warehouse data **Benefits:** - **Stateless**: No cursors or checkpoints - restart from any page - **Idempotent**: Safe to re-run if interrupted - **Efficient**: Stream comparison, no random access needed **WARNING**: Not safe for concurrent merges with overlapping ranges. Single-client sync API only. ## Backup and Restore Create backups to various storage backends: - `file:///path/to/backup` - Local filesystem - `s3://bucket/path` - Amazon S3 Restore operations rebuild tables from backup snapshots. ## Key Lookups Direct key-value lookups for retrieving individual documents by their unique key.

Operations 60

POST /db/v1/batch Cross-table batch operations #
POST /db/v1/transactions/commit Commit an OCC transaction #
GET /db/v1/transactions List transaction sessions #
POST /db/v1/transactions/cleanup Clean up expired transaction sessions #
POST /db/v1/transactions/begin Begin a transaction session #
GET /db/v1/transactions/{transaction_id} Get transaction session details #
POST /db/v1/transactions/{transaction_id}/stage Stage a transaction commit request #
POST /db/v1/transactions/{transaction_id}/read Stage a transaction read version #
POST /db/v1/transactions/{transaction_id}/write Stage a transaction write #
POST /db/v1/transactions/{transaction_id}/delete Stage a transaction delete #
POST /db/v1/transactions/{transaction_id}/savepoints Create a transaction savepoint #
POST /db/v1/transactions/{transaction_id}/savepoints/{savepoint_id}/rollback Roll back a transaction session to a savepoint #
POST /db/v1/transactions/{transaction_id}/commit Commit a transaction session #
POST /db/v1/transactions/{transaction_id}/abort Abort a transaction session #
POST /db/v1/sql/connections Open a durable idle HTTP SQL connection #
DELETE /db/v1/sql/connections/{connection_id} Close an idle SQL connection and its prepared resources #
POST /db/v1/sql/prepared Create a durable prepared SQL resource #
POST /db/v1/sql/prepared/{prepared_id}/execute Execute a durable prepared SQL resource #
DELETE /db/v1/sql/prepared/{prepared_id} Release a durable prepared SQL resource #
POST /db/v1/sql Execute a SQL statement #
GET /db/v1/tables/{tableName}/constraints/status Read distributed UNIQUE, foreign-key, and CHECK validation coverage #
POST /db/v1/tables/{tableName}/constraints/repair Repair version-conditional rows after failed or diagnosed constraint activation #
POST /db/v1/tables/{tableName}/constraints/retry Restart failed UNIQUE/FK/CHECK validation after administrative repair #
POST /db/v1/tables/{tableName}/constraints/retire Retire unique and foreign-key definitions safely #
POST /db/v1/tables/{tableName}/rows/query Query projected typed relational rows #
POST /db/v1/tables/{tableName}/rows/mutate Atomically replace or delete version-conditional typed rows #
POST /db/v1/tables/{tableName}/batch Perform batch inserts and deletes on a table #
POST /db/v1/tables/{tableName}/merge Synchronize data from external sources (Shopify, Postgres, S3) using a linear… #
POST /db/v1/tables/{tableName}/backup Backup a table #
POST /db/v1/tables/{tableName}/restore Restore a table from backup #
POST /db/v1/tables/{tableName}/documents Scan documents in a table within a key range #
GET /db/v1/tables/{tableName}/documents/{key} Retrieve a document by key #
GET /db/v1/tables/{tableName}/documents/{key}/artifacts List derived document artifact manifests #
POST /db/v1/tables/{tableName}/repair/issues List table repair issues #
POST /db/v1/tables/{tableName}/storage/migrations Create or resume a table storage migration job #
GET /db/v1/tables/{tableName}/storage/migrations/{jobId} Read a table storage migration receipt #
POST /db/v1/tables/{tableName}/storage/migrations/{jobId} Advance, publish or cancel a table storage migration job #
POST /db/v1/tables/{tableName}/repair/run Run a bounded table repair pass #
POST /db/v1/tables/{tableName}/repair/jobs Start a durable table repair job #
POST /db/v1/tables/{tableName}/repair/control-jobs Start a durable index control job #
GET /db/v1/tables/{tableName}/repair/jobs/{jobId} Get a table repair job #
POST /db/v1/tables/{tableName}/repair/jobs/{jobId}/advance Advance a table repair job #
POST /db/v1/tables/{tableName}/repair/jobs/{jobId}/cancel Cancel a table repair job #
POST /db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess Reprocess a derived artifact across a table range #
POST /db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs Create a derived document artifact reprocess job #
GET /db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId} Get derived document artifact reprocess job status #
POST /db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId}/advance Advance a derived document artifact reprocess job #
POST /db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId}/cancel Cancel a derived document artifact reprocess job #
GET /db/v1/tables/{tableName}/documents/{key}/artifacts/{artifactName} Inspect a derived document artifact manifest #
POST /db/v1/tables/{tableName}/documents/{key}/artifacts/{artifactName}/reprocess Reprocess a derived artifact #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/batch Perform batch inserts and deletes on an explicit namespace table #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/backup Backup an explicit namespace table #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/restore Restore an explicit namespace table from backup #
GET /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/documents/{key} Retrieve a document by key from an explicit namespace table #
GET /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/constraints/status Read distributed UNIQUE, foreign-key, and CHECK validation coverage #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/constraints/repair Repair version-conditional rows after failed or diagnosed constraint activation #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/constraints/retry Restart failed UNIQUE/FK/CHECK validation after administrative repair #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/constraints/retire Retire unique and foreign-key definitions safely #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rows/query Query projected typed relational rows #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rows/mutate Atomically replace or delete version-conditional typed rows #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/antfly:antfly-data-operations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

antfly-data-operations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Antfly Public Data Operations API
  version: v1alpha1
  description: Joined public contract for the Antfly server. Antfly APIs are served under `/db/v1`, auth APIs under `/auth/v1`, inference APIs under `/ai/v1`, ML prediction APIs under `/ml/v1`, and extension lifecycle APIs under `/extensions/v1`.
servers:
- url: /
security:
- BasicAuth: []
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: data_operations
  x-displayName: Data Operations
  x-docsaf-questions:
  - How do distributed transactions work in Antfly?
  - How do I sync data from Postgres or Shopify?
  - What's the difference between batch operations and linear merge?


# --- truncated at 32 KB (276 KB total) ---
# Full source: https://artifacts.apis.io/antfly/openapi/antfly-data-operations-api-openapi.yml