Database read / write operations are very slow when running on cloud functions (appwrite cloud). Each operation takes 2-3 seconds and overall function execution takea around 3-6 seconds.
- Function execution
{"startTime":"Mon Dec 11 2023 18:45:30 GMT+0000 (Coordinated Universal Time)"}
[[1] get document by id] "1462.120"
[[4] create document in db] "2804.059"
function duration: 4854.733 ms
{"executionTime":4853,"endTime":"Mon Dec 11 2023 18:45:34 GMT+0000 (Coordinated Universal Time)"}
- Function execution
{"startTime":"Mon Dec 11 2023 18:51:11 GMT+0000 (Coordinated Universal Time)"}
[[2] third party API call] "148.158"
[[3] create document in db] "994.708"
[[4] create document in db] "2002.438"
function duration: 3776.766
{"executionTime":3776,"endTime":"Mon Dec 11 2023 18:51:15 GMT+0000 (Coordinated Universal Time)"}
3.Function execution
{"startTime":"Mon Dec 11 2023 18:53:26 GMT+0000 (Coordinated Universal Time)"}
[[2] third party API call] "121.156"
[[3] create document in db] "1284.590"
[[4] create document in db] "2619.728"
function duration: 4729.293
{"executionTime":4729,"endTime":"Mon Dec 11 2023 18:53:30 GMT+0000 (Coordinated Universal Time)"}
Do you use relationships?
Yes.
Below durations are for creating child documents [[3] create document in db] "994.708" [[3] create document in db] "1284.590"
Below duration are for creating parent document with child document reference (not nested syntax) [[4] create document in db] "2804.059" [[4] create document in db] "2002.438" [[4] create document in db] "2619.728"
Below duration is for getting the child document [[1] get document by id] "1462.120"
ya...relationships can slow things down a bit..
Creating a document without relationship takes 300~400 ms for each write operation. Is this consistent with the benchmarks or expectations you have observed?
[PostService::[0] create document in db with no relations] "384.234" [PostService::[5] create document in db with no relations] "306.835"
hmmmm possibly yes...
Is it possible that the upcoming Pro plan could reduce these operation times?
Recommended threads
- My projects were deleted
Hello everyone, My projects were for some reason deleted. I got an email informing me about project inactivity, when I clicked to activate it again, it was sil...
- Dotnet functions on cloud
I'm trying to deploy my .Net8 functions to my project on cloud.appwrite through the CLI. I'm getting this error.
- Query multi-tenant db with $permissions ...
I'm setting up a multi-tenant database with RLS enabled. My users my have permissions set for multiple Teams, and as such when they query the database with the ...