On second thought...

Posted by Ceaser Larry on October 11, 2006

I haven’t worked on SqlClientAdapter lately for one reason or another.

First, I didn’t need it anymore since the project was re-written in 100% C#.

I’m also having second thoughts about using the .NET framework for the foundation. Its very memory hungry to load all the necessary libraries. After loading System.Data.*, RubyCLR, and the Ruby libraries, your memory usage is around 50MB for a simple application.

I would like see a SQL Server client for Ruby that has a small memory footprint, cross platform support, and is wickedly fast.

So lately I’ve been thinking about exploring a FreeTDS bindings for Ruby. I don’t know if it is cross platform, but it is as bare as you can get.

Comment Archive

  1. Sam Smoot said 10 days later:

    “First, I didn’t need it anymore since the project was re-written in 100% C#.”


    I wonder what sort of memory usage the standard sqlserver adapter sees in ADO mode? Are we talking about a 10MB difference between the two or a 30MB difference?

  2. Jake Mallory said 14 days later:

    I setup FreeTDS on a ubuntu laptop. It wasn’t fun or easy. What you save in memory you will lose in performance.

  3. Ceaser said 15 days later:

    It’s a 10MB to 20MB different at start-up, but over time it takes more memory. I believe it is because of the two GC systems and the toll charge for crossing the bridge.

    The site I was using it for needed to handle 2800 request a second. I realized that IIS with Rails isn’t up to the task without dedicated hardware, which was out of the question. So enter C# and a custom server.

    Jake, you were probably using FreeTDS through a ODBC manager and you’re right it is slow. I’m talking about removing all layers of abstraction and trying to keep the speed as close to bare metal as possible. Sam Smoot and company at http://substantiality.net has created a fully working gem call MsSqlClient that uses a similar technique but with a custom extension. I’m going to give it a try as soon as I get some free cycles.

    I’ve started working on a quick prototype of the FreeTDS version to see if it’s worth the time. Some of the advantages I’m looking for are fast data streaming, toll free or no bridges, and Windows and Unix support. I’m also looking into how the other languages have already implemented FreeTDS bindings.