[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Server Programming

Andy Stone

10/25/2004 4:09:00 PM

Hello all,

The company I work for currently utilizes JAVA/JSP, ORACLE 9i,
Apache,Tomcat setup running on Solaris. We have plans to migrate to
PostgreSQL and Linux. Currently I have an issue with a server written
in JAVA that hangs about once a week (don't know exactly why yet -
hence the vague term) and we recently had it create a defunct port
while trying to shut down. I did not write this server, but am the
only one left to maintain this code.

Now you know why I am here. I am looking into Ruby as an alternative
to this JAVA Server. The core functionality needed would be processing
zip files, parsing text/binary files and executing sql statements.

At this stage, how does Ruby compare to Java in terms of server
programming? I have liked everything I've read about Ruby to date,
but have seen very little in reference to server programming, but then
again, I'm just beginning.

Please excuse the vagueness, I'm very undecided what to do right now,
rewrite the JAVA Server in another language or rewrite it with JAVA,
but correctly. The main reason for the other language consideration
is the text and binary file processing. I'm was thinking Ruby might
handle this aspect better than JAVA.

thanks,
andy


19 Answers

Francis Hwang

10/25/2004 11:40:00 PM

0

Hi Andy,

What's the server part of this? I understand processing zip files,
parsing text/binary, executing SQL, all of that, but I think you've
been a little vague as to how all these actions fit into the overall
function of the server in your company. Is this a web server, then I
take it? Or some other sort of server?

At any rate, everything you've said so far can be handled fine in Ruby,
and you'll probably find it a lot more fun to write than in Java. If
you have other specific concerns you should just bring them up and we
can address them.

Francis


On Oct 25, 2004, at 12:08 PM, Andy Stone wrote:

> Hello all,
>
> The company I work for currently utilizes JAVA/JSP, ORACLE 9i,
> Apache,Tomcat setup running on Solaris. We have plans to migrate to
> PostgreSQL and Linux. Currently I have an issue with a server written
> in JAVA that hangs about once a week (don't know exactly why yet -
> hence the vague term) and we recently had it create a defunct port
> while trying to shut down. I did not write this server, but am the
> only one left to maintain this code.
>
> Now you know why I am here. I am looking into Ruby as an alternative
> to this JAVA Server. The core functionality needed would be processing
> zip files, parsing text/binary files and executing sql statements.
>
> At this stage, how does Ruby compare to Java in terms of server
> programming? I have liked everything I've read about Ruby to date,
> but have seen very little in reference to server programming, but then
> again, I'm just beginning.
>
> Please excuse the vagueness, I'm very undecided what to do right now,
> rewrite the JAVA Server in another language or rewrite it with JAVA,
> but correctly. The main reason for the other language consideration
> is the text and binary file processing. I'm was thinking Ruby might
> handle this aspect better than JAVA.
>
> thanks,
> andy
>



Dido Sevilla

10/26/2004 12:45:00 AM

0

On Tue, 26 Oct 2004 01:08:41 +0900, Andy Stone <xsltguru@gmail.com> wrote:
> Now you know why I am here. I am looking into Ruby as an alternative
> to this JAVA Server. The core functionality needed would be processing
> zip files, parsing text/binary files and executing sql statements.
>

This is all par for the course. Ruby is very much capable of all these
things, but there are certain DBD's that aren't as well maintained as
others, so knowing what your database backend is would be useful
(specifically it would appear that the Sybase driver is woefully out
of date).

Ruby is in my opinion a much, much more elegantly pleasant language to
work with than Java will ever be.

> At this stage, how does Ruby compare to Java in terms of server
> programming?

I assume you mean web server programming. More generic application
server programming is also doable and most of the common protocols
already have direct support by the Ruby core (e.g. http, smtp,
pop/imap, and so forth).

> I have liked everything I've read about Ruby to date,
> but have seen very little in reference to server programming, but then
> again, I'm just beginning.
>

Try going to http://www.rubyon...

It's an MVC framework like the Apache Project's Jakarta Struts, but it
is in my experience a lot simpler and easier to program in. As they
put it, you'll be able to build a full-featured web application using
less lines of code than many other frameworks use for their XML
configuration files...


Andy Stone

10/26/2004 1:03:00 AM

0

Hello Francis,

Thanks for the reply.

This isn't a web server, just a JAVA client/server application that
starts a few threads that have their own individual responsibilities.
The server app is merely a container for these threads to allow the
basic functions like startup,shutdown,and status to be handled
cleanly.

Being that I don't have any specific questions, I'll just start
writing a version in Ruby and will post questions (as they arise) to
answers I can't find elsewhere.


Thanks again,
andy

On Tue, 26 Oct 2004 08:39:50 +0900, Francis Hwang <sera@fhwang.net> wrote:
> Hi Andy,
>
> What's the server part of this? I understand processing zip files,
> parsing text/binary, executing SQL, all of that, but I think you've
> been a little vague as to how all these actions fit into the overall
> function of the server in your company. Is this a web server, then I
> take it? Or some other sort of server?
>
> At any rate, everything you've said so far can be handled fine in Ruby,
> and you'll probably find it a lot more fun to write than in Java. If
> you have other specific concerns you should just bring them up and we
> can address them.
>
> Francis
>
>
>
>
> On Oct 25, 2004, at 12:08 PM, Andy Stone wrote:
>
> > Hello all,
> >
> > The company I work for currently utilizes JAVA/JSP, ORACLE 9i,
> > Apache,Tomcat setup running on Solaris. We have plans to migrate to
> > PostgreSQL and Linux. Currently I have an issue with a server written
> > in JAVA that hangs about once a week (don't know exactly why yet -
> > hence the vague term) and we recently had it create a defunct port
> > while trying to shut down. I did not write this server, but am the
> > only one left to maintain this code.
> >
> > Now you know why I am here. I am looking into Ruby as an alternative
> > to this JAVA Server. The core functionality needed would be processing
> > zip files, parsing text/binary files and executing sql statements.
> >
> > At this stage, how does Ruby compare to Java in terms of server
> > programming? I have liked everything I've read about Ruby to date,
> > but have seen very little in reference to server programming, but then
> > again, I'm just beginning.
> >
> > Please excuse the vagueness, I'm very undecided what to do right now,
> > rewrite the JAVA Server in another language or rewrite it with JAVA,
> > but correctly. The main reason for the other language consideration
> > is the text and binary file processing. I'm was thinking Ruby might
> > handle this aspect better than JAVA.
> >
> > thanks,
> > andy
> >
>
>


David Ross

10/26/2004 1:13:00 AM

0

My project usage with Ruby comes pretty close to what you are using it
for with your project.

Recently I created a SOAP client/server which were seperate handling
frontend and backend for customers to access company information. The
program handled authentication, database access, and scripts that ran
every night updating any information changed from external data formats.
Ruby runs fine for server/client applications. I hgive it a big A+. I've
had a few problems sure, but the Japanese Ruby community are really
nice. There are some nice non-ignorant people out there as well, usually
you can find them on IRC(note: there are still ignorant ones out there).
Thanks to NaHi I was able to complete my applications. Ruby is very good
for what ou have in mind.

If you need help, drop by on
irc://irc.efnet.net/ruby-lang
or
irc://irc.freenode.net/rubymine

I would be glad to answer any questions you have.


David Ross
--
Hazzle free packages for Ruby?
RPA is available from http://www.rubyar...




Andy Stone wrote:

>Hello Francis,
>
>Thanks for the reply.
>
>This isn't a web server, just a JAVA client/server application that
>starts a few threads that have their own individual responsibilities.
>The server app is merely a container for these threads to allow the
>basic functions like startup,shutdown,and status to be handled
>cleanly.
>
>Being that I don't have any specific questions, I'll just start
>writing a version in Ruby and will post questions (as they arise) to
>answers I can't find elsewhere.
>
>
>Thanks again,
>andy
>
>On Tue, 26 Oct 2004 08:39:50 +0900, Francis Hwang <sera@fhwang.net> wrote:
>
>
>>Hi Andy,
>>
>>What's the server part of this? I understand processing zip files,
>>parsing text/binary, executing SQL, all of that, but I think you've
>>been a little vague as to how all these actions fit into the overall
>>function of the server in your company. Is this a web server, then I
>>take it? Or some other sort of server?
>>
>>At any rate, everything you've said so far can be handled fine in Ruby,
>>and you'll probably find it a lot more fun to write than in Java. If
>>you have other specific concerns you should just bring them up and we
>>can address them.
>>
>>Francis
>>
>>
>>
>>
>>On Oct 25, 2004, at 12:08 PM, Andy Stone wrote:
>>
>>
>>
>>>Hello all,
>>>
>>>The company I work for currently utilizes JAVA/JSP, ORACLE 9i,
>>>Apache,Tomcat setup running on Solaris. We have plans to migrate to
>>>PostgreSQL and Linux. Currently I have an issue with a server written
>>>in JAVA that hangs about once a week (don't know exactly why yet -
>>>hence the vague term) and we recently had it create a defunct port
>>>while trying to shut down. I did not write this server, but am the
>>>only one left to maintain this code.
>>>
>>>Now you know why I am here. I am looking into Ruby as an alternative
>>>to this JAVA Server. The core functionality needed would be processing
>>>zip files, parsing text/binary files and executing sql statements.
>>>
>>>At this stage, how does Ruby compare to Java in terms of server
>>>programming? I have liked everything I've read about Ruby to date,
>>>but have seen very little in reference to server programming, but then
>>>again, I'm just beginning.
>>>
>>>Please excuse the vagueness, I'm very undecided what to do right now,
>>>rewrite the JAVA Server in another language or rewrite it with JAVA,
>>>but correctly. The main reason for the other language consideration
>>>is the text and binary file processing. I'm was thinking Ruby might
>>>handle this aspect better than JAVA.
>>>
>>>thanks,
>>>andy
>>>
>>>
>>>
>>
>>
>
>
>
>



Andy Stone

10/26/2004 1:15:00 AM

0

Thanks for the reply Dido,

My hope is that Ruby is not only a a more elegant and easier language
to use, but will also handle this task more efficiently with fewer
issues than I currently have. Of course that is very touch metric
because the problems with the current Java implementation could have
nothing to do with Java, just bad code.

As I just replied to Francis, I will just jump into this and see what happens.

I guess I'm just bored with Java, have an issue that needs fixing and
am looking for a change.

thanks again,
andy


On Tue, 26 Oct 2004 09:45:06 +0900, Dido Sevilla <dido.sevilla@gmail.com> wrote:
> On Tue, 26 Oct 2004 01:08:41 +0900, Andy Stone <xsltguru@gmail.com> wrote:
> > Now you know why I am here. I am looking into Ruby as an alternative
> > to this JAVA Server. The core functionality needed would be processing
> > zip files, parsing text/binary files and executing sql statements.
> >
>
> This is all par for the course. Ruby is very much capable of all these
> things, but there are certain DBD's that aren't as well maintained as
> others, so knowing what your database backend is would be useful
> (specifically it would appear that the Sybase driver is woefully out
> of date).
>
> Ruby is in my opinion a much, much more elegantly pleasant language to
> work with than Java will ever be.
>
> > At this stage, how does Ruby compare to Java in terms of server
> > programming?
>
> I assume you mean web server programming. More generic application
> server programming is also doable and most of the common protocols
> already have direct support by the Ruby core (e.g. http, smtp,
> pop/imap, and so forth).
>
> > I have liked everything I've read about Ruby to date,
> > but have seen very little in reference to server programming, but then
> > again, I'm just beginning.
> >
>
> Try going to http://www.rubyon...
>
> It's an MVC framework like the Apache Project's Jakarta Struts, but it
> is in my experience a lot simpler and easier to program in. As they
> put it, you'll be able to build a full-featured web application using
> less lines of code than many other frameworks use for their XML
> configuration files...
>
>


Joel VanderWerf

10/26/2004 1:18:00 AM

0

Andy Stone wrote:
> Hello Francis,
>
> Thanks for the reply.
>
> This isn't a web server, just a JAVA client/server application that
> starts a few threads that have their own individual responsibilities.
> The server app is merely a container for these threads to allow the
> basic functions like startup,shutdown,and status to be handled
> cleanly.

Note that ruby threads are in-process threads, so if you're using
threads to take advantage of multiple cpus, you may want to have several
ruby processes on the server side, and distribute tasks among them.

Also, take a loook at DRb--distributed ruby. It's a remote method call
protocol for ruby objects and a very elegant way of developing servers,
though it doesn't come without some performance costs. A good starting
place is the pickaxe book (get it online at
http://www.rubycentral.com/book/... or buy the new edition).

DRb even has a Linda/tuplespace implementation, called Rinda. All
included with ruby in the standard lib.


Andy Stone

10/26/2004 1:19:00 AM

0

David,

Thanks for your reply. It's very good to hear that!

I'll only bug you guys if I've exhausted everything else. :)

thanks again! It's real nice to see this kind of response.

-andy


On Tue, 26 Oct 2004 10:13:19 +0900, David Ross <dross@code-exec.net> wrote:
> My project usage with Ruby comes pretty close to what you are using it
> for with your project.
>
> Recently I created a SOAP client/server which were seperate handling
> frontend and backend for customers to access company information. The
> program handled authentication, database access, and scripts that ran
> every night updating any information changed from external data formats.
> Ruby runs fine for server/client applications. I hgive it a big A+. I've
> had a few problems sure, but the Japanese Ruby community are really
> nice. There are some nice non-ignorant people out there as well, usually
> you can find them on IRC(note: there are still ignorant ones out there).
> Thanks to NaHi I was able to complete my applications. Ruby is very good
> for what ou have in mind.
>
> If you need help, drop by on
> irc://irc.efnet.net/ruby-lang
> or
> irc://irc.freenode.net/rubymine
>
> I would be glad to answer any questions you have.
>
>
> David Ross
> --
> Hazzle free packages for Ruby?
> RPA is available from http://www.rubyar...
>
>
>
>
> Andy Stone wrote:
>
> >Hello Francis,
> >
> >Thanks for the reply.
> >
> >This isn't a web server, just a JAVA client/server application that
> >starts a few threads that have their own individual responsibilities.
> >The server app is merely a container for these threads to allow the
> >basic functions like startup,shutdown,and status to be handled
> >cleanly.
> >
> >Being that I don't have any specific questions, I'll just start
> >writing a version in Ruby and will post questions (as they arise) to
> >answers I can't find elsewhere.
> >
> >
> >Thanks again,
> >andy
> >
> >On Tue, 26 Oct 2004 08:39:50 +0900, Francis Hwang <sera@fhwang.net> wrote:
> >
> >
> >>Hi Andy,
> >>
> >>What's the server part of this? I understand processing zip files,
> >>parsing text/binary, executing SQL, all of that, but I think you've
> >>been a little vague as to how all these actions fit into the overall
> >>function of the server in your company. Is this a web server, then I
> >>take it? Or some other sort of server?
> >>
> >>At any rate, everything you've said so far can be handled fine in Ruby,
> >>and you'll probably find it a lot more fun to write than in Java. If
> >>you have other specific concerns you should just bring them up and we
> >>can address them.
> >>
> >>Francis
> >>
> >>
> >>
> >>
> >>On Oct 25, 2004, at 12:08 PM, Andy Stone wrote:
> >>
> >>
> >>
> >>>Hello all,
> >>>
> >>>The company I work for currently utilizes JAVA/JSP, ORACLE 9i,
> >>>Apache,Tomcat setup running on Solaris. We have plans to migrate to
> >>>PostgreSQL and Linux. Currently I have an issue with a server written
> >>>in JAVA that hangs about once a week (don't know exactly why yet -
> >>>hence the vague term) and we recently had it create a defunct port
> >>>while trying to shut down. I did not write this server, but am the
> >>>only one left to maintain this code.
> >>>
> >>>Now you know why I am here. I am looking into Ruby as an alternative
> >>>to this JAVA Server. The core functionality needed would be processing
> >>>zip files, parsing text/binary files and executing sql statements.
> >>>
> >>>At this stage, how does Ruby compare to Java in terms of server
> >>>programming? I have liked everything I've read about Ruby to date,
> >>>but have seen very little in reference to server programming, but then
> >>>again, I'm just beginning.
> >>>
> >>>Please excuse the vagueness, I'm very undecided what to do right now,
> >>>rewrite the JAVA Server in another language or rewrite it with JAVA,
> >>>but correctly. The main reason for the other language consideration
> >>>is the text and binary file processing. I'm was thinking Ruby might
> >>>handle this aspect better than JAVA.
> >>>
> >>>thanks,
> >>>andy
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
>
>


Andy Stone

10/26/2004 1:42:00 AM

0

Joel,

Thanks for the thread and DRb info. Performance is a main concern
with this application, so it doesn't sound like the right course for
me to take, but I will look into it before ruling it out.

-andy


On Tue, 26 Oct 2004 10:17:40 +0900, Joel VanderWerf
<vjoel@path.berkeley.edu> wrote:
> Andy Stone wrote:
> > Hello Francis,
> >
> > Thanks for the reply.
> >
> > This isn't a web server, just a JAVA client/server application that
> > starts a few threads that have their own individual responsibilities.
> > The server app is merely a container for these threads to allow the
> > basic functions like startup,shutdown,and status to be handled
> > cleanly.
>
> Note that ruby threads are in-process threads, so if you're using
> threads to take advantage of multiple cpus, you may want to have several
> ruby processes on the server side, and distribute tasks among them.
>
> Also, take a loook at DRb--distributed ruby. It's a remote method call
> protocol for ruby objects and a very elegant way of developing servers,
> though it doesn't come without some performance costs. A good starting
> place is the pickaxe book (get it online at
> http://www.rubycentral.com/book/... or buy the new edition).
>
> DRb even has a Linda/tuplespace implementation, called Rinda. All
> included with ruby in the standard lib.
>
>


James Gray

10/26/2004 1:46:00 AM

0

On Oct 25, 2004, at 8:42 PM, Andy Stone wrote:

> Joel,
>
> Thanks for the thread and DRb info. Performance is a main concern
> with this application, so it doesn't sound like the right course for
> me to take, but I will look into it before ruling it out.

Ugh. I hate to throw a bad light on Ruby, but it's probably true that
Ruby is generally a little slower than Java in most things. Just want
you to be aware of that going into this.

James Edward Gray II



Andy Stone

10/26/2004 2:04:00 AM

0

Would you say it's slower in processing text files? A single file can
run a few megabytes. That's where I was hoping to gain some speed from
Ruby. I was thinking that Ruby would be a little slower in other
aspects, but thought that I would make up considerable ground with the
parsing process.


On Tue, 26 Oct 2004 10:45:44 +0900, James Edward Gray II
<james@grayproductions.net> wrote:
> On Oct 25, 2004, at 8:42 PM, Andy Stone wrote:
>
> > Joel,
> >
> > Thanks for the thread and DRb info. Performance is a main concern
> > with this application, so it doesn't sound like the right course for
> > me to take, but I will look into it before ruling it out.
>
> Ugh. I hate to throw a bad light on Ruby, but it's probably true that
> Ruby is generally a little slower than Java in most things. Just want
> you to be aware of that going into this.
>
> James Edward Gray II
>
>