Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Below is a list of supported databases, and their compatibly tested versions alo
| Postgres | ✅ | 13.0 |
| MongoDB | ✅ | 5.0 |
| SQLite | ✅ | 3.38 |
| ScyllaDB | ✅ | 5.2 |

` ✅ - supported `

Expand Down Expand Up @@ -82,6 +83,16 @@ Below is a list of supported databases, and their compatibly tested versions alo
- String max size is 2147483647 characters
- Integer max size is 4294967295

#### ScyllaDB
- ID max size can be 255 bytes
- ID can only contain [^A-Za-z0-9] and symbols `_` `-`
- Document can have unrestricted size
- Collection can have unrestricted amount of attributes
- Collection can have unrestricted amount of indexes
- Index value can have unrestricted size
- String max size is unrestricted
- Integer max size is 2^63 - 1

## Usage

### Connecting to a Database
Expand Down Expand Up @@ -207,6 +218,32 @@ $cache = new Cache(new Memory()); // or use any cache adapter you wish
$database = new Database(new SQLite($pdo), $cache);
```

#### ScyllaDB

```php
require_once __DIR__ . '/vendor/autoload.php';

use PDO;
use Utopia\Database\Database;
use Utopia\Cache\Cache;
use Utopia\Cache\Adapter\Memory;
use Utopia\Database\Adapter\ScyllaDB;

$dbHost = 'scylladb';
$dbPort = '9042';
$dbUser = 'root';
$dbPass = 'password';

$pdo = new PDO("scylla:host={$dbHost};port={$dbPort}", $dbUser, $dbPass, ScyllaDB::getPDOAttributes());

$cache = new Cache(new Memory());
$database = new Database(new ScyllaDB($pdo), $cache);

$database
->setDatabase('myapp')
->setNamespace('myapp_ns');
```

#### MongoDB

```php
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,38 @@ services:
networks:
- database

scylladb:
image: scylladb/scylla:5.2
container_name: utopia-scylladb
restart: unless-stopped
networks:
- database
ports:
- "8710:9042"
command: --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0
healthcheck:
test: ["CMD-SHELL", "nodetool status"]
interval: 30s
timeout: 10s
retries: 5

scylladb-mirror:
image: scylladb/scylla:5.2
container_name: utopia-scylladb-mirror
restart: unless-stopped
networks:
- database
ports:
- "8711:9042"
command: --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0
healthcheck:
test: ["CMD-SHELL", "nodetool status"]
interval: 30s
timeout: 10s
retries: 5

networks:
database:

volumes:
appwrite-scylladb:
Loading