amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
17.92k stars 1.16k forks source link

Expiry #68

Open amark opened 9 years ago

amark commented 9 years ago

Sadly the heroku server crashed from too much memory usage. So it looks like adding an LRU expiry or some type of flushing mechanism is going to be pretty important sooner rather than later.

amark commented 9 years ago

Needs to have hooks for #45 :) .

amark commented 7 years ago

Still need this, likely important for core! So I want to keep this issue alive.

Note to people: With v0.6.1 of gun, there is still no internal expiry/eviction/LRU yet.

lmangani commented 7 years ago

+1

ctrlplusb commented 7 years ago

@amark - any workarounds? Browsers only support 5mb local storage too right, what happens when this limit is hit?

amark commented 7 years ago

@ctrlplusb last time I checked, when 5MB limit is hit gun will give you errors on your put but will still sync data out to the server. Just localStorage won't have it.

leonardpauli commented 6 years ago

It would be neat to be able to specify the flushing mechanism in options, though plugin, or with object meta data;

Also:

Notes:

amark commented 6 years ago

Oh, just FYI since I forgot to mention this lib/later is a prototype for TTL stuff, you can use it like:

gun.get('foo').later(function(doc){
  console.log("goodbye:", doc);
  this.off(); // unsubscribe from the data
}, 5); // 5 seconds
// NOTE: if you use `lib/memdisk`, the unsubscribe
// will also skip writing it to disk.

These are experimental of course. And I'm working on an adapter/middleware that checks for null updates across peers and deletes the data from in-memory. Deleting from disk is harder, because every storage adapter has to specially implement that. (As demand for this increases... I'll probably add a standardized protocol for it, add support for it in RAD, and then make it optional for adapters plugging into RAD, but support it in the default ones... but this will probably be after v1.0 and not high on priority... although if somebody wants to help, that would be great!)

@LeonardPauli these are actually great use case configurations that could probably be done pretty easily with a fork to the localStorage adapter https://github.com/amark/gun/blob/master/src/adapters/localStorage.js . I don't have time for it right now, but I'll keep it in mind for future / or if anybody else who has already written a storage adapter, they probably have enough experience.

Global error handling: I want this too! I already have global error logging, so you could actually "hack" this right now by doing something weird/stupid like:

old_log = Gun.log;
Gun.log = function(a){ if(a && a.err){ globalErrorHandler(a) } old_log.call(parameter.slice().whateverTheJSis) }

Search the github issues for pagination, right now this can be done in the data structure itself, I do have a wire spec/protocol for doing byte-constrained reads, but haven't implemented it yet.

indexedDB still has a cap, but user approval can up it. Better to do an Electron app or similar to get full storage access.

ericvrp commented 2 years ago

Why are there some many issues still open?

Has this project no maintainer anymore?

lmangani commented 2 years ago

It does and a very good one actually, but in such a fast paced and faceted project priorities have to be kept-alive by relevance and or factual impact reports, on top of that user contributions and issue revalidations are not as high as they could and should be.