Details for all the inquisitive types, project’s open source
I’ve written a P2P LAN version of Twitter in Node.js. Every user has their own blockchain:
- Blocks contain metadata and links to blob UIDs.
- Blobs and blocks are dumped into a digestor, which assigns a UID
861844D6704E8573FEC34D967E20BCFE
and filepath/86/18/44/D6/70/4E/85/73/FE/C3/4D/96/7E/20/BC/FE
.
Each node has a manifest file containing the latest signed metadata for its primary user and all users it’s subscribed to, which is served over HTTP to the local network. Network broadcasts allow nodes to find one another.
My question is, when users want to free up space on their devices (there will be gigabytes of post data), what’s the best way to delete the oldest data?
I’ve got two methods I’m considering:
-
Random sampling where I randomly traverse 100 different paths and delete the oldest file. The shear amount of I/0 for this is concerning to me.
-
Digester manifest where I keep a file listing all UIDs added, and delete them one by one. The manifest could become corrupted however.
If you have any better ideas, I’d love to hear them.