Three years ago SAS and Singlestore signed a partnership agreement that allowed SAS to utilize the Singlestore database as an modern data storage and processing layer in SAS Viya. The result of this was the SAS offering SAS Viya with Singlestore that brings an unique combination of speed, optimized storage, real-time and multi datatype support to Viya. We have just signed a new partnership agreement with Singlestore that both secure our offering and opens up for other use-cases of Singlestore within SAS.
Singlestore Free
If you are curious to what Singlestore is and how it works, you should test it out. They have an offering called Singlestore Free that gives you a free database to christmas and you can use it to whatever you want, even production workloads. The limitation is that has some limitations on cpu, max 10 tables and 1GB of compressed storage.
To test it out go to portal.singlestore.com and create a user and you have your database available in the portal. It should look like this:
Creating your free Singlestore database
- Click on "Get started now" to get your own free database
- fill in the name of your workspace.
- keep the proposed database name.
- Click on "Create Starter Workspace" in the bottom right corner
- Select data studio to get started
Now, you can either play around with Singlestore within their portal, either using the SQL editor or their Python Notebook. Here you can find a lot of good examples in different notebooks doing traditional task like importing data using Singlestore pipelines or build AI applications utilizing Singlestore as a combined vector and full text search database as some cool examples. The examples are stored under the "Gallery" tab.
Running notebooks from the Singlestore portal
As a SAS user you might want to test out Singlestore from your Viya platform or maybe your SAS Viya Workbench, with Singlestore Free you can do just that. You can not test all the special SAS-Singlestore integration features, but you get a good feeling of how well the database work.
Connecting from Viya
To connect to Singlestore from Viya you need to create a libname or caslib. Here I will show the code for the libname. First you need to download the sertificate from Singlestore and upload it to your Viya environment. In Singlestore select "Deployments" and click on connect and SQL IDE. Here you will find all the connect information you need and the certificate. Click on the "certificate" link to download the certificate. and upload it to Viya.
logon information and certificate download
Now you are ready to make your connection. Use this example code and replace the hostname, database, user and password to fit your database.
%let MYHOST='svc-3482219c-a389-4079-b18b-d50662524e8a-shared-dml.aws-virginia-6.svc.singlestore.com';
%let myport=3333;
%let dbmax_text=32767;
libname mydb s2
host=&myhost
port=&myport
database=db_jonas_1572b
user=workbench
password=xxxxxxx
dbmax_text=&dbmax_text
RESULTS=server
bulkload=yes
dbclient_max_bytes=1
ssl_ca="/srv/nfs/kubedata/compute-landingzone/S2test/singlestore_bundle.pem";
Now, you can use this libname as just a normal libname. I encourage you to test the query speed.
Connecting from Viya Workbench
You might prefer to use python, either Viya workbench or another Python environment. Here you can also quite easily connect to Singlestore and both use the database to store data as well as explore all the generative AI related example notebooks available to build your own first gen AI application. I recommend to check out this article to get started with connecting to your database: https://www.singlestore.com/spaces/integrating-pandas-with-single-store-db/
If you have any question related to the use of Singlestore and SAS together just contact me. The last years I have had the chance to work a lot with this cool partnership.