You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides S3 compatible interface for object storage services such as MinIO, Wasabi, Cloudflare R2 or other third-party S3 providers.
25
+
### How the adapter works:
25
26
26
-
>‼️Since levelDb is used for storing keys of objects that should/shouldn't be deleted, so this is important to use docker volume on deployed application, so you will not loose this data after re-deploy
27
+
The Amazon S3 adapter uses tagging to mark objects with the special tag `adminforth-candidate-for-cleanup`, and then creates a lifecycle rule that automatically expires objects with that tag.
28
+
But not all S3-compatible adapters support tagging, so this adapter has a built-in cleanup mechanism and you have two options:
27
29
28
-
>‼️It is not recomended to use the same Key/value adapter for the adapter multiple instances, because it can cause unpredictable behavior of cleanup scheduler
30
+
**1) Pass an optional key/value adapter, where all object keys scheduled for deletion will be stored**
31
+
32
+
Why use it?
33
+
34
+
There are a few reasons to do so:
35
+
36
+
- When somebody uploads a file in a record and doesn't press the "Save" button, the file will be marked for deletion and you don't have to pay for storing it
37
+
- If you accidentally delete a file, you'll have a time window to restore it
38
+
39
+
>If you are using a key/value adapter, it is important to retain the object keys, because if the key-value storage is cleared, all objects marked for deletion will not be cleaned up and you'll have to pay for storing files you no longer use
40
+
41
+
>We recommend using `@adminforth/key-value-adapter-resource`, because chance, that database will be cleaed is low
42
+
43
+
>‼️If you are using LevelDB to store keys of objects that should/shouldn't be deleted, it is important to use a Docker volume on the deployed application so you will not lose this data after a redeployment
44
+
45
+
>‼️It is not recommended to use the same Key/value adapter for multiple adapter instances, because it can cause unpredictable behavior of the cleanup scheduler
46
+
47
+
**2) Don't use key/value adapter**
48
+
49
+
If you don't want to use a key/value adapter and you don't need to clean up files, you can simply not pass an adapter
50
+
> Note: if you don't pass an adapter, all connected files will be deleted immediately when you delete a record.
51
+
52
+
> If somebody uploaded a file and didn't save the record, you will pay for the storage until the file is removed manually
0 commit comments