Sign in to follow this  

[.net] Databases under Linux/Mono

This topic is 3286 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3286 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this