This post describes an important enhancement to Squonk Viz that greatly improves scalability and performance. Data is now stored in a PostgreSQL database running the RDKit cartridge which allows datasets of millions of structures to be used, and provides advanced chemistry functionality like structure search and molecular property predictions.
Early versions of Squonk Viz parsed the data files (typically SD-files or CSV files with SMILES) and that happened in the browser. This performed reasonably well, but clearly had limitations in scale and was not very efficient. Instead of this we now have what we refer to as the “Data Centre” which is essentially a PostgreSQL database with each dataset being a table. Each Squonk project gets its own database schema keeping the data from different projects isolated.
This approach has a number of important benefits
Indexing the structures is optional. It’s only needed if you want to use structure search.
Here is an example of using structure search:

And here is an example of calculating molecular properties:

Here are some sample timings for a number of important operations with various sizes of data. Import and Index are one-time operations - once done they don’t need repeating. The search times are for substructure search and are an average of 3 searches, not including the first search which takes a little longer as the index is being loaded into memory.
| num molecules | import | index | search |
|---|---|---|---|
| 35,090 | 34s | 1m 53s | 0.22s |
| 350,900 | 5m 31s | 12m 24s | 1.65s |
| 1,017,610 | 10m 50s | 28m 09s | 14.1s |
The search timing for the biggest set is not actually optimal as the hardware used for the database is quite modest. More memory (especially shared_buffers), faster I/O and more CPU cores would make it a bit faster, but even as it is it’s pretty respectable.
You can access Squonk here.