Released Sep 28, 2026
2.7.0
SurrealDB 2.7.0 makes REMOVE NAMESPACE and REMOVE DATABASE return straight away, however much data they remove, and deletes that data in the background. It also fixes COUNT indexes, which the 2.x line never compacted, and stops databases without a changefeed from recording changefeed timestamps.
A 2.6 datastore upgrades in place. Read the 2.6 to 2.7 upgrade guide before upgrading, because a datastore that has run 2.7.0 cannot safely return to 2.6.
2.7.0 contains no security fixes, and the advisories fixed in 3.3.0 list 2.x releases as affected too. See Security below.
Highlights
🧹 Remove a namespace or database of any size
REMOVE NAMESPACE and REMOVE DATABASE now delete the definition and return at once, and a background task deletes the data afterwards in batches that resume after a restart. On 2.6, removing a large database could fail with Failed to commit transaction due to a read or write conflict or never finish. Once every node runs 2.7.0, the removed data cannot be read from the moment the statement commits, and --reclaim-interval (SURREAL_RECLAIM_INTERVAL, default 60s) sets how often the task runs.
Behaviour after removal · Removal in the background
Improvements
Changefeeds only track the databases that use them. A database that defines no changefeed no longer records a timestamp at every changefeed clean-up (every 10 seconds by default), and the timestamps it recorded on earlier 2.x releases are deleted after the upgrade. Background work after the upgrade
Background clean-up commits in batches. Changefeed clean-up and index compaction now commit 1,000 keys at a time, so a large backlog no longer runs as one transaction.
Config::reclaim_intervalin the Rust SDK sets the reclaim interval for an embedded datastore.
Bug fixes
Fixed
COUNTindexes never being compacted since they were added in 2.4.0, so a count served by the index read one entry for every record ever created or deleted on the table. The first compaction after the upgrade combines those entries. Background work after the upgradeFixed
SHOW CHANGES ... SINCE <datetime>failing with an internal error when the datetime was earlier than the first timestamp the database had recorded. It now returns the changes from the start of what is retained, and a datetime in the future returns none.
Security
2.7.0 contains no security fixes. Several advisories fixed in 3.3.0, three of them rated Critical, list every release before 3.3.0 as affected, and that includes 2.7.0. Their fixes ship in 3.3.0, and the 3.3.0 security notes list each advisory. Moving from 2.x to 3.x follows the 2.x to 3.x migration guide.
Upgrade notes
The 2.6 to 2.7 upgrade guide covers each of these in detail.
Back up the whole datastore first if you may need to roll back. 2.6 does not know that a removal can leave data on disk, so it can serve a removed database's data again and let its users sign in. The way back to 2.6 is a backup taken before the upgrade: a storage snapshot, or an export of every database plus a record of the root and namespace-level users and access methods, which no export contains. Rolling back to 2.6
Rolling upgrades. Until every node runs 2.7.0, a 2.6 node can still serve the data of a namespace or database removed on an upgraded node, so remove namespaces and databases only after the last node is upgraded. Clusters and rolling upgrades
Reusing a removed name deletes what is left first. Defining a namespace or database under the name of one still being deleted clears up to 10,000 keys of the old data in the same transaction. If more is left, the statement fails with
The name '...' cannot be reused until the data of the removed namespace or database has been reclaimed, and succeeds once the background task has caught up. Reusing a removed nameEvery removal deletes stored versions. Removing a namespace or database now deletes its version history, as
AND EXPUNGEdid, andAND EXPUNGEreturns before the data is deleted.
Upgrade or install
Get SurrealDB v2.7.0
Upgrade a Cloud instance from SurrealDB Studio, or copy the command for your platform.
Upgrade a Cloud instance to v2.7.0 in four steps:
- Open SurrealDB Studio
- Select your organisation and instance
- On the dashboard, select “Upgrade”
- The instance updates and restarts automatically