- Node.js
- MongoDB
- CoffeeScript
npm install -g coffee-script
- Dependencies
npm install
client_config.coffee
server_config.coffee
The server.coffee
automaticaly sets up db, it will create
- 2.000.000 white
- 40.000 exempt
- 20.000 exception
entries (if there are more entries, it will remove the left over).
- on the server:
time mongodump -d kompl -c entries -o dump && tar -cjf dump.tar.bz2 dump/
--> takes about 18 secs, ~28MB Backup - on the server: serve file (nginx or similar)
- on the client:
wget -O ./dump.bson.bz2 URL && time tar xvjf ./dump.tar.bz2 && time mongorestore -d kompl_restore ./dump/kompl
--> takes about 70 seconds - in real world: switch db after restoring backup
coffee obu_insert_40k.coffee
- --> takes about 2.3 seconds
coffee obu_find.coffee
--> select 100 random entriescoffee obu_insert.coffee
--> make an insert every 1ms (1k entries / sec)- --> takes about 50ms
coffee server.coffee
, wait tillWebSocketServer started
appears.coffee client.coffee
- 40k entries will take about 5.5 seconds (cause on the client side, it makes an update, not an insert)
use replication