SingleStore Notebook: New Features for Analytics, Machine Learning & Data Exploration

Clock Icon

4 min read

Pencil Icon

Apr 11, 2023

SingleStore Notebook: New Features for Analytics, Machine Learning & Data Exploration

We are excited to announce the launch of our new Notebook feature, which allows you to perform complex analytics, machine learning and data exploration tasks with ease and flexibility.

what-are-notebooksWhat Are Notebooks?

Notebooks are interactive web-based tools that allow users to create and share documents containing live code, visualizations and narrative text. They have become increasingly popular in the data science community as they provide an efficient way to explore, analyze and visualize data, making it easier to communicate insights and results.

SingleStore's Notebook feature is based on the popular Jupyter Notebook, which is widely used in data science and machine learning communities. The SingleStore Notebook extends the capabilities of Jupyter Notebook to enable data professionals to easily work with SingleStore's distributed SQL database while providing great extensibility in language and data sources.

key-features-of-single-store-notebookKey Features of SingleStore Notebook

The new SingleStore Notebook feature offers several key capabilities that make it a powerful tool for data exploration and analysis:

Native SingleStore SQL Support. The SingleStore Notebook allows users to query SingleStore's distributed SQL database directly from within the notebook interface — without having to define any connection string, enabling a faster and more efficient way to do data exploration and analysis. Overall, it’s more secure and simpler.

For example, in a regular notebook, you would have to use the following code:

UserName='admin'
Password='MyPassword'
DatabaseName='MyDatabase'
URL='svc-11138a4....singlestore.com:3306'
db_connection_str =
"mysql+pymysql://"+UserName+":"+Password+"@"+URL+"/"+DatabaseName
db_connection = create_engine(db_connection_str)

In SingleStoreDB, you only need to select a default database and the following:

db_connection = create_engine(connection_url)

SQL/Python Interoperability. Using SQL and Python interoperability is important so that you can query a database, using the output in a Python data frame and vice versa.

When you query a SingleStoreDB, you can use the following in a cell:

%%sql result1 <<
USE test;
SELECT * from MyTable

And use result1 output in a Pandas dataframe:

df = pd.DataFrame(result1)


Collaborative Workflows. Users can save and share Notebooks with other team members, allowing for collaborative data analysis and exploration. You can save your Notebook in your personal folder, or share it with other members in your organization.

Interactive Data Visualization: The Notebook feature includes support for popular data visualization libraries, like Matplotlib and Plotly, enabling users to create interactive charts and graphs directly within the notebook.

Using SingleStore Notebook

For more details on how to use Notebooks, check our documentation page. You can create your notebook from our portal experience with two entry points as highlighted in the following image:

As a first use, we recommend using our Notebook’s templates:

  • How to Use Notebooks. This will help you learn the basic concepts of our Notebooks
  • Getting Started with Notebook: You will access a public repo, ingesting that data into SingleStoreDB in just a few cells — and run some aggregates with SQL, visualizing the output as a Pandas dataframe.
  • Image Matching: You will go over a scenario where you can see how our vectorized function works in a matching picture. First, you will have a scenario where you select a picture from celebrities and see which ones it matches the most. Then, you will have a cell where you can upload your picture and see which one you match the most. Note: We only use 7,000 vectorized pictures in the template, so matching quality is limited.

You can see how my colleague Eric Hanson looks similar to Anthony Fauci 🙂

moving-forwardMoving Forward

Our team is dedicated to further enhancing the capabilities and experience of Notebooks by implementing functions like import/export, set default language and code auto-completion, among others. We are also planning to create a gallery of Notebooks featuring end-to-end scenarios — and introducing bot capabilities to facilitate the writing of SQL or Python code in SingleStoreDB (stay tuned for more). Longer-term, we will be adding support for more languages and simplifying data visualization with no/low-code.

Finally, we look to streamline the process of prototyping your Python code in SingleStoreDB Notebooks, integrating it into the database as stored procedures.


Interested in testing the full power of Notebooks? Try SingleStoreDB free today.


Share