You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.1 KiB

3 years ago
3 years ago
3 years ago
  1. ##arangodb
  2. database: https://github.com/arangodb/arangodb
  3. go driver: https://github.com/arangodb/go-driver
  4. options:
  5. ```
  6. [arangodb]
  7. enabled=true
  8. db_name="seaweedfs"
  9. servers=["http://localhost:8529"]
  10. #basic auth
  11. user="root"
  12. pass="test"
  13. # tls settings
  14. insecure_skip_verify=true
  15. ```
  16. i test using this dev database:
  17. `docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=test arangodb/arangodb:3.9.0`
  18. ## database structure
  19. arangodb has a few restrictions which require the use of a few tricks in order to losslessly store the data.
  20. ### filer store
  21. arangodb does not support []byte, and will store such as a uint64 array. this would be a waste of space. to counteract this, we store the data as a length prefixed uint64 byteset.
  22. ### filer kv
  23. same as above
  24. ### filer buckets
  25. s3 buckets are implemented through arangodb collection. this allows us to do very fast bucket deletion by simply deleting the collection
  26. arangodb collection name rules is character set `azAZ09_-` with a 256 character max. however the first character must be a letter.
  27. s3 bucket name rule is the set `azAZ09.-` with a 63 characters max.
  28. the rules for collection names is then the following:
  29. 1. if the bucket name is a valid arangodb collection name, then nothing is done.
  30. 2. if the bucket name contains a ".", the "." is replaced with "_"
  31. 3. if the bucket name now begins with a number or "_", the prefix "xN--" is prepended to the collection name
  32. this allows for these collection names to be used.
  33. ## features i don't personally need but are missing
  34. [ ] provide tls cert to arango
  35. [ ] authentication that is not basic auth
  36. [ ] synchronise endpoint interval config
  37. [ ] automatic creation of custom index
  38. [ ] configure default arangodb collection sharding rules
  39. [ ] configure default arangodb collection replication rules
  40. ## complexity
  41. ok, so if https://www.arangodb.com/docs/stable/indexing-index-basics.html#persistent-index is correct
  42. O(1)
  43. - InsertEntry
  44. - UpdateEntry
  45. - FindEntry
  46. - DeleteEntry
  47. - KvPut
  48. - KvGet
  49. - KvDelete
  50. O(log(BUCKET_SIZE))
  51. - DeleteFolderChildren
  52. O(log(DIRECTORY_SIZE))
  53. - ListDirectoryEntries
  54. - ListDirectoryPrefixedEntries