title: Multiuser Embedded Database
body: <p>I have been tasked with finding a good fit for a database to use with an upcoming project. I am having a hard time finding a good match. Our application is a .Net Framework 4.0 C# application.</p>
  
  <p>First I looked at SQLite but I am running into issue because SQLite locks it's database file during writes.</p>
  
  <p>I have 2 separate applications running at the same time using the same database and I cannot be certain when one is writing. I have attempted to just wait for the locks to release but this has caused some data loss. So I thought that i would invent a queue system, but both applications would need to use the same queue...So I thought that I would just make a separate Window's service. All of this started to sound like a traditional RDBMS to me.</p>
  
  <p>I decided to backtrack and ask myself "Am I using the right database?". </p>
  
  <p>Does anybody know of a database that might meet the requirements that I have been given?</p>
  
  <p>Here are my requirements:
  1. Easy to install. This includes not having a separate "installer" that users have to run separate from our application's installation. This is what first led me to believe that I need an embedded database but I think there maybe some clever ways of including a Database installation inside of our installer.</p>
  
  <ol>
  <li><p>Hard to break. The biggest want here is that it should be able to work over named pipes instead of TCP/IP for security concerns (or anything that reduces the ability for people's system configurations to break our application). Our applications will always be running on the same machine. They need to share the same database, therefore using TCP/IP could potentially cause issues if firewalls/security/"smart users" get involved.</p></li>
  <li><p>Long running operations on the database should not prevent other users from reading/writing to the database. I thought about writing some code to handle this requirement and still use Sqlite but decided to do more homework.</p></li>
  <li><p>Licensing: We want something that we can redistribute royalty free. We dont want our end user to need to purchase their own separate license for a database that we depend on.</p></li>
  <li><p>Size limitations: we plan on storing quite a bit of data in these database and arbitrary limits are not acceptable. We are willing to accept limits imposed by the operating system for file size. SQLite's size limit (which is the size limit of any windows machine's file) was greater than 2 terabytes. </p></li>
  <li><p>Nice to have: Able to use Entity Framework.</p></li>
  <li><p>Nice to have: Relational database. We may allow 3rd party applications to read our database and would not mind if it was relational as opposed to a document or object database. However, we would be willing to budge on this one for something that meets all our requirements.</p></li>
  </ol>
  
  <p>Databases I've looked at so far:
  RavenDB
  SQLite
  CubeSQLite
  SQL CE</p>
  
  <p>Oracle and Microsoft SQL Server are licensed and there for difficult to redistribute.</p>
  
  <p>I understand that these requirements are VERY restrictive. I am not even certain that there is an out of the box solution available. I appreciate any help anybody can provide. </p>