Development Team/Datastore Rewrite: Difference between revisions

Tomeu (talk | contribs)
Tomeu (talk | contribs)
Line 46: Line 46:


This improves storage efficiency in general, but in our case is more important because we wish to record in the journal several interactions that refer to the same file. For example, "Downloaded lesson3.pdf", "Read lesson3.pdf", "Sent lesson3.pdf to Juan" would all refer to the same file and we need to only store it once.
This improves storage efficiency in general, but in our case is more important because we wish to record in the journal several interactions that refer to the same file. For example, "Downloaded lesson3.pdf", "Read lesson3.pdf", "Sent lesson3.pdf to Juan" would all refer to the same file and we need to only store it once.
== Layout on disk ==
The proposed implementation relies heavily on the data structures provided by the filesystem, thus the layout in which files are disposed on disk is a fundamental part of its design.
Example of a datastore containing 5 entries, two of them referring to the same file (with checksum 464493d8d929436b6152e868867ed451):
1a
      1ab88287-766a-4d98-a7c0-4233dc48647a
            1ab88287-766a-4d98-a7c0-4233dc48647a
                  metadata
2b
      2b90597c-0912-4e7f-8eeb-71a0f004490d
            2b90597c-0912-4e7f-8eeb-71a0f004490d -> checksums/464493d8d929436b6152e868867ed451
                  checksum ~> checksums/464493d8d929436b6152e868867ed451
                  extra_metadata
                        preview
                  metadata
3c
      3cdf5f0e-7595-4166-b1f9-cbedfcfe1c4a
            3cdf5f0e-7595-4166-b1f9-cbedfcfe1c4a -> checksums/464493d8d929436b6152e868867ed451
                  checksum ~> checksums/464493d8d929436b6152e868867ed451
                  extra_metadata
                        preview
                  metadata
4d
      4db11d29-2f07-4452-bd8e-22a6a483ac19
            4db11d29-2f07-4452-bd8e-22a6a483ac19
                  metadata
                  extra_metadata
                        preview
5e
      5e9f2027-b41e-4015-a848-6b3972193eb8
            5e9f2027-b41e-4015-a848-6b3972193eb8
                  metadata
                  extra_metadata
                        preview
checksums
index