Skip to content

Databases

Databases are the largest organizational unit in Appwrite. Each database contains a group of tables. In future versions, different databases may be backed by a different database technology of your choosing.

Create in Console

The easiest way to create a database using the Appwrite Console. You can create a database by navigating to the Databases page and clicking Create database.

Create using Server SDKs

You can programmatically create databases using a Server SDK. Appwrite Server SDKs require an API key.

const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const tablesDB = new sdk.TablesDB(client);

client
    .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
    .setProject('<PROJECT_ID>') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

const promise = tablesDB.create({
    databaseId: '<DATABASE_ID>',
    name: '[NAME]'
});

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});