{"action":"created","issue":{"url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/12","repository_url":"https://api.github.com/repos/wildstang/wildrank-desktop","labels_url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/12/comments","events_url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/12/events","html_url":"https://github.com/wildstang/wildrank-desktop/issues/12","id":193697560,"number":12,"title":"Investigate custom data storage solution","user":{"login":"nwalters512","id":1476544,"avatar_url":"https://avatars.githubusercontent.com/u/1476544?v=3","gravatar_id":"","url":"https://api.github.com/users/nwalters512","html_url":"https://github.com/nwalters512","followers_url":"https://api.github.com/users/nwalters512/followers","following_url":"https://api.github.com/users/nwalters512/following{/other_user}","gists_url":"https://api.github.com/users/nwalters512/gists{/gist_id}","starred_url":"https://api.github.com/users/nwalters512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwalters512/subscriptions","organizations_url":"https://api.github.com/users/nwalters512/orgs","repos_url":"https://api.github.com/users/nwalters512/repos","events_url":"https://api.github.com/users/nwalters512/events{/privacy}","received_events_url":"https://api.github.com/users/nwalters512/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-12-06T06:58:01Z","updated_at":"2016-12-06T17:18:23Z","closed_at":null,"body":"We currently use Couchbase Lite for all data storage. The benefit of that is that it's a battle-tested library: someone's done all the hard work of squashing bugs, ensuring reliability, and optimizing performance.\r\n\r\nHowever, the downside of that is we are all but forced into using Java for all apps that want to touch the database. Couchbase uses different binary database formats and data storage engines depending on the platform, and as we're forced to interact directly with database files on the flash drive, we have to use their client libraries that use SQLite (I think) as the binary format, so we're pretty much locked into using Java.\r\n\r\nThe reason this is applicable is because I *hate* desktop Java apps with a passion and I wanted to build a nice [Electron](http://electron.atom.io/) app that is hopefully a lot more usable than what we have now. However, we'd have to bridge from JS to Java somehow, and that makes me cringe just thinking about it. The desktop app isn't exactly user-friendly, and I fear WildRank will fall out of use given that we haven't exactly done a great job of documenting how to use it from end to end.\r\n\r\n## Proposal\r\nA good option would be to model after something like [nedb](https://github.com/louischatriot/nedb), where our \"database\" is just a bunch of JSON-encoded objects in a text file. The obvious benefit there is that UTF-8 files are very obviously portable. We should be able to hold the entire database in memory, as the number of documents we're dealing with is *at most* on the order of 1000.\r\n\r\nIn fact, all we'd really have to do is build a Java library that conforms to the spec setup by `nedb`. It doesn't have to be particularly fancy in the sense that we don't have to support complex queries; most of our queries will either be fetching objects with a certain key or iterating over all objects of a certain type to generate lists.\r\n\r\nConcerns:\r\n* Reliability: USB-OTG adapters aren't exactly the most reliable thing in the world. Couchbase has pretty good corruption protection built in. How hard will it be to make our own work fault-tolerant?\r\n* Performance: This probably won't be a problem given the relatively small number of documents we're dealing with. But it's worth investigating how long it takes to deserialize/query/serialize/etc.\r\n\r\n@garwards @smitty6791 @mail929 don't know if any of you are involved enough in WildRank for all of that to mean anything or if you have any thoughts on this idea. Comments welcome."},"comment":{"url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/comments/265211762","html_url":"https://github.com/wildstang/wildrank-desktop/issues/12#issuecomment-265211762","issue_url":"https://api.github.com/repos/wildstang/wildrank-desktop/issues/12","id":265211762,"user":{"login":"nwalters512","id":1476544,"avatar_url":"https://avatars.githubusercontent.com/u/1476544?v=3","gravatar_id":"","url":"https://api.github.com/users/nwalters512","html_url":"https://github.com/nwalters512","followers_url":"https://api.github.com/users/nwalters512/followers","following_url":"https://api.github.com/users/nwalters512/following{/other_user}","gists_url":"https://api.github.com/users/nwalters512/gists{/gist_id}","starred_url":"https://api.github.com/users/nwalters512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwalters512/subscriptions","organizations_url":"https://api.github.com/users/nwalters512/orgs","repos_url":"https://api.github.com/users/nwalters512/repos","events_url":"https://api.github.com/users/nwalters512/events{/privacy}","received_events_url":"https://api.github.com/users/nwalters512/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T17:18:23Z","updated_at":"2016-12-06T17:18:23Z","body":"That's actually a really great idea. You guys could design a nice 3D printed case and battery circuitry and release the whole thing alongside WildRank so that other teams can still use it; I know at least 876 is pretty invested in our software. We could wrap up the whole server in a container (Docker? Yay buzzwords!) to make deploying idiotproof and let people run on hardware of their choice. I think I'll have to get my RPi out of the closet and start playing around with that."}}
{"actor":{"display_login":"nwalters512"}}