Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

SingleStore (Actions) Destination


Destination Info
  • Accepts Page, Alias, Group, Identify and Track calls.
  • Refer to it as Singlestore, or SingleStore in the Integrations object
  • This integration is partner owned. Please reach out to the partner's support for any issues.

SingleStore(link takes you to an external page) is a high-performance, cloud-native database designed for real-time analytics and applications. By integrating SingleStore and Segment, you can ingest, analyze, and act on your customer data instantly, unlocking faster insights for your business.

  • Real-Time Analytics: Handle streaming and transactional data simultaneously with ultra-low latency.
  • Advanced Data Science: Run complex data science and machine learning models directly within the database.
  • Seamless Integration: Consolidate data from Segment and other sources to enable responsive, real-time experiences.
  • Scalability: Effortlessly support complex queries and high-velocity data without compromising on speed or cost efficiency.

This destination is maintained by SingleStore. For any issues with the destination, contact the SingleStore Support team(link takes you to an external page).


Getting started

getting-started page anchor
  1. From your workspace's Destination catalog page(link takes you to an external page) search for "SingleStore".
  2. Select "SingleStore" and click Add Destination.
  3. Select an existing Source to connect to SingleStore (Actions).
  4. Enter a name for your SingleStore (Actions) destination, update any additional settings, then click Save.
  5. Navigate to the Mappings tab for your SingleStore destination and click New Mapping.
  6. Select Send Data.
  7. In the Map fields section, select your database from the list presented.
  8. Click Next and then Save.

Property nameTypeRequiredDescription
Database Namestring
required

The name of the database.


Hoststring
required

The host of the SingleStore database.


Passwordpassword
required

The password of the SingleStore database.


Portstring

Optional

The port of the SingleStore Data API. Defaults to 443.


Table Namestring
required

The name of the table. Defaults to "segment_data".


Usernamestring
required

The username of the SingleStore database.


Build your own Mappings. Combine supported triggers with the following SingleStore-supported actions:

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Send Data

send-data page anchor

Send data to SingleStore.

Send Data is a Cloud action. The default Trigger is type = "track" or type = "screen" or type = "identify" or type = "page" or type = "group" or type = "alias"

Property nameTypeRequiredDescription
Message IDSTRING
required

A unique identifier for the message.


TimestampSTRING
required

The timestamp of the event.


TypeSTRING
required

The type of the event (e.g., "track", "identify", "page", "screen", "group", "alias").


EventSTRING

Optional

The name of the event. Only required for "track" events.


NameSTRING

Optional

The name of the page or screen.


PropertiesOBJECT

Optional

The properties of the track, page or screen event.


User IDSTRING

Optional

The user ID associated with the event.


Anonymous IDSTRING

Optional

The anonymous ID associated with the event.


Group IDSTRING

Optional

The group ID associated with the event.


TraitsOBJECT

Optional

The traits of the user associated with the event.


ContextOBJECT

Optional

The context of the event. Contains user environment information.


Max Batch SizeNUMBER
required

The maximum number of rows to include in a batch.

Finding your SingleStore connection settings

finding-your-singlestore-connection-settings page anchor

To connect Segment to SingleStore, use the SingleStore Data API (typically on port 443). Follow these steps to enable and locate your Data API connection settings:

  1. Head to the SingleStore Portal(link takes you to an external page).
  2. Select Deployments.
  3. Choose your Workspace and Database within the list of deployments.
  4. From the Connect dropdown, select Connect to your own app. SingleStore will display the the key settings you need to connect your SingleStore database to Segment.

Note:

  • The Data API is enabled by default for all SingleStore Cloud workspaces.
  • Segment always uses the Data API (typically on port 443).
  • If you use a self-hosted or development SingleStore deployment (such as the SingleStore-dev image), the Data API may run on a different port. Refer to your deployment's documentation or settings to confirm the correct port.

For more information, see the SingleStore Data API documentation(link takes you to an external page).


Segment writes data to your specified table in SingleStore (by default, this is segment_data) using the following schema:

ColumnTypeDescription
messageIdTEXTA unique identifier for the event to ensure there is no duplication.
timestampDatetime(6)The timestamp of when the event was generated
typeTEXTThe type of the event (for example, Track, Identify, Page, Screen, Group, or Alias).
eventTEXTThe name of the event. Only required for Track events.
nameTEXTThe name of the page or screen.
propertiesJSONThe properties of the Track, Page or Screen event.
userIdTEXTThe user ID associated with the event.
anonymousIdTEXTThe anonymous ID associated with the event.
groupIdTEXTThe group ID associated with the event.
traitsJSONThe traits of the user associated with the event.
contextJSONThe context of the event. Contains user environment information.

To query nested information from the traits, context, or properties JSON columns, use the :: operator to access nested properties within the JSON column. For example:

To extract a property1 from the properties column:

SELECT properties::property1 AS property_1 FROM <your_table_name>;

This query allows you to extract specific nested properties from the JSON column for analysis.


(information)

Request size limit

The SingleStore Data API has a limit of 1MB per request. If a batch of events sent by Segment exceeds this limit, you may see an error similar to:

Error reading request body: http: request body too large

If you encounter this error, reduce the batch size in your Segment destination settings.

If you're unable to connect to the SingleStore database:

  • Verify that the credentials are correct.
  • Ensure that your SingleStore database is accessible from Segment's servers.
  • Check firewall settings and network configurations.

If you encounter authentication errors when Segment attempts to connect:

  • Confirm that the Username and Password are correct.
  • Ensure that the user has the necessary permissions to write to the database.

Data not appearing in SingleStore

data-not-appearing-in-singlestore page anchor

If events are not recorded in the specified table:

  • Verify that your sources are correctly sending data to Segment.
  • Check the event types to ensure they are supported.
  • Review your SingleStore database logs for any errors.

Frequently asked questions

frequently-asked-questions page anchor

Can I customize the schema used in SingleStore?

can-i-customize-the-schema-used-in-singlestore page anchor

By default, the mapping stores all fields from the Segment event in separate columns in the segment_data table. If you prefer, you can customize the mapping to selectively include or exclude specific fields to be sent and written into SingleStore.

How does SingleStore handle data types from Segment?

how-does-singlestore-handle-data-types-from-segment page anchor

Event data is stored as JSON in the message column. This allows for flexible schema management and easy access to nested properties using SQL queries. SingleStore's ability to dynamically and quickly parse the JSON allows all types of complex events to be queried or used in notebooks.

Is the data ingestion process real-time?

is-the-data-ingestion-process-real-time page anchor

Yes, Segment forwards data to SingleStore in near real-time, enabling immediate analysis and action on your customer data. Generally, data is available in the SingleStore database within approximately 30 seconds of Segment sending the event.


You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo(link takes you to an external page).

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

(information)

Real-time to batch destination sync frequency

Real-time audience syncs to SingleStore (Actions) may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
Database Namestring
required

The name of the database.


Hoststring
required

The host of the SingleStore database.


Passwordpassword
required

The password of the SingleStore database.


Portstring

Optional

The port of the SingleStore Data API. Defaults to 443.

Default: 443

Table Namestring
required

The name of the table. Defaults to "segment_data".

Default: segment_data

Usernamestring
required

The username of the SingleStore database.