{"action":"created","issue":{"url":"https://api.github.com/repos/deanlandolt/bytewise/issues/19","labels_url":"https://api.github.com/repos/deanlandolt/bytewise/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/deanlandolt/bytewise/issues/19/comments","events_url":"https://api.github.com/repos/deanlandolt/bytewise/issues/19/events","html_url":"https://github.com/deanlandolt/bytewise/issues/19","id":108085159,"number":19,"title":"Expand on use cases","user":{"login":"emilbayes","id":416524,"avatar_url":"https://avatars.githubusercontent.com/u/416524?v=3","gravatar_id":"","url":"https://api.github.com/users/emilbayes","html_url":"https://github.com/emilbayes","followers_url":"https://api.github.com/users/emilbayes/followers","following_url":"https://api.github.com/users/emilbayes/following{/other_user}","gists_url":"https://api.github.com/users/emilbayes/gists{/gist_id}","starred_url":"https://api.github.com/users/emilbayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilbayes/subscriptions","organizations_url":"https://api.github.com/users/emilbayes/orgs","repos_url":"https://api.github.com/users/emilbayes/repos","events_url":"https://api.github.com/users/emilbayes/events{/privacy}","received_events_url":"https://api.github.com/users/emilbayes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-24T08:39:51Z","updated_at":"2015-10-11T12:06:08Z","closed_at":null,"body":"Hi Dean,\r\n\r\nI asked a question #leveldb the other day about partitioning my dataset in leveldb, to get \"implicit indexing\" (example will follow) and @ralphtheninja sent me over here. I had looked at bytewise and I'm very intrigued by all the use-cases but I fail to see how they can be carried out by bytewise. Maybe I lack formal CS education or just imagination :stuck_out_tongue: \r\n\r\nAnyway, currently I have a key structure like `{gender: 'M', name: 'Emil'}` which is then encoded as `M!Emil`. This means I can efficiently retrieve all records that are male or female, or all male names starting with `E`, but not much more than that. I can effectively use range queries to do search suggestions as shown by [`level-trie`](https://github.com/juliangruber/level-trie/blob/c72ae4902bc67b311d794b5cb28d9274996dfb22/index.js#L29) since lexicographic sorting will have common prefixes in order.\r\n\r\nHowever how would you do partitioning with bytewise? How about full text search? I tried to look into 'CouchDB-style \"joins\"', but the links seem to be dead :disappointed: \r\n\r\nThe original IRC correspondence on `#leveldb`:\r\n\r\n```\r\n14:06 <tixz> How will `keyEncoding: 'json'` behave when specifying ranges? I mean, V8 doesn't reorder keys so {foo: 1, bar: 2} !== {bar: 2, foo: 1} when using JSON.stringify, so my ranges would become unreliable, right?\r\n14:07 <tixz> I can't really seem to find much info on keyEncoding, but I love the trick that a carefully constructed key can be used as an index :D\r\n18:00 <ralphtheninja> tixz: you can use other encodings, e.g. bytewise https://github.com/deanlandolt/bytewise\r\n18:11 <tixz> ralphtheninja: I looked at bytewise, but can I choose the order of keys? I have a key structure where I can exploit the keys for partitioning/indexing the dataset, but it requires the keys to be in a specific order\r\n18:13 <tixz> ralphtheninja: All the uses cases sound wonderful (https://github.com/deanlandolt/bytewise#use-cases) but I guess I lack imagination :p\r\n18:45 <ralphtheninja> tixz: post an issue on bytewise repo and ask dean :)\r\n18:46 <ralphtheninja> be prepared for an extensive answer to your specific use case :)\r\n19:07 <tixz> ralphtheninja: Haha, thanks will try :)\r\n```"},"comment":{"url":"https://api.github.com/repos/deanlandolt/bytewise/issues/comments/147186540","html_url":"https://github.com/deanlandolt/bytewise/issues/19#issuecomment-147186540","issue_url":"https://api.github.com/repos/deanlandolt/bytewise/issues/19","id":147186540,"user":{"login":"emilbayes","id":416524,"avatar_url":"https://avatars.githubusercontent.com/u/416524?v=3","gravatar_id":"","url":"https://api.github.com/users/emilbayes","html_url":"https://github.com/emilbayes","followers_url":"https://api.github.com/users/emilbayes/followers","following_url":"https://api.github.com/users/emilbayes/following{/other_user}","gists_url":"https://api.github.com/users/emilbayes/gists{/gist_id}","starred_url":"https://api.github.com/users/emilbayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilbayes/subscriptions","organizations_url":"https://api.github.com/users/emilbayes/orgs","repos_url":"https://api.github.com/users/emilbayes/repos","events_url":"https://api.github.com/users/emilbayes/events{/privacy}","received_events_url":"https://api.github.com/users/emilbayes/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T12:06:08Z","updated_at":"2015-10-11T12:06:08Z","body":"Sorry for getting back so late.\r\n\r\nWhat you say about the \"duality\" of Javascript objects is exactly my problem. I want \"named\" tuples, and tried to [solve it here](https://github.com/politiken-journalism/tuple-encoding), but realise now I should have built it on `bytewise`. What are the solutions that you think you have worked out?\r\n\r\nI hadn't considered just being verbose with the FTI stuff. Maybe I'm still trying to be too optimal, too early. With regards to partitioning, all that I was thinking of was the specific usecase I had at hand, `gender` being dichotomous and `name` being an arbitrary string. Thank you for the elaborate answers."}}