add surrealdb
This commit is contained in:
parent
ecb2d9b319
commit
0d26df997e
1 changed files with 49 additions and 0 deletions
49
technology/applications/development/SurrealDB.md
Normal file
49
technology/applications/development/SurrealDB.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
obj: application
|
||||
website: https://surrealdb.com
|
||||
repo: https://github.com/surrealdb/surrealdb
|
||||
---
|
||||
|
||||
# SurrealDB
|
||||
SurrealDB is a powerful, cloud-native, multi-model database built for modern application development. It supports relational, document, graph, vector, and real-time data access, all via a unified SQL-like query language called SurrealQL. There is also a GUI called Surrealist.
|
||||
|
||||
## Multi-Model Support
|
||||
- **Relational**: Traditional table structure with foreign key-like linking.
|
||||
- **Document**: JSON-based records with schema-less flexibility.
|
||||
- **Graph**: Native support for linked data using edges and nodes.
|
||||
- **Vector**: Built-in similarity search for AI/ML use cases.
|
||||
- **Real-time**: Subscriptions and change feeds.
|
||||
- **Time-Series & Search**: Native support for time-ordered and full-text queries.
|
||||
|
||||
## SurrealQL
|
||||
SurrealQL blends the familiarity of SQL with document/graph features.
|
||||
|
||||
```sql
|
||||
-- Create a user
|
||||
CREATE user:john SET name = 'John Doe', email = 'john@example.com';
|
||||
|
||||
-- Read a record
|
||||
SELECT * FROM user:john;
|
||||
|
||||
-- Create a relationship (graph)
|
||||
RELATE user:john->friend->user:jane;
|
||||
|
||||
-- Search by text
|
||||
SELECT * FROM article WHERE content CONTAINS 'database';
|
||||
|
||||
-- Vector similarity search
|
||||
SELECT * FROM embeddings WHERE vector <-> [0.1, 0.2, 0.3] LIMIT 3;
|
||||
```
|
||||
|
||||
## Compose
|
||||
|
||||
```yml
|
||||
services:
|
||||
surrealdb:
|
||||
ports:
|
||||
- 80:8000
|
||||
volumes:
|
||||
- /local-dir:/container-dir
|
||||
image: surrealdb/surrealdb:latest
|
||||
command: start --user root --pass root rocksdb:/container-dir/mydatabase.db
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue