Databases are the largest organizational unit in Appwrite. Each database contains a group of collections. 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 databases = new sdk.Databases(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<PROJECT_ID>') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
const promise = databases.create('<DATABASE_ID>', '[NAME]');
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});