42 ms·
EJDB: Embedded JSON Database for C/C++, .Net, NodeJS, Python, Lua, Java, Ruby
- pvnick 13y agoI love things like this. I generally work with JSON anyway when I'm doing one-off things like cron jobs, and I usually just keep my data in JSON flat files, so to have options like these really makes my life easier. Great job!
- meowface 13y agoI fully agree; databases that store JSON (or something close to it) natively are really useful when your application mostly inputs and outputs JSON. I feel there are too many JSON-store databases, though. Competition is good but it's been getting kind of ridiculous.
- deleted 13y ago[deleted]
- zekenie 13y ago(Maybe silly) question: if we're talking about the node implementation, why use this over mongodb?
- cheald 13y agoEmbeddable databases are nice and portable. It's like Sqlite versus Postgres - the latter may be more robust, but requiring it as a dependency greatly increases the effort needed to deploy your software. If an embedded database can do the job, it may be worth it as a matter of convenience.
- zekenie 13y agoThanks!
- Moto7451 13y agoSame reason why one might use SQLite over MySQL. Ease of configuration, no need to have a full blown DB server, lighter weight which makes it great for things like Raspberry Pi type hardware. For hackathons I've found it simpler to just use SQLite so I don't have to deal with MySQL configuration headaches that come up when IP addresses inevitably change. Outside of NodeJS, I can see this being pretty handy for iOS development. I'm not a huge fan of taking JSON from an API, converting it into an NSDictionary, and then placing it into Core Data and RESTKit doesn't always fit my needs. I think this might work well for local persistence of API data for an offline mode.
- andrewstuart 13y agoAre there issues with concurrency though when used in a web application?
- LeafStorm 13y agoYeah. But if you're not publishing it to the entire world, you probably won't run into them. And there are many other applications where databases are useful, that aren't network servers of any kind.
- andrewstuart 13y agoSo is it possible to use this as a database in a web app? What sort of problems would come up with concurrency?
- hendzen 13y agoSince the storage engine is a modified version of Tokyo Cabinet, I am assuming that you can have simultaneous readers, but a writer will lock everyone else out. From the Tokyo Cabinet specs [0]: 'Tokyo Cabinet provides two modes to connect to a database: "reader" and "writer". A reader can perform retrieving but neither storing nor deleting. A writer can perform all access methods. Exclusion control between processes is performed when connecting to a database by file locking. While a writer is connected to a database, neither readers nor writers can be connected. While a reader is connected to a database, other readers can be connect, but writers can not. According to this mechanism, data consistency is guaranteed with simultaneous connections in multitasking environment.' [0] - http://fallabs.com/tokyocabinet/spex-en.html http://fallabs.com/tokyocabinet/spex-en.html
- arms 13y agoVery nice. I'm writing a Python app where this would come in very handy. Can't wait to try it out.
- maratd 13y agoSo you've got C/C++, .Net, NodeJS, Python, Lua, Java, and Ruby covered ... but PHP is a no go? Why not change it to we're on everything but PHP? Seems more succinct.
- oinksoft 13y agoI'm not sure how to say this without being inflammatory ... there is a universe outside of PHP, and PHP is not at the center of that universe.
- maratd 13y ago> there is a universe outside of PHP, and PHP is not at the center of that universe. There is only one universe and PHP is a part of it. A big part. That's the reality. Some of us have to work on multiple platforms with multiple languages and it's truly a disappointment when the authors clearly put in an effort to cater to the community where multiple platform support is prioritized ... but then exclude a platform due to personal bias. That makes this project a no-go for me.
- andrewstuart 13y agoPHP might be in the pipeline.
- pvnick 13y agoI would say start treating the authors with the respect that they, as human beings, deserve. I too would like PHP support, but, if it's not there, I can still appreciate the hours and hours of labor that go into the support they do have. There's an expression "if you don't have anything nice/constructive to say, then don't say it," and claiming that it's a "disappointment" that they don't include your feature, and even going so far as to presume it's out of personal bias, is just rude. Edit: Besides, if you're running php, you're probably developing a web app, in which case you should be using a database like mysql or mongodb anyway, not an embeddable db.
- saosebastiao 13y ago
- gaara87 13y agoWould be pretty cool if replication can be achieved
- andrewstuart 13y agoThe disappointing thing about Tokyo Cabinet is that an empty database is six megabytes in size. Not good for embedded systems where space it short.
- ra 13y agoPresumably that was one of the motives behind this rewrite for embedded?
- skrebbel 13y agoI don't think this targets embedded systems. I believe the term "embedded" is used to signal that the db is embedded inside your app, and not an external server daemon that you need to talk to over some protocol.
- tericho 13y agoThis is awesome, I'm wondering how it performs for the average web app. Are there benchmarks load tests anywhere?
- pvnick 13y agoJust off my basic understanding of how the database works, I don't believe a production web app would be a very appropriate use-case, since considering it's an embeddable database you'll be bound by the slow filesystem. Mysql/postgres or mongodb would be better options. This is more for self-contained applications such as cron jobs or utilities.
- andrewstuart 13y agoReally? I'd be interested to hear why it can't be used as a web server database.
- pvnick 13y agoAgain, I must offer a disclaimer that I only read a fraction of the total source code, but I would assume it would involve similar use-cases to sqlite [1]. For example, IIRC, the Firefox web browser uses (used?) sqlite for storage. However, reading over the list I just referenced, I must correct myself and say that for most websites, you would probably be ok in using it; however, this seems to be an embeddable replacement for mongodb, which is typically used for high-traffic environments anyway. I'm coming more from a background of high-traffic sites with large datasets, so I typically rely upon more tailored solutions, but I should be careful not to see everything through my own narrow perspective! [1] http://www.sqlite.org/whentouse.html http://www.sqlite.org/whentouse.html
- hendzen 13y agoSince the underlying storage system is based on a modified version of Tokyo Cabinet [0], I don't see why it wouldn't be appropriate for small apps where a discrete DB would be overkill. [0] - http://fallabs.com/tokyocabinet/spex-en.html http://fallabs.com/tokyocabinet/spex-en.html
- programminggeek 13y agoThis looks awesome, but I find it odd how similar things on HN seem to pop up in bunches. It's as if once one thing hits HN, a very similar thing is automatically submitted and promoted to front page. It's a fairly strange social dynamic to be sure.
- melling 13y agoPeople want karma points so if they see something is of interest to the crowd, you get more of it.
- andrewstuart 13y agoIf only karma was cash. I'd be a hundredairre.
- zerr 13y agoWhy would anyone want karma? Really interesting.
- dspillett 13y agoSome people take point scoring all to seriously, like any +1 in some way validates their decision to get up this morning. We all crave a little validation in life. Some just look for it in what others would consider the most mundane, not-important-in-life's-grand-scheme, of sources.
- eieio 13y agoPersonally I'd like to have enough to be allowed to downvote. Not exactly my top priority, but it'd be nice.
- andrewstuart 13y agoI posted this link because I saw the post on the HN front page to unQlite and I thought I saw an embedded JSON database recently that's more interesting, so I posted a link to it. Whoever decides what goes on the front page of HN likes open source stuff with no commercial agenda with buzzwords around recent and interesting tech, so they bumped it to front page.
- dangayle 13y agoI was just asking the other day on #python if there was a nosql embedded DB like sqlite. I will definitely be checking this out. Might make things like my one-off test web scraping much easier.
- tuzemec 13y agoExactly my case. I have this web scraping based on scrapy and I was dealing with some big json files. I'll try it for sure.
- ddorian43 13y agohttp://www.reddit.com/r/Python/comments/1bap6u/embedded_document_store_eg_mongo_for_a_python/ http://www.reddit.com/r/Python/comments/1bap6u/embedded_docu...
- dangayle 13y agoLots of good links in there. Thanks!
- arethuza 13y agoCouldn't you layer a nosql engine on top of sqlite?
- ra 13y agoThere's Berkelydb, that's a KV store.
- deleted 13y ago[deleted]
- albertzeyer 13y agoIt is based on Tokyo Cabinet (which is under LGPL). On the homepage of Tokyo Cabinet, it says: "BTW, do you know Kyoto Cabinet? Actually, it is more powerful and convenient library than Tokyo Cabinet. At this distance of time, Kyoto Cabinet surpasses Tokyo Cabinet in every aspects. I strongly recommend you to use Kyoto Cabinet." I wonder why that isn't used. Maybe because Kyoto Cabinet is under GPL.
- chmodd 13y agoIndeed, this is probably the reason. The company that developed ejdb (Softmotions) apparently uses ejdb in their own proprietary software, and they wouldn't be able to if it contained any GPL components.
- munimkazia 13y agoThis looks interesting.. I have used nedb on a small project, That is another file based database, uses the same API as mongoDB. nedb is just an npm, so its only nodejs supported right now, and the feature list of EJDB looks more impressive anyway.
- pixelmonkey 13y agoI discovered this a few weeks ago and realized it might be a great fit as a data store for a 'local, self-contained' web application. That is, a web app that is meant to run locally & in the browser (like IPython Notebook) but needs a database for local persistence, without the complexity of using the filesystem for storage. It's basically the benefits of SQLite with a simpler, NoSQL interface/design.
- wslh 13y agoI think one of the key points is being able to run the "same" lib in different programming languages. This is a model of thinking that need to be followed as much as possible. If not, we are rounding in circles with zillions of libraries created for Javascript that already are present in other programming languages the energies end up unfocused. At the same time we need tools that help us in this approach, like HaXe or SWIG. One lib that I love is NetworkX, If you look at the source code it can be easily ported to more programming languages. At the same time it is impressive what Cocos2D achieved with their Javascript bindings and HTML5 native support.