[.net] Databases under Linux/Mono

Started by
3 comments, last by DaWanderer 15 years, 4 months ago
What would you recommend to use as a Database setup for Linux C# applications? Ideally, what I'm looking for should work on Mono x64. - MySQL has a .NET Connector, but after Version 5.0, you can only download "Windows Binaries" - no idea if that means Linux people have to compile the sources themselfes on Mono or whether Mono support is suspended / dropped altogether. I also haven't researched yet whether ADO.NET has a Mono port and whether it's legally okay to use it or - like ASP.NET - in the gray zone. If anyone has experience or even deployed MySQL under linux, I'd love to hear about it. - Then there's Perst.NET, a database implemented in 100% .NET. I have yet to try whether this one works in a mono x64 environment, but a short test run on Windows has scared me away (stopped my application using the debugger just once and my whole database was corrupted beyond repair). - If all else fails, I might be able to modify one of the free P/Invoke SQLite bindings to work on mono (judging by the Tao Framework which P/Invokes to a multitude of native libs under linux, this should be possible). I'd prefer having MySQL as an option for production use, but being sold to agile development, I'd also like to have an embedded database that can easily be used in automated unit tests on a continuous integration server without any deployment/cleanup trouble!
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Advertisement
There is also h2sharp project on Google Code: http://code.google.com/p/h2sharp/
It wraps H2 embedded Java database in .NET so, that Java bytecode gets compiled to .NET bytecode resulting in pure .NET code for embedded database. No JRE needed in runtime.
I would start by taking a look at the Mono Database and MySQL pages. They recommend using MySQL .NET Connector. AFAIK like ASP.NET, ADO.NET is not part of the ECMA specifications, but that can't be a problem if you only use it, since you also use it on Microsoft's .NET.
Thanks everyone!

@SeaEagle1: Using ADO.NET might not be a legal problem, but in the unlikely event they're forced to discontinue the mono port of it, I'd have to rewrite my application's database backend which one might still consider as being a problem :)

@bubu LV: I didn't even know about IKVM.Net. Converting Java Bytecode to .NET CIL opens quite a few interesting possibilities. I have to admin I'm still a bit reserved as to the robustness of such a converted library and its consistency with .NET design principles, but I'll check it out. For unit testing (that's were I'd like to rely on an embedded database), my scalability demands are rather low!
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
If you're looking for an embedded database, I'd highly recommend using Mono's SQLite ADO.NET provider (Mono.Data.Sqlite.dll). I have a project going right now with this that runs on both Windows and Linux with no problems. If you download the System.Data.SQLite binaries from PHX software, it includes an installer that will add a nice table/query designer to Visual Studio.

For a non-embedded database, I'd recommend PostgreSQL. The database is 100% free and works great on Windows and Linux. The stand-alone GUI for Windows is also exceptional for building tables and running queries.

As a bonus, both of the mentioned ADO.NET providers can plug into NHibernate should you need an ORM data layer.

This topic is closed to new replies.

Advertisement