Releases

SurrealDB has been built from the ground up to be the ultimate database for developers who want to build tomorrow's applications. On this page you can view the release notes for the different versions of SurrealDB, and see some of the functionality currently being worked on for future releases.

If you have an idea for SurrealDB, then we would love to hear from you.

In developmentCurrent release

Back to top

In development

Database functionality

  • GraphQL queries, modifications, and subscriptions
  • Live queries for realtime, distributed notifications of data updates
  • SurrealDB -> WASM build for running SurrealDB within a browser with persistant storage
  • Highly-performant, ACID compliant, persistant, on-disk storage, with multiple concurrent writers

Scripting functionality

  • Add fetch module for asynchronous HTTP requests
  • Add surrealdb module for querying + modifying the database
  • Add ability to define or import custom ES6 modules for user-defined functionality

Performance improvements

  • Zero-copy datastore key serialization and deserialization
  • Database index selection for improved performance when performing full-table scans

Release v1.0.0-beta.6

13 August, 2022

  • Add command-line SurrealQL REPL for quick querying of a database
  • Log username at server startup when root authentication is enabled
  • Enable SurrealDB server to be configured using environment variables
  • Implement config definition key and value caching within a transaction
  • Add array::sort functions for sorting of arrays and array fields
  • Ensure an error is returned when selecting from a non-existent table in strict mode
  • Allow polymorphic remote record constraints in DEFINE FIELD statements
  • Fix bug with SQL export, where DEFINE INDEX statements were not exported
  • Fix bug where multi-yield path expressions with multiple alias outputs were returning nested arrays
  • Fix bug where aliased field was not output when fetching a multi-yield expressions with a final alias yield

SurrealDB REPL

SurrealDB now supports the ability to start a command-line REPL to query a local or remote database from the terminal.

user@localhost % surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test

Release v1.0.0-beta.5

01 August, 2022

  • Temporarily disable HTTP response compression
  • Improve surreal import and surreal export cli commands
  • Fix bug where GROUP BY fields with an alias AS name were not output correctly
  • Fix SQL syntax parsing bug when specifying DEFINE INDEX statements with UNIQUE

Release v1.0.0-beta.4

28 July, 2022

  • Add new strict mode to SurrealDB server
  • Ensure default table permissions are set to NONE not FULL
  • Fix bug when defining NS and DB without first selecting a NS or DB
  • Fix bug with VALUE and ASSERT clauses in DEFINE FIELD statements when fields are not present in query

Strict mode

SurrealDB now supports the ability to startup in strict mode. When running in strict mode, all NAMESPACE, DATABASE, and TABLE definitions will not be created automatically when data is inserted. Instead if the selected namespace, database, or table has not been specifically defined, then the query will return an error.

user@localhost % surreal start --strict --log debug --user root --pass root memory

Release v1.0.0-beta.3

24 July, 2022

  • Enable years as a unit in durations (1y)
  • Log root authentication configuration status on server startup
  • Ensure CORS headers are set on all HTTP responses even when request fails with an error
  • Improve syntax for defining futures: fn::future -> changed to <future>
  • Improve syntax for defining embedded functions: fn::script -> () => changed to function()
  • Ensure root authentication is completely disabled when -p or --pass cli arguments are not specified

Release v1.0.0-beta.2

20 July, 2022

  • Improve command-line logging output
  • Enable new --log argument for specifying server log level
  • Hide default randomly-generated server password
  • Ensure correct version is displayed when running surreal version command

Release v1.0.0-beta.1

18 July, 2022

  • Entire SurrealDB codebase re-written in Rust
  • Single-node, in-memory storage for development use
  • Highly-available, highly-scalable distributed storage for production use
  • Improved SurrealQL query language with faster parsing, and embedded inspection of types
  • Performance improvements with data parsing, and serialization and deserialization of records
  • Added support for casting and converting between different data types
  • Added a new data type for storing values which should only be computed in the future when selected for output
  • Embedded JavaScript functions for writing complex functions and triggers, with runtime context isolation
  • Addition of nested GeoJSON data types, including Point, Line, Polygon, MultiPoint, MultiLine, MultiPolygon, and Collection values

Futures

Values which should be computed only when outputting data, can be stored as futures. These values are stored in SurrealDB as SurrealQL code, and are calculated only when output as part of a SELECT clause.

Casting

In SurrealDB, all data values are strongly typed. Values can be cast and converted to other types using specific casting operators. These include bool, int, float, string, number, decimal, datetime, and duration casts.

UPDATE product SET
	name = "SurrealDB",
	launch_at = "2021-11-01",
	countdown = <future> { launch_at - time::now() }
;
UPDATE person SET
	waist = <int> "34.59",
	height = <float> 201,
	score = <decimal> 0.3 + 0.3 + 0.3 + 0.1
;

RELATE statements

The RELATE statement adds graph edges between records in SurrealDB. It follows the convention of vertex -> edge -> vertex or noun -> verb -> noun, enabling the addition of metadata to the edge record.

INSERT statements

The INSERT statement resembles the traditional SQL statement, enabling users to get started quickly. It supports the creation of records using a VALUES clause, or by specifying the record data as an object.

-- Add a graph edge between user:tobie and article:surreal
RELATE user:tobie->write->article:surreal
	SET time.written = time::now()
;

-- Add a graph edge between specific users and developers
LET $from = (SELECT users FROM company:surrealdb);
LET $devs = (SELECT * FROM user WHERE tags CONTAINS 'developer');
RELATE $from->like->$devs UNIQUE
	SET time.connected = time::now()
;
INSERT INTO company {
	name: 'SurrealDB',
	founded: "2021-09-10",
	founders: [person:tobie, person:jaime],
	tags: ['big data', 'database']
};

INSERT IGNORE INTO company (name, founded)
	VALUES ('SurrealDB', '2021-09-10')
	ON DUPLICATE KEY UPDATE tags += 'developer tools'
;

Expressions

SurrealQL supports fetching data using dot notation ., array notation [], and graph semantics ->. SurrealQL enables records to link to other records and traverses all embedded links or graph connections as desired. When traversing and fetching remote records SurrealQL enables advanced filtering using traditional WHERE clauses.

-- Select a nested array, and filter based on an attribute
SELECT emails[WHERE active = true] FROM person;

-- Select all 1st, 2nd, and 3rd level people who this specific person record knows, or likes, as separate outputs
SELECT ->knows->(? AS f1)->knows->(? AS f2)->(knows, likes AS e3 WHERE influencer = true)->(? AS f3) FROM person:tobie;

-- Select all person records (and their recipients), who have sent more than 5 emails
SELECT *, ->sent->email->to->person FROM person WHERE count(->sent->email) > 5;

-- Select other products purchased by people who purchased this laptop
SELECT <-purchased<-person->purchased->product FROM product:laptop;

-- Select products purchased by people in the last 3 weeks who have purchased the same products that we purchased
SELECT ->purchased->product<-purchased<-person->(purchased WHERE created_at > time::now() - 3w)->product FROM person:tobie;

Embedded JavaScript functions

Javascript functions can be used for more complex functions and triggers. Each Javascript function iteration runs with its own context isolation - with the current record data passed in as the execution context or this value.

CREATE film SET
	ratings = [
		{ rating: 6, user: user:bt8e39uh1ouhfm8ko8s0 },
		{ rating: 8, user: user:bsilfhu88j04rgs0ga70 },
	],
	featured = function() {
		return this.ratings.filter(r => {
			return r.rating >= 7;
		}).map(r => {
			return { ...r, rating: r.rating * 10 };
		});
	}
;

Release v0.3.0

14 December, 2021

  • Enable query and session parameters to be defined on a JSON-RPC connection
  • Ensure subqueries can access encoding parent query and grand-parent queries
  • Add diff-match-patch functionality when updating document records
  • Separate authentication levels for Namespace and Database specific access
  • Authentication scope definition and setup, with user-defined authentication logic for each scope

Pre-defined aggregate analytics views

Aggregate views let you pre-compute analytics queries as data is written to SurrealDB. Similarly to an index, a table view lets you select, aggregate, group, and order data, with support for moving averages, time-based windowing, and attribute-based counting. Pre-defined aggregate views are efficient and performant, with only a single record modification being made for every write.

-- Drop all writes to the reading table. We don't need every reading.
DEFINE TABLE reading DROP;

-- Define a table as a view which aggregates data from the reading table
DEFINE TABLE temperatures_by_month AS
	SELECT
		count() AS total,
		time::month(recorded_at) AS month,
		math::mean(temperature) AS average_temp
	FROM reading
	GROUP BY city
;

-- Add a new temperature reading with some basic attributes
CREATE reading SET
	temperature = 27.4,
	recorded_at = time::now(),
	city = 'London',
	location = (-0.118092, 51.509865)
;

Release v0.2.0

21 January, 2021

  • Parameters can be used to store values or result sets
  • Nested subquery functionality, with scoped parameters
  • Nested field query notation allowing nested arrays and objects to be queried
  • Mathematical operators for complex mathematical calculations in queries
  • Advanced functions for working with arrays, strings, time, validation, parsing, and counting

Release v0.1.0

08 December, 2019

  • Multi-tenancy data separation, with namespaces and databases
  • Schemafull or schemaless tables with limitless document fields
  • Multi-table, multi-row, serialisable ACID transactions
  • Table fields, table change events, table indexes, and data constraints
  • Advanced data model including empty values, strings, numbers, objects, arrays, durations, and datetimes