Rank 2: Process
I was wondering what is the strategy employed by Appwrite regarding collection and collection attribute creations via SDK. Consider the code below. I executed this migration 5x and always got an error saying createDocument had an invalid document structure ('designation' attribute does not exist on specified collection). Then, I added the 4s sleep and the migration started to pass.
Does this mean that Appwrite accepts the request and responds with 201 Created before actually writing the collection as a table on the cloud MariaDB instance? If so, could you tell me what is the 99th percentile or even the 95th percentile of elapsed time until an collection attribute is created? E.g.: 99 out of 100 requests, the attribute is created under 500ms.
await db.createCollection(db.id, this.#collectionID, this.#collectionID);
log(`Created collection with ID: ${db.id}`);
// Required Fieldsawait db.createStringAttribute(db.id, this.#collectionID, 'designation', 32, true);await db.createStringAttribute(db.id, this.#collectionID, 'friendly', 64, true);
await new Promise((resolve) => setTimeout(resolve, 4000));
// Create fixed documentsawait db.createDocument(db.id, this.#collectionID, ID.unique(), { designation: 'sms', friendly: 'SMS',});