Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a multi-thread application with Node.js, accessing a LevelDB?

There is this in LevelUP Documentation (https://github.com/rvagg/node-levelup#multi-process-access):

LevelDB is thread-safe but is not suitable for accessing with multiple processes. You should only ever have a LevelDB database open from a single Node.js process. Node.js clusters are made up of multiple processes so a LevelUP instance cannot be shared between them either.

So I could not use Node Cluster (http://nodejs.org/api/cluster.html)

Is there another option to make a multi-process (or multi-thread) Node.js Application accessing a LevelDB Database?

like image 754
Leonardo Avatar asked Nov 01 '22 06:11

Leonardo


1 Answers

I'd say level-party is what you're looking for. Of course in terms of having multiple leveldb's for each child thread i'm not sure if know the answer to that.

like image 64
latrasis Avatar answered Nov 04 '22 03:11

latrasis