views:

563

answers:

5

Question: We've started a project for a customer, which includes what would normally be done with a database.

However, the customer wants no database installed, since it's only a little application. We however intend to reuse the code for a larger project, which will use a database.

The problem is all the server side code will be different if I'm using XML or SQlite or Access.

I'm tending towards SQlite, but I don't know. Would adding the database in an MS-Access file be a better solution? If I would put it into an access database, does the customer need MS-Access installed or only the MSFT MDAC ? If I use the Access DB, will that run under Linux with Mono, too, or is there no MDAC replacement ?

+1  A: 

I would use SQLite over Access - for SQLite you just need to ship the DLLs, for Access you need an installer (although I think it's built into recent versions of Windows). Also SQLite is a better DB.

Or you could of course abstract the data stoarage mechanism using the Repository pattern or similar? If you were to store the data in a file, then load it and expose it from your repository using Linq-To-Objects, then later you could just drop-in replace that with Linq-to-SQL without changing any of your client code.

Groky
I already have an installer for the project, and I think adding a dependency to the Access MDAC would not be much of a problem.
Quandary
Still, I would go for SQLite; been burned too many times with Access. ALthough if it's a small project like you say you may have nothing to lose. If you're going to use the code in a bigger project though I'd suggest the overhead of the repository layer will be worth it.
Groky
+4  A: 

I would consider using NHibernate, you can hook it up to SQLite, but can upgrade later to a full database later without needing to change much code. If you're not keen on this, I would use SQLite directly over XML files.

JonoW
+1 for SQLite. Also, you don't have to use an ORM for having a correct 3-tier implementation. Just make sure your DAL can be replaced easily (using an interface for example), and no DAL logic exists in your BLL (needless to say presentation).
synhershko
+1 for NHibernate. You don't *need* an ORM, but it makes it lightyears easier.
Mike C.
+2  A: 

You do not need to install Access to use the Jet engine. Jet is installed with all recent versions of Windows, as far as I recall. You can use Jet (Access) with Linux. Jet requires very little in the way of database management compared to the alternatives, including SQLite.

Remou
A: 

All recent versions of windows all the way up to windows 7 have shipped with a copy of JET (the ms-access data engine). So, you don't need mdac, nor to install ms-access at all.

You can even write a windows script on a clean windows box without any software installed and thus you can read data from a mdb (ms-access) file.

So, the issue here is not installing, since "JET" (the database engine that ms-access uses) is shipped with windows anyway.

I think the only exception or consideration here is are you planning to work on 64 bit editions of the os and using in-process 64 bit applications?

There is a 64 bit edition of ms-access for office 2010, and as far as I know, there also going to be a separate download for installing the JET (now called ACE) engine on 64 boxes.

I you planning to only work on 32 bit machines (or use 32 bit editions of your software on a 64 bit box), then you not need ms-access nor will you need to install anything to read and use mdb (ms-access files).

Since JET ships with all recent versions of windows, the you decisions will not be based on installing JET (you don't have to), your decisions will be other issues and if JET meets your requirements.

Albert D. Kallal
I develop on a 64 Bit Hasta-la-Vista machine.When I installed 64 Bit Office 2010, I had to install MDAC, it didn't work out of the box. Maybe that's because I uninstalled office 2007, maybe because it's because it's a 64 Bit machine, or because the preinstalled JET/ACE is outdated. So I think it should be included in the installer.
Quandary
The version of Jet shipped with Windows is 32-bit Jet, so you have to compile for i386 since the 32-bit libraries can't be used in a pure 64-bit executable. Installing A2010 or uninstalling A2007 (or installing/uninstalling any version of Access) has no effect whatsoever on Jet, as it's an OS component and can't be removed.
David-W-Fenton
+1  A: 

You might have issues using sqlite in medium trust environments (in shared hosting for example). If you're opened to other solutions, you might consider giving VistaDB a try. It is supported by all major orm (nhibernate, openaccess, entityspaces, subsonic and many more ..).

elpipo
I will not use a Windows-only solution.Bad enough if my colleagues do.
Quandary
I'm not sure but I think VistaDB can run on mono.
elpipo
Jet is a windows-only solution, so do you want to edit it out of your original question?
David-W-Fenton
@David W. Fenton can you clarify that statement, please? http://stackoverflow.com/questions/1667583/is-it-possible-to-access-a-ms-access-database-with-php-on-a-linux-web-server shows that you can use Jet with Linux.
Remou
You may be reading/writing an MDB file, but you're not using Jet, and I can't say I'd consider it a viable solution. Reverse engineering something as complex as Jet is not a minor undertaking, and that's why, for instance, the MDB Tools project never got beyond read-only access.
David-W-Fenton