Questions tagged [surrealdb]

SurrealDB is an innovative NewSQL cloud database, suitable for serverless applications, jamstack applications, single-page applications, and traditional applications. It is unmatched in its versatility and financial value, with the ability for deployment on cloud, on-premise, embedded, and edge computing environments. For a hassle-free setup, get started with SurrealDB Cloud in one-click.

More info can be found here: https://surrealdb.com/

A highly-scalable NewSQL database

SurrealDB is a flexible, developer-friendly, fully ACID transactional, realtime document-graph web database for serverless applications. Never again worry about database provisioning, scaling, sharding, replication, or correctness.

Single-node or distributed

SurrealDB can be run in on a single-node (both in-memory or using durable on-disk storage), or in a highly-available distributed cluster. It consumes very few resources making it perfect for embedding within other stacks or applications.

Flexible data modelling

Using an advanced query language, SurrealDB lets you store and access data using relational, document, graph, and embedded methodologies. The innovative data model enables you to model and access links between data records in an efficient way without complicated JOINs.

Distributed ACID transactions

Have peace-of-mind when working with your data, by using strictly serialisable multi-table and multi-record transactions, with no limit on the number of keys or documents, or the transaction duration.

Built with Rust

SurrealDB is designed from the ground up to be stable and scalable, with a focus on performance and functionality. When running, SurrealDB uses minimal machine resources, with highly-efficient memory access and caching.

Structured and unstructured data

SurrealDB doesn't force you into using pre-specified columns or fields. You can specify that a table is schemaless allowing any data keys to be stored, or instead, schemafull mode ensures that only certain fields and data types can be stored.

Query using SQL

The primary method of querying SurrealDB is using SurrealQL, a similar but modified version of traditional SQL. SurrealQL enables linked documents to be traversed and queried efficiently, while still using an imperative language which remains understandable by data scientists.

GraphQL, REST, or WebSockets

When connecting directly from an end-user device, you can choose to query the data using SurrealQL, GraphQL, or using a traditional REST API. In addition, WebSockets enable high-performance bi-directional realtime syncing of any updated data.

Multi-column indexing on-the-fly

Indexes can be easily added and removed as your application evolves. Indexes allow for strongly consistent reads and writes, enabling highly-performant reads, whilst multi-column unique indexes ensure custom data guarantees.

Full-text indexing with no effort

In SurrealDB, records can be indexed automatically using distributed full-text-indexes, allowing for performant Lucene-based querying over all record data fields, including boolean searches, fuzzy searches, wildcard searches, range searches, and weighted results.

Incrementally computed views

In addition to traditional indexes, SurrealDB allows data to be selected, grouped, and ordered into pre-computed views. These views enable efficient data access for specific incrementally aggregated analytics queries.

Real-time data syncing

When connecting with SurrealDB, all connections are made using WebSockets, allowing for bi-directional data syncing. Dependent on data access permissions, client-based document subscriptions are triggered in real-time whenever changes are made to the data.

In-built access and permissions

SurrealDB is designed as a web database, with clients connecting directly to it from browsers, mobile devices, and desktop apps. Configure your access rules easily using SQL statements, ensuring only the correct users have access to their respective data.

Web-native secure access

With support for SSL/TLS, Single-Sign-On, external 3rd party authentication, JWT token based authentication, and custom business authentication logic - SurrealDB offers strong security, with the flexibility of custom authentication methods that suit your app or business.

Versioned temporal data

Temporal queries enable easy auditing of whole datasets. See how your data, and the graph, evolved over time, and what changes were made by whom - by specifying a certain timestamp when running a query.

Multi-tenant databases

With support for namespaces and databases, SurrealDB enables you to separate your data out however you wish, simplifying the development of SaaS applications.

Global low-latency

Choose where you want your data to reside, and serve customers anywhere - with consistent data, replicated in real-time across multiple regions, allowing you to keep application loading speeds super-fast.

Hands-free elasticity

When using SurrealDB in the cloud, transparent behind-the-scenes scaling ensures that your apps never run out of capacity or storage, while you pay only for the data storage that you use.

Hassle free operation

SurrealDB is built from the ground-up to run as a cloud-first database. Configurable with just a single command, either as a binary, or from within a Docker instance, SurrealDB is easy to start, easy to scale, and easy to maintain. All the hard work is done for you.

62 questions
7
votes
1 answer

How do I subscribe to SurrealDB table changes?

The SurrealDB GitHub readme file states the following: "SurrealDB keeps every client device in-sync with data modifications pushed in realtime to the clients, applications, end-user devices, and server-side libraries". Although I didn't find any…
iloginow
  • 133
  • 1
  • 7
6
votes
0 answers

How to traverse an unknown-length path in SurrealDB?

I want to recursively follow related records in SurrealDB, and I can't find the syntax to express it. The simplest explanation of my goal is Neo4j/Cypher's variable length pattern matches. More generally, I want to start at a record and follow…
Zach Allen
  • 61
  • 2
5
votes
1 answer

Sending a `create` RPC message to SurrealDB returns a "There was a problem with the database: The table does not exist" error

I'm debugging some tests for the .NET SurrealDB library. I can open connections to the database just fine but when I send a create RPC message to the db (docker container) it returns an error that reads "There was a problem with the database: The…
Stephen Gilboy
  • 5,572
  • 2
  • 30
  • 36
5
votes
1 answer

How can I log into a scope with SurrealDB?

I'm using the example code from the SurrealDB Features page for a user/pass system DEFINE SCOPE admin SESSION 1d SIGNUP ( CREATE user SET user = $user, pass = crypto::argon2::generate($pass) ) SIGNIN ( SELECT * FROM user WHERE user =…
LeoDog896
  • 3,472
  • 1
  • 15
  • 40
4
votes
1 answer

Authentication Failure when using external JWT token in SurrealDB

Can anyone help me setup authentication using external jwt token So far i have tried multiple variants of the following. First i define the token using DEFINE TOKEN my_token ON DATABASE TYPE HS512 VALUE '1234567890'; Then i generate a token using…
Ashamnx
  • 83
  • 7
4
votes
1 answer

SurrealDB: The request needs to adhere to certain constraints

I just tried to run the first query from the SurrealDB documentation. DATA="INFO FOR DB;" curl --request POST \ --header "Content-Type: application/json" \ --user "root:root" \ --data "${DATA}" \ http://localhost:8000/sql This leads…
HenryK
  • 41
  • 2
3
votes
1 answer

Command for seeing list of all existing namespaces and databases

I have recently come across SurrealDB, and installed it. After adding to path, I started the server using surreal start. .d8888b. 888 8888888b. 888888b. d88P Y88b …
Jaideep Shekhar
  • 808
  • 2
  • 7
  • 21
3
votes
1 answer

specifying the TiKV cluster endpoint as the backing data store error

1.start tikv commang: # tiup playground --tag surrealdb --mode tikv-slim --pd 1 --kv 1 tiup is checking updates for component playground ... Starting component `playground`: /root/.tiup/components/playground/v1.11.0/tiup-playground --tag surrealdb…
Tiansi Liu
  • 41
  • 2
2
votes
1 answer

SurrealDB - How to store record linkage in Rust struct?

There is an example in SurrealDB documentation about using Rust's structs to store received data: #[derive(Debug, Serialize)] struct Name<'a> { first: &'a str, last: &'a str, } #[derive(Debug, Serialize)] struct Person<'a> { title: &'a…
eminfedar
  • 558
  • 3
  • 16
2
votes
0 answers

ERROR surrealdb::cli There was an error with the remote request: error sending request for url /import operation timed out

I want to move the data from my local SurrealDB instance to the one on my remote VM. I created a new VM and used the Linux SurrealDB CLI tool to start a new instance SurrealDB: curl -sSf https://install.surrealdb.com | sh Then, after adding surreal…
nopassport1
  • 1,821
  • 1
  • 25
  • 53
2
votes
1 answer

Create a record with email address as the unique identifier [JavaScript client (Node.js Package) - SurrealDB]

I am trying to create a person record with the following code: import Surreal from 'surrealdb.js'; ... const peopleFromSomewhere = await someProvider.getAllPeople(); // [{ email: 'some@email.com', fullName: 'Some Name' }, ... ] for (const person…
nopassport1
  • 1,821
  • 1
  • 25
  • 53
2
votes
3 answers

How to connect to SurrealDB in a Docker container from a Rust app?

I am trying to figure out how to connect my Rust app to a surrealdb database that is running inside a docker container. The docs on the SurrealDB website only specify three ways to connect to the database, these are: memory, file, and tikv. I am…
Gixty
  • 202
  • 4
  • 13
2
votes
2 answers

How to search an array element in SurrealDB

I'm trying to perform a query that evaluates if an array includes or contains a specif value or set of values. SELECT * FROM table WHERE data = ['value_a'] https://surrealdb.com/docs/surrealql/statements/select I've read the documentation and try…
codesandtags
  • 382
  • 2
  • 8
2
votes
1 answer

SurrealDB equivalent of SELECT DISTINCT

I have a table of courses that are RELATEd by requires_prerequisite to other courses. I am trying to get 2nd-level prerequisite dependencies for a course (courses that have courses as prerequisites which have this course as a prerequisite), and I…
AbyxDev
  • 1,363
  • 16
  • 30
2
votes
1 answer

SurrealDB - store binary files

Is it possible to store binary files (e.g. images) using SurrealDB? I can't find anything about this in docs. If not, where can I store images since all the other data is stored in SurrealDB.
Jan Krupiński
  • 291
  • 2
  • 8
1
2 3 4 5