SingleStore (Actions) Destination
SingleStore 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.
- From your workspace's Destination catalog page search for "SingleStore".
- Select "SingleStore" and click Add Destination.
- Select an existing Source to connect to SingleStore (Actions).
- Enter a name for your SingleStore (Actions) destination, update any additional settings, then click Save.
- Navigate to the Mappings tab for your SingleStore destination and click New Mapping.
- Select Send Data.
- In the Map fields section, select your database from the list presented.
- Click Next and then Save.
The name of the database.
The host of the SingleStore database.
The password of the SingleStore database.
Optional
The port of the SingleStore Data API. Defaults to 443.
The name of the table. Defaults to "segment_data".
The username of the SingleStore database.
Build your own Mappings. Combine supported triggers with the following SingleStore-supported actions:
Mapping limits per destination
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"
A unique identifier for the message.
The timestamp of the event.
The type of the event (e.g., "track", "identify", "page", "screen", "group", "alias").
Optional
The name of the event. Only required for "track" events.
Optional
The name of the page or screen.
Optional
The properties of the track, page or screen event.
Optional
The user ID associated with the event.
Optional
The anonymous ID associated with the event.
Optional
The group ID associated with the event.
Optional
The traits of the user associated with the event.
Optional
The context of the event. Contains user environment information.
The maximum number of rows to include in a batch.
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:
- Head to the SingleStore Portal.
- Select Deployments.
- Choose your Workspace and Database within the list of deployments.
- 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.
Segment writes data to your specified table in SingleStore (by default, this is segment_data) using the following schema:
| Column | Type | Description |
|---|---|---|
messageId | TEXT | A unique identifier for the event to ensure there is no duplication. |
timestamp | Datetime(6) | The timestamp of when the event was generated |
type | TEXT | The type of the event (for example, Track, Identify, Page, Screen, Group, or Alias). |
event | TEXT | The name of the event. Only required for Track events. |
name | TEXT | The name of the page or screen. |
properties | JSON | The properties of the Track, Page or Screen event. |
userId | TEXT | The user ID associated with the event. |
anonymousId | TEXT | The anonymous ID associated with the event. |
groupId | TEXT | The group ID associated with the event. |
traits | JSON | The traits of the user associated with the event. |
context | JSON | The 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.
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.
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.
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.
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.
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.
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.
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.
The name of the database.
The host of the SingleStore database.
The password of the SingleStore database.
Optional
The port of the SingleStore Data API. Defaults to 443.
443The name of the table. Defaults to "segment_data".
segment_dataThe username of the SingleStore database.