tags:

views:

121

answers:

3

Looking to write an SNMP and Netflow tool for Linux\BSD and seeking advice on language selection, C or Java.

The tool will collect Netflows, send and recieve SNMP queries, connect to a Postgresql Databases and will be fronted by a web interface (PHP), in the future it will interface with devices using web services.

Normally I would have reached for C to implement the above, plenty of robust libraries and low level access to the network stack but the database access and web services could be implemented easier (better?) in Java.

Question is whether Java is up to the task of processing all this network information under load or should I stick with lower level access provided by C?

Supplemental question, I've been considering making this a hybrid application. Heavy lifting in C and doing the higher level stuff in Java. Experiences and thoughts on this are welcome.

+3  A: 

Java's implementations today are robust and mature, so your worry about whether they're "up to processing ... under load" are misplaced. C has its advantages (tiniest memory footprint, fastest startup times), but you pay dearly for them in terms of programming work needed to do your own memory management. It doesn't appear from what you say that minimizing memory or optimizing frequent restart is a big deal for this app, anyway. Why don't you start with Java (or whatever other high-level language you're most comfortable with) and only consider recoding some parts in C, maybe, if and when your profiling shows CPU- or memory-bottlenecks arising from the higher-level language use? (I'd bet you'll most likely end up not needing such recoding, btw).

Alex Martelli
+1  A: 

I would absolutely go with Java on this. It's entirely capable of handling the "load". I work on Java projects which are responsible for processing extremely large amounts of data in real-time and without issue.

Java wont struggle one bit for what you are talking about doing here and it will be far easier and quicker to develop in.

S73417H
A: 

Everyone's nailed this; the modern JVM implementations are in the same ballpark as C for speed, unless you're doing direct hardware access.

I'm curious why you'd consider a Java backend for a PHP frontend. C/PHP would make sense, but if you're going for Java on the backend, it might help to have the same language throughout for easier maintainability.

Dean J
Yes I should have made that clear, if going with Java for the backend I'd be using it on the web interface side as well. Preferably something light without requiring a million dependencies and xml files for configuration of each component.
ServerMonkey
Sounds like this isn't your first rodeo with Java. As long as you were making a DAO layer for the web side, you could just reuse that for the backend as well, and save some code in the meanwhile. Either way, let us know how it goes.
Dean J