|
| 1 | +--- |
| 2 | +title: SingleStore (Actions) Destination |
| 3 | +id: 6720ddceaa24532723b39d63 |
| 4 | +--- |
| 5 | + |
| 6 | +{% include content/plan-grid.md name="actions" %} |
| 7 | + |
| 8 | +[SingleStore](https://singlestore.com/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank”} 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. |
| 9 | +* **Real-Time Analytics:** Handle streaming and transactional data simultaneously with ultra-low latency. |
| 10 | +* **Advanced Data Science:** Run complex data science and machine learning models directly within the database. |
| 11 | +* **Seamless Integration:** Consolidate data from Segment and other sources to enable responsive, real-time experiences. |
| 12 | +* **Scalability:** Effortlessly support complex queries and high-velocity data without compromising on speed or cost efficiency. |
| 13 | + |
| 14 | +This destination is maintained by SingleStore. For any issues with the destination, [contact the SingleStore Support team](https://support.singlestore.com/){:target="_blank”}. |
| 15 | + |
| 16 | +## Getting started |
| 17 | + |
| 18 | +1. From your workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog){:target="_blank”} search for "SingleStore". |
| 19 | +2. Select "SingleStore" and click **Add Destination**. |
| 20 | +3. Select an existing Source to connect to SingleStore (Actions). |
| 21 | +4. Enter a name for your SingleStore (Actions) destination, update any additional settings, then click **Save**. |
| 22 | +6. Navigate to the Mappings tab for your SingleStore destination and click **New Mapping**. |
| 23 | +7. Select **Send Data**. |
| 24 | +8. In the Map fields section, select your database from the list presented. |
| 25 | +9. Click **Next** and then **Save**. |
| 26 | + |
| 27 | +{% include components/actions-fields.html %} |
| 28 | + |
| 29 | +### Finding your SingleStore connection settings |
| 30 | +To find your SingleStore connection settings, head to the [SingleStore Portal](https://portal.singlestore.com){:target="_blank”} and complete the following steps: |
| 31 | +1. Select **Deployments**. |
| 32 | +2. Choose your Workspace and Database within the list of Deployments |
| 33 | +3. 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. |
| 34 | + |
| 35 | +## Database structure |
| 36 | +Segment creates a table called `segment_raw_data` and writes data to your SingleStore database using the following schema: |
| 37 | + |
| 38 | +| Column | Type | Description | |
| 39 | +| -------- | ------ | ----------- | |
| 40 | +| `message` | JSON (utf8_bin) | The entire message received from Segment, in JSON format | |
| 41 | +| `timestamp` | datetime | The timestamp of when the event was generated | |
| 42 | +| `event` | VARCHAR(255) | The event name (for Track events) | |
| 43 | +| `messageId` | VARCHAR(255) | The unique identifier of the event to ensure there is no duplication | |
| 44 | +| `type` | VARCHAR(255) | The type of the event (for example, Identify, Track, Page, Group) | |
| 45 | + |
| 46 | + |
| 47 | +### Accessing nested data |
| 48 | +To query specific data from the Segment event within SingleStore, you can de-reference the JSON pointer within the message column. For example: |
| 49 | + |
| 50 | +```sql |
| 51 | +SELECT message::properties FROM segment_raw_data; |
| 52 | +``` |
| 53 | + |
| 54 | +This query retrieves the properties object from the JSON message, allowing you to work with nested event data. |
| 55 | + |
| 56 | +## Troubleshooting |
| 57 | + |
| 58 | +### Connection Errors |
| 59 | +If you're unable to connect to the SingleStore database: |
| 60 | +* Verify that the Host and Port are correct. |
| 61 | +* Ensure that your SingleStore database is accessible from Segment’s servers. |
| 62 | +* Check firewall settings and network configurations. |
| 63 | + |
| 64 | +### Authentication Failures |
| 65 | +If you encounter authentication errors when Segment attempts to connect: |
| 66 | +* Confirm that the Username and Password are correct. |
| 67 | +* Ensure that the user has the necessary permissions to write to the database. |
| 68 | + |
| 69 | +### Data Not Appearing in SingleStore |
| 70 | +If events are not recorded in the `segment_raw_data` table: |
| 71 | +* Verify that your sources are correctly sending data to Segment. |
| 72 | +* Check the event types to ensure they are supported. |
| 73 | +* Review your SingleStore database logs for any errors. |
| 74 | + |
| 75 | +## Frequently Asked Questions |
| 76 | +### Can I customize the schema used in SingleStore? |
| 77 | + |
| 78 | +By default, the mappings store the complete raw Segment events in the `segment_raw_data` table. If you prefer, within the mapping, you can choose to selectively include or exclude specific fields to be sent and written into SingleStore. |
| 79 | + |
| 80 | +### How does SingleStore handle data types from Segment? |
| 81 | + |
| 82 | +All event data is stored natively 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. |
| 83 | + |
| 84 | +### Is the data ingestion process real-time? |
| 85 | + |
| 86 | +Yes, Segment forwards data to SingleStore in real-time, enabling immediate analysis and action on your customer data. Generally data is available in the SingleStore database within a few seconds of Segment sending the event. |
0 commit comments