Re: [nodejs] Re: embedded database options for Nodejs

2013-06-03 Thread Louis Chatriot
I'm a bit late to the party but you can try NeDB : https://github.com/louischatriot/nedb It's a pure javascript database with no external dependency, that implements the most common part of MongoDB's API. You can use it as an in-memory only or persistent datastore. Le samedi 20 avril 2013

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-20 Thread Gabriel Farrell
For those interested in leveldb this recent NodeUp is worth a listen: http://nodeup.com/fortyone. On Fri, Apr 19, 2013 at 2:52 PM, John Fitzgerald jrfitzger...@gmail.comwrote: When using these embedded databases, like node-levelup, how do you handle cluster based apps? I'd love to use an

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Mike Parsons
https://github.com/developmentseed/node-sqlite3 I've used this quite extensively on linux/windows/mac and even Raspberry PI On Friday, April 19, 2013 4:59:28 AM UTC-4, Angelo Chen wrote: Hi, What are the options for embedded database? I use redis and mongodb for now, but sometimes you

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Ben Taber
There's dirty for super simple storage: https://github.com/felixge/node-dirty On Friday, April 19, 2013 2:59:28 AM UTC-6, Angelo Chen wrote: Hi, What are the options for embedded database? I use redis and mongodb for now, but sometimes you made some small apps, and does not want to mix

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Angelo Chen
Hi Ben, this is interesting, I can find good use case for that, the repository is of felixge, but the author is you, does that men felixge is no longer in this project? Thanks, Angelo On 4月19日, 下午10时07分, Ben Taber ben.ta...@gmail.com wrote: There's dirty for super simple

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Ben Taber
Felix is still the owner and wrote most of the code, I've just been helping out lately. On Fri, Apr 19, 2013 at 8:51 AM, Angelo Chen angelochen...@gmail.comwrote: Hi Ben, this is interesting, I can find good use case for that, the repository is of felixge, but the author is you, does that

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Kevin Swiber
Angelo, Not at this time. Implementing a browser shouldn't be too difficult, though. Medea stores both keys and values as Buffer objects. You could iterate through the key-value store and stringify key and value Buffers prior to display. There are a number of Web front-end data grids you

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Angelo Chen
Hi Kevin, just tried, got a question, is there a way to open() at beginning, then use it later? the sample is, you have to put the code in a callback, this does not work: ar Medea = require('medea'); var medea = new Medea(); medea.open() medea.get('hello', function(err, val) {

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Angelo Chen
Hi Ben, looks like, you have to put access code in db.on('load', ...) how to just open the database once at beginning, then use later? say all the database code will be in mydao.js, exporting some CRUD methods, so I can call from another js, dao.append({id:1, data:'d'}) in this append method, I

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Kevin Swiber
There's no synchronous open at this time. This has been an issue a couple of times when porting apps to Medea as most Node database libraries use synchronous database initialization by default. Adding db.openSync is more time-consuming work than you may think. There's a lot going on when you

[nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Ben Taber
No guarantees that you can read a record before .load has been called, but you can write before load. https://github.com/felixge/node-dirty#dirty-event-load-length To just open the file once on app init, wrap it in its own module, and then require that into other modules. Something like below

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread John Fitzgerald
When using these embedded databases, like node-levelup, how do you handle cluster based apps? I'd love to use an embedded database, but also need to run our express app on all 8 cores of the machine. I know I can process.send to children master, but that seems like a clunky way of interfacing.

Re: [nodejs] Re: embedded database options for Nodejs

2013-04-19 Thread Kevin Swiber
Hey John, I created medea-clusterify[1] to handle this use case. It's using worker.send and process.send to do exactly as you describe. This is not ideal, but it works. The master process holds the Medea instance, and the workers communicate with it. This means the master process can