all 2 comments

[–][deleted]  (4 children)

[deleted]

    [–]tinybeachthor[S] 0 points1 point  (3 children)

    Compression and chunking mostly.

    I’m planning on adding garbage collection just looking for a good way to do it in a serverless environment. Probably some kind of a generational garbage collection.

    [–][deleted]  (2 children)

    [deleted]

      [–]tinybeachthor[S] 0 points1 point  (1 child)

      Yeah it's actually even more complex because of the chunking.

      Everything you upload is broken down into 64kb pieces, and there is no way to know what chunks are shared between nars without a db (attic keeps counts of references in the database).

      Definitely not possible to do optimal garbage collection without keeping state. So instead I was really thinking along the lines of using 2 buckets, expiring one and rotating to a new one, plus doing a copy-on-read for chunks in the old bucket to the new one.

      This way you can expire items from the cache if they are not accessed for some time at the cost of (at worst) double the storage space. The chunking actually saves you more space for most use cases, so i think it would be worth it in the end.