Hi, I 've connected for tests to my mariadb database and try some updates on collections. Documents have been updated correctly. But when I call Appwrite getDocument(), I get old data. Is it safe operation, doing update directly in database?
Summary
A user was experiencing issues when updating documents from a MariaDB database using Appwrite. They were not seeing the updated data when using the Appwrite getDocument() function. Other users suggested clearing the cache using commands like `docker exec appwrite-redis redis-cli FLUSHALL` or restarting Appwrite. It was mentioned that modifying the database while Appwrite is running could result in corruption. Eventually, the user realized that they were using MongoDB instead of MariaDB, which is not compatible with Appwrite. The user was able to successfully update documents when using the correct database.
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 05:52
Appwrite isn't compatible with mongo
pitcairn1987
Rank 2: Process
Jun 3, 2023, 08:56
sorry, I mean MariaDb:)
pitcairn1987
Rank 2: Process
Jun 3, 2023, 08:56
Update documents from MariaDb database
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 09:02
Are you sure you save your modification on mariadb ? I just try and it works
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 09:03
It's not safe while it'll not trigger events, not count as "Usage" etc..
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 09:09
NB: I can reproduce. Appwrite manage cache via redis
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 09:09
I need to delete cache to see update
pitcairn1987
Rank 2: Process
Jun 3, 2023, 09:40
How can I delete cache?
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 10:08
You need to connect to redis
D5
Moderator
Jun 3, 2023, 10:17
Reatarting appwrite could clean cache, but not sure
D5
Moderator
Jun 3, 2023, 10:18
Doesn't seem like a good idea modifying that with appwrite running (cold result in corruption)
Bouahaza
Rank 4: Virtual Machine
Jun 3, 2023, 10:18
docker exec appwrite-redis redis-cli FLUSHALL Should works too. It clear all cache
pitcairn1987
Rank 2: Process
Jun 3, 2023, 11:55
Yes. It helps. Thanks!
Drake
Admin
Jun 3, 2023, 14:46
Keep in mind redis is used to queue events so if any events were still queued, they would be wiped.