1

would like to have your opinion about my design and technological choices to solve a problem.
I'm getting a continuos data feed (a speed value V) from a serial port of a computer connected to a speed sensor through a microcontroller (that sends the value each 30 seconds).

I want to do 2 things :

- store V and a timestamp to a MongoDB
- serve this speed to a webpage and draw a chart.

Storing V and timestamp is for processing this data and computing few metrics (not in realtime).
I choose Mongo as it's the choice I made for the rest of the app (web app) (schema less, json, capped collections for my speed logs, realtime things ...)

I'm planning to go with nodejs and a spawn(cat /dev/ttyS0) to get my data feed, then, I can store it to a local MongoDB and serving it through an http server.

I just found https://github.com/voodootikigod/node-serialport that can be more powerful than my spawn (cat ...)

Would you do the same thing?

And, how would you sync the local MongoDB speed collection with a distant MongoDB database ?

Thanks for your help and ideas !

PS: I have 3 machines, 3 feeds with 3 different serial ports and 3 node servers / Local MongoDBs...

1 Answer 1

1

Holy Toledo!

It's clear your setup will work. But it's huge overkill just to collect and store maybe 8640 data points over a 24-hour day. Are you sure you want to undertake to install and maintain all of that support software? And then babysit (or train an operator to babysit) that crap? software? And when you move on, well, who's going to inherit your house of cards? system?

I admit I started rasslin' (sp?) serial comm a while ago1 but I wonder why it's not a 200-line user program, maybe running in the background.2

So: How come you need all that stuff?


1 Long before all this <snicker> modern froo-fooraw, Sonny <hack> <hack> <ptui!> between them twenty-five-mile walks to school through ten feet of bear-infested snow, after we scratched our cuneiform homework on camel-dung tablets by torchlight, dontcha' know. Man, that cave was some humid! In them days, a slice of rancid camel liver was a treat by God and we was damned lucky to get it and a Saturday celebration meant ten minutes alone with the baby raccoon (hey, watch them teeth, Sweetheart!) and a quick hit off the peace pipe.

2 And what's your backup plan when the daily steam outage comes along?

Sign up to request clarification or add additional context in comments.

2 Comments

what the hell are you talking about? is this english?
This answer made me laugh. I like the humor syntax.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.