SingleStore’s June 23 event didn’t just launch the world’s only hybrid multi-cloud, unified analytical and transactional database. We also unveiled our first Innovation Center in Raleigh, NC. We call it the SingleStore Launch Pad, with a mission to reduce the friction that slows organizations’ digital transformation efforts and their overall quest to become more data driven.
At the event, Bailey Hayes, Principal Software Engineer, talked about some of the work the Launch Pad team is doing to co-locate analytics with data.co-locate analytics with data. In this blog, the second of a two-part series on the launch event, we recap the live demo Bailey gave in conversation with Oliver Schabenberger, SingleStore’s Chief Innovation Officer and head of the Innovation Center. Watch the demo on our YouTube channel.
Welcome to WASM
In Raleigh, Bailey and the Launch Pad team are working to bring universal language support to SingleStore’s database engine—to user-defined functions, to be exact. “We’re using a new technology called Web Assembly, or WASM,” Bailey explained. She said many languages can be compiled to WASM (rhymes with “chasm”), which she described as “an Assembly-like language that targets a stack virtual machine. The idea is that with WASM, we can write once and run anywhere.”
“That sounds like nirvana,” Oliver said. “Maybe!” Bailey replied. On the webinar, the emojis flew as attendees giggled.
Bringing ML to the data
Bailey continued, “You can program in any language, compile it into WASM and run anywhere, on any OS, on any host in any environment. It’s not just for the web.” WASM is being used for support for serverless functions in software applications, “so, if you think about serverless functions and how they maybe relate to maybe a database, you might think that user defined functions are really similar to serverless functions,” she said, making the connection.
With SingleStore’s early-stage application programming interface (API), Bailey said, “the idea is that you can create a WASM module, let the database know about it, and create additional functions off of that module that are exported on the WASM function.”
Oliver asked what can be put in the module. “Great question! You can use machine learning [ML] algorithms to deploy models at scale, in production, next to your data,” Bailey answered. She gave a quick example, a model that queried, ‘If I offer a discount, which users are going to continue subscribing to my service?’
The “moon shot”
Oliver extrapolated, “We don’t care what language the model is written in, or how it came about, in C, Python, or Rust. It also can be any logic, it does not have to be a machine learning model. It just has to compile to WASM. That’s the moon shot.”
How close are we? Bailey showed us with a live demo. She started with a Rust script that adds two integers together—“the ‘hello world’ of WASM,” she chuckled—that she compiled to WASM and was able to add in select queries within the database. Then she upped the ante with a demo that showed how to go from model language directly into the database.
Here, Bailey used a data set of 3 classes of a type of iris flower, a popular classification problem.
Using measurements of key flower parts (such as sepals and petals) Bailey wanted to see if the machine learning model would properly classify an iris. She used an open source library to build a gradient boosting model with decision trees and deployed the model in the WASM module.
The model correctly classified the data to indicate the species Iris Virginica. “What’s amazing is that I’m not a data scientist,” Bailey said. She took the ML model, which was developed in Rust, and ported it into the WASM module safely, securely and performantly––a breakthrough in empowering business users to directly analyze data without scarce specialized programming resources. ”What’s next?” Oliver asked.
“This is just the beginning,” Bailey enthused. “This is just a prototype. Imagine that you can ingest data using pipelines from SingleStore, transform data with any utility function, and use any business library you’ve already written, such as in JSON. You could leverage that existing code with the jq utility and transform that data. Really, the possibilities are endless.”
To learn more about SingleStore’s exciting work with WASM, check out the singlestore-labs org on GitHub, and reach out to Bailey via the SingleStore Developers LinkedIn or Twitter pages. Her parting thought on SingleStore’s exciting announcement? “Join us, we’re hiring!”
Watch the entire demo on YouTube.