2

I am wondering if there is a way of treating a network stream as a file. I might be wrong but I see a file as an array list of bytes. when you open a file in windows and you write to it you are inserting bytes to that file (array list) I believe.

I am creating a program where I deploy it with a SQLite database. I am also creating the client version where it connects to that database file on the network.

In order for the users to connect to the database file they need to provide the credentials in order to access data in that database. I will like to make them able to connect without having to input that information.

Things that I been thinking:

  • deploy my application with sql server instead. (It is not easy to deploy an application with SQL server where it silently will install the server, enable tcp connections, and all the necessary config to make this happen. Also it takes about 7 minutes to install where sqlite takes less than 20 seconds!

  • I am using WCF to talk to the server so I could make a function for each of all the queries that I plan on using. So if I want to select * from products I can then call the method SelectAllFromProducts() on the WCF service... (Here I am kind of reinventing the wheel. ) Also the nice thing about this would be that my queries will be much faster I belive. Sqlite is serverless so if you plan on finding all items in product where product name is like 'foo' then if you think about it a computer will have to access all records in the database through the network. It will be faster if the local computer does that and sends the few results to the client.

Tono Nam
  • 34,064
  • 78
  • 298
  • 470

1 Answers1

2

I don't think its a good idea to use Sqlite over network. I am currently using Sqlite but as a local file system database.

In a client server architecture you are better off with some RDBMS rather than SQLite

Client/Server Applications

If you have many client programs accessing a common database over a network, you should consider using a client/server database engine instead of SQLite. SQLite will work over a network filesystem, but because of the latency associated with most network filesystems, performance will not be great. Also, the file locking logic of many network filesystems implementation contains bugs (on both Unix and Windows). If file locking does not work like it should, it might be possible for two or more client programs to modify the same part of the same database at the same time, resulting in database corruption. Because this problem results from bugs in the underlying filesystem implementation, there is nothing SQLite can do to prevent it.

Please check this link for Appropriate use for Sqlite and jump to section

Situations Where Another RDBMS May Work Better

Habib
  • 219,104
  • 29
  • 407
  • 436
  • SQLite claims to support multiple connections. I was experiencing lot's of problem when querying the database from multiple threads all of them using the same connection. When I assign each thread it's own connection things whent ok. The reason why I want to use sqlite is because it is eassy to deploy. I tried deploying my application with sql server and that is not eassy and it takes to much time to install. – Tono Nam Apr 14 '12 at 14:52
  • Time to install ?? seriously, its a one time thing, Sqlite will give you a lot of trouble in client server architecture. – Habib Apr 14 '12 at 14:57
  • You are right every thing is meant for what it is. First I will have to do a silent install of sql server express and then I will have to go through this trouble: http://stackoverflow.com/questions/9138172/enable-tcp-ip-remote-connections-to-sql-server-express-already-installed-databas . I don't think that is easy to do but it is posible... That's why I wanted to use sqlite – Tono Nam Apr 14 '12 at 16:47