Data API

On this page

SingleStore provides the Data API to execute SQL statements against your database over an HTTP connection. The Data API can be used to integrate SingleStore with serverless architecture, develop custom applications, and build seamless integrations with applications.

SingleStore's Data API is authenticated to the server using the HTTP Basic and Bearer Authentication standards, which must be used in conjunction with SSL (HTTPS) for secure communication over the network. The Data API uses standard HTTP methods and response codes and supports URI versioning. It also uses JSON-encoded responses with support for conventional data type conversions. The Data API is accessible via a built-in HTTP server.

The Data API supports all SQL statements that can be run in a direct database connection with SingleStore Helios. To learn about the supported Data API endpoints, refer to Data API Endpoint Reference.

The Data API can support concurrent requests up to the value of the max_connection_threads engine variable. Refer to List of Engine Variables for more information.

SingleStore does not recommend updating or managing session-related entities using the Data API, for example, temporary tables, session variables, etc. Temporary tables created using the Data API are not automatically dropped when a connection is closed. Hence, you must explicitly drop any temporary tables created using the Data API before closing a connection (from within the same connection). To drop any temporary tables that exist after the connection is closed, kill the connection associated with that temporary table using the following commands:

-- Obtain the connection ID for the temporary table --
SHOW TEMPORARY TABLES;
-- Use the connection ID to kill the connection --
KILL CONNECTION <conn_ID>;

FAQs

  • Is this a REST API?

    No, the Data API is a JSON-based SQL API.

  • Is there a limit on the request body size?

    The request body size must not exceed 1MB.

  • Is there a limit on the response size?

    The response is streamed not buffered. There are no limits explicitly set on the response size.

  • How many concurrent requests are supported by the Data API?

    The Data API can process up to 192 requests in parallel per aggregator, which is the default value for the max_connection_threads engine variable. To support additional requests, you can increase the value of this engine variable up to the maximum value supported by the database engine.

  • Does it support API pagination?

    By itself, the Data API does not implement any logic to handle pagination. However, users can build pagination into the queries they send to the API.

In this section

Last modified: August 3, 2023

Was this article helpful?