|
| 1 | +--- |
| 2 | +title: SingleStore (Actions) Destination |
| 3 | +--- |
| 4 | + |
| 5 | +{% include content/plan-grid.md name="actions" %} |
| 6 | + |
| 7 | +[<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 with Segment, you can ingest, analyze, and act on your customer data instantly, unlocking faster insights for your business. |
| 8 | +* **Real-Time Analytics:** Handle streaming and transactional data simultaneously with ultra-low latency. |
| 9 | +* **Advanced Data Science:** Run complex data science and machine learning models directly within the database. |
| 10 | +* **Seamless Integration:** Consolidate data from Segment and other sources to enable responsive, real-time experiences. |
| 11 | +* **Scalability:** Effortlessly support complex queries and high-velocity data without compromising on speed or cost efficiency. |
| 12 | + |
| 13 | +This destination is maintained by SingleStore. For any issues with the destination, [contact SingleStore Support team](https://support.singlestore.com/). |
| 14 | + |
| 15 | +## Getting started |
| 16 | + |
| 17 | +1. From your workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog){:target="_blank”} search for "SingleStore". |
| 18 | +2. Select "SingleStore" and click **Add Destination**. |
| 19 | +3. Select an existing Source to connect to SingleStore (Actions). |
| 20 | +4. Enter the settings to connect to your SingleStore instance |
| 21 | +5. Click "Save" |
| 22 | +6. Now go to your "Mappings" and click "New Mapping" |
| 23 | +7. Select "Send Data" |
| 24 | +8. Within "Map fields", select your database from the list presented |
| 25 | +9. Click "Next" and then "Save" |
| 26 | +10. Voila! Your data should start flowing into your SingleStore database within moments. |
| 27 | + |
| 28 | +{% include components/actions-fields.html %} |
| 29 | + |
| 30 | +### Finding your SingleStore connection settings |
| 31 | +You can generally find your SingleStore connection settings by heading to the [SingleStore Portal](https://portal.singlestore.com) and following these steps: |
| 32 | +1. Select "Deployments" |
| 33 | +2. Choose your Workspace and Database within the list of Deployments |
| 34 | +3. Click "Connect" dropdown |
| 35 | +4. Choose Connect to your own app and that will provide the key settings |
| 36 | + |
| 37 | +## The database structure |
| 38 | +Segment creates a table called `segment_raw_data` and writes data to your SingleStore database using the following schema. |
| 39 | + |
| 40 | +### Columns in the segment_raw_data table |
| 41 | +|Column| Type |Description| |
| 42 | +|-|-|-| |
| 43 | +|`message`| JSON (utf8_bin)| The entire message received from Segment in JSON format| |
| 44 | +|`timestamp`| datetime| The timestamp of when the event was generated| |
| 45 | +|`event`| VARCHAR(255)| The event name (for Track events)| |
| 46 | +|`messageId`| VARCHAR(255)| The unique identifier of the event to ensure there is no duplication| |
| 47 | +|`type`| VARCHAR(255)| The type of the event (e.g., identify, track, page, group)| |
| 48 | + |
| 49 | + |
| 50 | +### Accessing Nested Data |
| 51 | +To query specific data from the Segment event within SingleStore, you can de-reference the JSON pointer within the message column. For example: |
| 52 | +``` |
| 53 | +SELECT message::properties FROM segment_raw_data; |
| 54 | +``` |
| 55 | +This query retrieves the properties object from the JSON message, allowing you to work with nested event data. |
| 56 | + |
| 57 | +## Troubleshooting |
| 58 | + |
| 59 | +### Connection Errors |
| 60 | +**Issue:** Unable to connect to the SingleStore database. |
| 61 | + |
| 62 | +**Solution:** |
| 63 | +* Verify that the Host and Port are correct. |
| 64 | +* Ensure that your SingleStore database is accessible from Segment’s servers. |
| 65 | +* Check firewall settings and network configurations. |
| 66 | + |
| 67 | +### Authentication Failures |
| 68 | +**Issue:** Authentication errors when Segment attempts to connect. |
| 69 | + |
| 70 | +**Solution:** |
| 71 | +* Confirm that the Username and Password are correct. |
| 72 | +* Ensure that the user has the necessary permissions to write to the database. |
| 73 | + |
| 74 | +### Data Not Appearing in SingleStore |
| 75 | +**Issue:** Events are not being recorded in the segment_raw_data table. |
| 76 | + |
| 77 | +**Solution:** |
| 78 | +* Verify that your sources are correctly sending data to Segment. |
| 79 | +* Check the event types to ensure they are supported. |
| 80 | +* Review your SingleStore database logs for any errors. |
| 81 | + |
| 82 | +## Frequently Asked Questions |
| 83 | +### Can I customize the schema used in SingleStore? |
| 84 | + |
| 85 | +By default, the mapping is predefined to 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. |
| 86 | + |
| 87 | +### How does SingleStore handle data types from Segment? |
| 88 | + |
| 89 | +All event data is stored natively as JSON within 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. |
| 90 | + |
| 91 | +### Is the data ingestion process real-time? |
| 92 | + |
| 93 | +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