Succor From SQL
February 24, 2006 2:57 PM   Subscribe

I have a Windows-served website programmed in C# and connected to a SQL database. I'd like to move the whole thing to the Mac.

It's a MS SQL Server database. The web front-end is ASP.NET, written in C#. This operation is running on Windows Server 2003. (The site provides a reasonably simple function: user logs in and then can search through a list of 20,000 or so companies in a certain field by various different terms - location, membership to a number of organizations, size of the firm, what have you.) I would love to port this to the Mac, and have it hosted on a Mac mini (when they stick an Intel proc in the thing).

I have no idea how to approach this, but I am a pretty fast learner. Can you recommend the route of least resistance for doing something as major as this? Which languages might work best; which might be easiest to switch to?
posted by thejoshu to Computers & Internet (8 answers total)
 
Best answer: Mono.
posted by matildaben at 3:01 PM on February 24, 2006


Mono would be easiest to port it over, but if it's simple, this seems like it could be written in any number of languages fairly easily. MySQL/PHP is a piece of cake to get running on unix.
posted by jragon at 3:10 PM on February 24, 2006


For what it is worth got an 3-4 year old C# & ASP.Net app running on mono in an hour or two with basically no code changes.

The database might be more difficult though. Do you have any triggers or stored procedures? I'm sure you can find a relatively easy way to dump the data from SQL and import it into MySQL or Postgres, but yo may have to port any DB side code.

I'm curious, why the desire to run this on a Mac Mini? Linux/BSD web hosting is a very competitive comodity market. I doubt the same can be said of Mac hosting.
posted by Good Brain at 3:26 PM on February 24, 2006


Ruby on Rails. See the movie!
posted by mto at 4:08 PM on February 24, 2006


Is there a how-to guide for this kind of migration to Mono? I've got a C# app on my Windows laptop I'd love to run over on my Mac. I've installed a bunch of Mono utilities via Fink, including mono-xsp, but have no idea where to go from there.
posted by mkultra at 4:24 PM on February 24, 2006


This is, unfortunately, the biggest reason not to use .NET. It's deliberately and intentionally nonportable. Its primary goal is to be a tool to lock you into Windows, and only secondarily provide you with a good programming environment.

Java is a little better, although it's been called "write once, test everywhere" for a reason.

Python and Perl (with the SDL graphic/UI libraries if you're doing console applications) are some of the easiest tools to run multiplatform. Either will talk comfortably with databases of all sorts. I'm not aware of any super-polished dev environments for them, but don't take that as a definite statement that they don't exist; my own needs are fairly simple, and I'm perfectly happy with just good old vim.

Of the two, Python is easier to learn. It's designed as a teaching language, so it has a nice clean syntax. But it's genuinely useful, and it's reasonably fast. Either language should very similar to C#, performance-wise. (regular C, being a true compiler, is usually 5 to 10 times faster, but it's very rare, these days, for application code speed to be the bottleneck, particularly in web-based server apps.)

You'd probably have to reimplement your app completely, using Apache, mod_perl or mod_python, and mysql. However, that reimplementation should run happily on Windows too (or Linux), so if you ever want to move platform again, it should be pretty straightforward. And it doesn't sound like your app is that complex, so it'd be a great learning exercise as well.

Mono would be easier, but if .NET ever really takes off, you can absolutely count on Microsoft doing the embrace/extend/extinguish routine; they'll somehow make sure you can't easily interoperate. The true freeware applications won't do that.
posted by Malor at 5:01 AM on February 25, 2006


Best answer: Just a note:

You would be a lot better off with Postgres then MySQL. Postgres can do stored procedures, like SQL Server and is just generaly more capable. It's also more free then MySQL.
posted by delmoi at 8:29 AM on February 25, 2006


Response by poster: Thanks everybody. Just got around to doing this over the past week... porting to Mono/Pgsql has been surprisingly easy. Much love to the askme crowd!

Of course, I DID buy an Intel Mac mini for the job just to learn that the Mono framework doesn't quite work yet on x86 OS X. Ah well. I've been prepping this on a PPC mini and I guess I'll just do the switch when the time is right.
posted by thejoshu at 7:15 AM on April 5, 2006


« Older Cross platform video-chat software.   |   What's best way to stream my music collection to... Newer »
This thread is closed to new comments.