sonic is a free, open source databases project written in Rust and released under MPL-2.0. It has 21,342 GitHub stars, 618 forks and 63 open issues, and was last pushed 3 days ago. On this registry it ranks #31 of 143 tracked projects in Databases, with 5 head-to-head comparisons available.

What is sonic?

Sonic is a fast, lightweight, schema-less search backend written in Rust and licensed under MPL-2.0, built for developers and platform teams who need search relevance, typo tolerance, and auto-completion without the resource cost of a full document-oriented search engine.

What it is

Sonic ingests search texts together with identifier tuples, then serves queries against that index in microsecond time. It is an identifier index rather than a document index: it stores no direct textual data in its index, and when queried it returns object identifiers that the caller resolves against an external database to enrich the results. Search terms live in collections, which are organized in buckets, so a deployment can use one bucket for everything or a bucket per user when separate indexes are needed. Alongside the word index, Sonic holds a word graph used for auto-completion and typo correction.

The concrete problem it solves is replacing super-heavy, full-featured search backends such as Elasticsearch in the use cases where only a word index pointing at identifiers is required. Because nothing but terms, identifiers, and the word graph is retained, the process keeps a small footprint: the project's own measurements report responses to search queries in the ฮผs range, roughly 30MB of RAM under load, and a low CPU footprint. Topics in the registry place it under search, search-engine, search-server, index, graph, and infrastructure. It is written in Rust and tested at rustc 1.98.0 (88d9e12ae 2026-08-18), and the project is crafted in Nantes, France.

Key capabilities

  • Stores search terms in collections organized in buckets, allowing a single shared bucket or one bucket per user for separate indexes.
  • Returns object identifiers rather than documents, which the application resolves from an external database when enriched results are needed.
  • Corrects typos in search queries: when exact matches are too few for a word, Sonic tries corrected and alternate words instead.
  • Inserts and removes items while the server is running; a background tasker consolidates the index so pushed and popped entries become searchable quickly.
  • Auto-completes any word in real time through the suggest operation, which backs word suggestions in an end-user search interface.
  • Supports full Unicode across 80+ of the most spoken languages, guesses the language of ingested text, and strips stop words such as "the" in English.
  • Normalizes natural language search queries, auto-completes a query, and returns the most relevant results for it.

Who uses it and how

  • Crisp runs Sonic across all of its search products, indexing messages, conversations, contacts, and helpdesk articles.
  • Crisp indexed half a billion objects on a $5/month 1-vCPU SSD cloud server as of 2019, which is the scale profile Sonic is designed for.
  • Scrumpy is listed among known users of the project.
  • Multi-tenant platforms can split indexes per user by assigning one bucket per user instead of sharing a single bucket.
  • Deployments that need rich result data pair Sonic with an external database, since Sonic returns identifiers and stores no document text itself.

Getting started

Sonic is published as the sonic-server crate on crates.io at https://crates.io/crates/sonic-server. A live example of both search and suggestions is available on Crisp Helpdesk.

How it compares

Sonic positions itself as a simple alternative to super-heavy and full-featured search backends such as Elasticsearch for some use cases. The distinction it draws is architectural and resource-based: Elasticsearch is a document index that stores and returns document data, while Sonic is an identifier index that stores no direct textual data and delegates document resolution to an external database. That trade-off is what lets Sonic run in roughly 30MB of RAM with microsecond-range query responses, at the cost of full-text retrieval features.

When to use it โ€” and when not to

Sonic fits deployments that already own a primary database and want a small, self-hosted word index in front of it, including single-server setups with modest CPU and memory. A self-hoster must run the server and manage its index storage, and must keep the external database that resolves returned identifiers. It is a poor choice for anyone expecting document storage, document retrieval, or the broader analysis feature set of a full search engine, and the registry entry's README excerpt is short and leans on the maintainer's own benchmarks, so capacity planning should be validated against a real workload before committing. The 63 open issues and the absence of a hosted option in the provided facts also mean operational support falls entirely on the operator.

project readme (upstream, from github) โ€” read inline

Sonic

dependency status Buy Me A Coffee

Sonic is a fast, lightweight and schema-less search backend. It ingests search texts and identifier tuples that can then be queried against in a microsecond's time.

Sonic can be used as a simple alternative to super-heavy and full-featured search backends such as Elasticsearch in some use-cases. It is capable of normalizing natural language search queries, auto-completing a search query and providing the most relevant results for a query. Sonic is an identifier index, rather than a document index; when queried, it returns IDs that can then be used to refer to the matched documents in an external database.

A strong attention to performance and code cleanliness has been given when designing Sonic. It aims at being crash-free, super-fast and puts minimum strain on server resources (our measurements have shown that Sonic - when under load - responds to search queries in the ฮผs range, eats ~30MB RAM and has a low CPU footprint; see our benchmarks).

Tested at Rust version: rustc 1.98.0 (88d9e12ae 2026-08-18)

๐Ÿ‡ซ๐Ÿ‡ท Crafted in Nantes, France.

๐Ÿ“ฐ The Sonic project was initially announced in a post on my personal journal.

Sonic

ยซ Sonic ยป is the mascot of the Sonic project. I drew it to look like a psychedelic hipster hedgehog.

Who uses it?

Crisp logo Scrumpy logo
Crisp Scrumpy

๐Ÿ‘‹ You use Sonic and you want to be listed there? Contact me.

Demo

Sonic is integrated in all Crisp search products on the Crisp platform. It is used to index half a billion objects on a $5/mth 1-vCPU SSD cloud server (as of 2019). Crisp users use it to search in their messages, conversations, contacts, helpdesk articles and more.

You can test Sonic live on: Crisp Helpdesk, and get an idea of the speed and relevance of Sonic search results. You can also test search suggestions from there: start typing at least 2 characters for a word, and get suggested a full word (press the tab key to expand suggestion). Both search and suggestions are powered by Sonic.

Demo on Crisp Helpdesk search

Sonic fuzzy search in helpdesk articles at its best. Lookup for any word or group of terms, get results instantly.

Features

  • Search terms are stored in collections, organized in buckets; you may use a single bucket, or a bucket per user on your platform if you need to search in separate indexes.
  • Search results return object identifiers, that can be resolved from an external database if you need to enrich the search results. This makes Sonic a simple word index, that points to identifier results. Sonic doesn't store any direct textual data in its index, but it still holds a word graph for auto-completion and typo corrections.
  • Search query typos are corrected if there are not enough exact-match results for a given word in a search query, Sonic tries to correct the word and tries against alternate words. You're allowed to make mistakes when searching.
  • Insert and remove items in the index; index-altering operations are light and can be committed to the server while it is running. A background tasker handles the job of consolidating the index so that the entries you have pushed or popped are quickly made available for search.
  • Auto-complete any word in real-time via the suggest operation. This helps build a snappy word suggestion feature in your end-user search interface.
  • Full Unicode compatibility on 80+ most spoken languages in the world. Sonic removes useless stop words from any text (eg. 'the' in English), after guessing the text language. This ensures any searched or ingested text is clean before it hits the index; see languages.
  • Simple protocol (Sonic Channel), that let you search your index, manage data ingestion (push in the index, pop from the index, flush a collection, flush a bucket, etc.) and perform administrative actions. Sonic Channel was designed to be lightweight on resources and simple to integrate with; read protocol specification.
  • Easy-to-use libraries, that let you connect to Sonic from your apps; see libraries.

How to use it?

Installation

Sonic is built in Rust. To install it, either download a version from the Sonic releases page, use cargo install or pull the source code from master.

๐Ÿ‘‰ Install from packages:

Sonic provides pre-built packages for Debian-based systems (Debian, Ubuntu, etc.).

Important: Sonic only provides 64 bits packages targeting Debian 12 for now (codename: bookworm). You might still be able to use them on other Debian versions, as well as Ubuntu (although they rely on a specific glibc version that might not be available on older or newer systems).

First, add the Sonic APT repository (eg. for Debian bookworm):

echo "deb [signed-by=/usr/share/keyrings/valeriansaliou_sonic.gpg] https://packagecloud.io/valeriansaliou/sonic/debian/ bookworm main" > /etc/apt/sources.list.d/valeriansaliou_sonic.list
curl -fsSL https://packagecloud.io/valeriansaliou/sonic/gpgkey | gpg --dearmor -o /usr/share/keyrings/valeriansaliou_sonic.gpg
apt-get update

Then, install the Sonic package:

apt-get install sonic

Then, edit the pre-filled Sonic configuration file:

nano /etc/sonic.cfg

Finally, restart Sonic:

service sonic restart

๐Ÿ‘‰ Install from source:

If you pulled the source code from Git, you can build it using cargo:

cargo build --locked --release

You can find the built binaries in the ./target/release directory.

Install build-essential, clang, libclang-dev, libc6-dev, g++ and llvm-dev to be able to compile the required RocksDB dependency.

Note that the following optional features can be enabled upon building Sonic: allocator-jemalloc, tokenizer-chinese and tokenizer-japanese (some might be already enabled by default).

๐Ÿ‘‰ Install from Cargo:

You can install Sonic directly with cargo install:

cargo install sonic-server

Ensure that your $PATH is properly configured to source the Crates binaries, and then run Sonic using the sonic command.

Install build-essential, clang, libclang-dev, libc6-dev, g++ and llvm-dev to be able to compile the required RocksDB dependency.

๐Ÿ‘‰ Install from Docker Hub:

You might find it convenient to run Sonic via Docker. You can find the pre-built Sonic image on Docker Hub as valeriansaliou/sonic.

First, pull the valeriansaliou/sonic image:

docker pull valeriansaliou/sonic:v1.9.1

Then, seed it a configuration file and run it (replace /path/to/your/sonic/config.cfg with the path to your configuration file):

docker run -p 1491:1491 -v /path/to/your/sonic/config.cfg:/etc/sonic/config.toml -v /path/to/your/sonic/store/:/var/lib/sonic/store/ valeriansaliou/sonic:v1.4.9

In the configuration file, ensure that:

  • channel.inet is set to 0.0.0.0:1491 (this lets Sonic be reached from outside the container)
  • store.kv.path is set to /var/lib/sonic/store/kv/ (this lets the external KV store directory be reached by Sonic)
  • store.fst.path is set to /var/lib/sonic/store/fst/ (this lets the external FST store directory be reached by Sonic)

Sonic will be reachable from tcp://localhost:1491.

๐Ÿ‘‰ Install from another source (non-official):

Other installation sources are available:

_Note that those sources are non-official, meaning that they are not owned nor maintained by the Sonic project owners. The latest Sonic versi

readme truncated โ€” read the full docs on github

Frequently asked questions

Is sonic free to use?

sonic is open source under the MPL-2.0 licence. There is no licence fee and no seat count โ€” you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does sonic do?

๐Ÿฆ” Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.

What is sonic written in?

sonic is primarily written in Rust. Its source is publicly available at https://github.com/valeriansaliou/sonic, and it has 21,342 GitHub stars.