{"action":"created","issue":{"url":"https://api.github.com/repos/juliangruber/multilevel/issues/64","labels_url":"https://api.github.com/repos/juliangruber/multilevel/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/juliangruber/multilevel/issues/64/comments","events_url":"https://api.github.com/repos/juliangruber/multilevel/issues/64/events","html_url":"https://github.com/juliangruber/multilevel/issues/64","id":62919956,"number":64,"title":"multilevel-down","user":{"login":"juliangruber","id":10247,"avatar_url":"https://avatars.githubusercontent.com/u/10247?v=3","gravatar_id":"","url":"https://api.github.com/users/juliangruber","html_url":"https://github.com/juliangruber","followers_url":"https://api.github.com/users/juliangruber/followers","following_url":"https://api.github.com/users/juliangruber/following{/other_user}","gists_url":"https://api.github.com/users/juliangruber/gists{/gist_id}","starred_url":"https://api.github.com/users/juliangruber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliangruber/subscriptions","organizations_url":"https://api.github.com/users/juliangruber/orgs","repos_url":"https://api.github.com/users/juliangruber/repos","events_url":"https://api.github.com/users/juliangruber/events{/privacy}","received_events_url":"https://api.github.com/users/juliangruber/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/juliangruber/multilevel/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-03-19T08:46:08Z","updated_at":"2015-03-23T19:17:13Z","closed_at":null,"body":"Similar to how subleveldown fixes some issues sublevel has (not judging whether it's better in total), let's discuss whether implementing multilevel as a backend would be more useful.\r\n\r\nSome things to discuss:\r\n\r\n- streams: we need to expose iterators, probably with implicit buffering\r\n- batches: we'd get the chained batch for free since that's in levelup\r\n- encodings: we'd get encodings for free since those are in levelup\r\n- deferred open: that's also already handled in levelup\r\n- bundle size: when bundling for the browser, could shipping the full levelup plus read streams implementations be a problem?\r\n- maintenance\r\n- performance in general\r\n- etc...\r\n\r\nWhat do you think?\r\n\r\nFrom the top of my head: @dominictarr @hij1nx @ralphtheninja @substack @mafintosh @maxogden @feross @jcrugzz"},"comment":{"url":"https://api.github.com/repos/juliangruber/multilevel/issues/comments/85154825","html_url":"https://github.com/juliangruber/multilevel/issues/64#issuecomment-85154825","issue_url":"https://api.github.com/repos/juliangruber/multilevel/issues/64","id":85154825,"user":{"login":"dominictarr","id":259374,"avatar_url":"https://avatars.githubusercontent.com/u/259374?v=3","gravatar_id":"","url":"https://api.github.com/users/dominictarr","html_url":"https://github.com/dominictarr","followers_url":"https://api.github.com/users/dominictarr/followers","following_url":"https://api.github.com/users/dominictarr/following{/other_user}","gists_url":"https://api.github.com/users/dominictarr/gists{/gist_id}","starred_url":"https://api.github.com/users/dominictarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominictarr/subscriptions","organizations_url":"https://api.github.com/users/dominictarr/orgs","repos_url":"https://api.github.com/users/dominictarr/repos","events_url":"https://api.github.com/users/dominictarr/events{/privacy}","received_events_url":"https://api.github.com/users/dominictarr/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T19:17:13Z","updated_at":"2015-03-23T19:17:13Z","body":"@jcrugzz encoding doesn't _always_ happen near the users. for example, in sublevel, each db adds a prefix (an array of strings) to the key, and then passes it to a core unit, which applies encodings and passes to leveldown. It helps a lot to not encode anything immediately, because then you still have access to it for pre/post hooks.\r\n\r\nI'm wondering, maybe we can have an abstract-leveldown-wrapper which takes a leveldown, returns a new leveldown, and provides pre and post methods which are called before a leveldown method is called, or after leveldown calls back.\r\n\r\npre/post would allow you to change the argument, so you could apply an encoding, or transform the key... maybe pre/post could be async too?"}}