Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the database stored in surrealDB?

Tags:

surrealdb

It doesn't say in the documentation.

like image 306
Epic Dubber Avatar asked Nov 21 '25 15:11

Epic Dubber


2 Answers

It really depends on how you run the database.

If you are using the cli and run the database via surreal start, the database runs in-memory per default. So the the data is not stored persistently anywhere.

You can manually provide a path to determine where the data is stored.

surreal start file://./surrealDB

Valid values for path are

  • memory to store the data in-memory
  • file://<path> to store the data in the specified path
  • tikv://<addr> to store the data in a TiKV database

  • Docs
like image 103
Tobias S. Avatar answered Nov 24 '25 22:11

Tobias S.


Tobias is right, I'll just add this official link for future-proofness.

The usage is indeed like this

surreal start [OPTIONS] [--] [path]

With path being optional and having memory as a default

Can be one of memory, file://<path>, tikv://<addr>

<path>    Database path used for storing data [default: memory]

When starting the server, you'll also notice where it effectively runs by checking the console

enter image description here


That could also be useful to discover more useful params for the CLI like -u or -p.

like image 21
kissu Avatar answered Nov 24 '25 21:11

kissu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!