Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting Java app to Go - any advice?

Tags:

java

c

go

We want to rewrite kodingen.com backend with Go which currently is Java, running as daemon using jsvc.

I have never touched any C in my life, am only experienced in Java so I don't know if this is something that I should even start.

However, task is pretty simple

  • read shell commands from mysql database
  • queue and execute them in parallel
  • save each shell output to the database

that's it. So these simple requirements gives me hope that I can start using this wonderful language.

What would you advise? Is C still better ?

like image 879
Devrim Avatar asked Apr 11 '10 23:04

Devrim


2 Answers

I like Go a lot and have made contributions to the project. However, I think you ought to consider a few things about Go before settling on it for sure.

  • Go is still an unstable language. Its syntax, features, and packages are all subject to change. Make sure you're ready to keep up with this if you choose to use it.
  • Go's garbage collection is still immature. Your memory usage should be better than 1.2 GB, but it probably won't get you near C levels.
  • There's no core support for MySQL (or any other database). There are several unofficial MySQL package projects. The most recently updated ones are GoMySQL and Go-MySQL-Client-Library. I don't know anything about how complete or stable they are.

As for queuing and executing in parallel, I think that's something Go will be able to do pretty well. You'll probably use the exec package to execute and parallelize with goroutines.

like image 138
Evan Shaw Avatar answered Sep 24 '22 17:09

Evan Shaw


I agree with @Chickencha

At this point I have no plans to update my [1]: http://github.com/chbfiv/libmysqlgo "libmysqlgo" project. Contributions are welcome, but I'm too busy atm. I would recommend using more active mysql go projects.

like image 43
chbfiv Avatar answered Sep 23 '22 17:09

chbfiv