-1

I’m developing an ASP.NET MVC application that is using a LocalDb database. This app also needs to have a corresponding Windows service that runs all the time. After much research, it looks like LocalDb is not a wise choice for deployment because of needing to have two users and concurrent access and 24/7 up time.

The app I’m building won’t be deployed to one server, it will be bundled up in an installer and distributed to multiple users. This would me so much simpler if I could justify distributing SQL Server Express 2012, but blowing up the installer by 120MB and using 300MB on disk is something I’m trying very hard to avoid.

The load on the database will very light -- the web app is using the SimpleMembership provider and besides the membership tables, there are only a handful of other tables that will never have any significant amount of data in them. In previous versions of this app, I used an XML membership provider that stored user and role data on disk and the other data in my own XML configuration file. Some customers had security concerns about that so I would like moving membership and config data to a database so customers could point the app to their own SQL Server and do all the security they want with it.

I also would like the Windows service to use SQL Server Broker and SqlDependency to detect changes that the web app makes in the database.

SQL Express is out because it’s so big and this app needs to go on some embedded systems that I could not likely get permission to put it on.

LocalDb is probably out for the reasons I stated above.

SQL Server Compact – I’ve never worked with it. My understanding is that it runs in-process – can that process be my Windows service so that it’s always running? Can I access it concurrently with the web app? Will the SimpleMembership provider work with it? Any idea if SqlDependency works with it or is it back to polling?

Rick242
  • 15
  • 3
  • Hate to do it, bu vote to close - this IS a shopping question. – TomTom Jan 23 '13 at 20:13
  • "The app I’m building won’t be deployed to one server, it will be bundled up in an installer and distributed to multiple users." So each user has a full stack on their own device? I.e. each user is using a different database of their own? "concurrent access and 24/7 up time" How do multiple users access it concurrently if they each have a separate service/database? I think your deployment/architecture is a little unclear. – AaronLS Jan 23 '13 at 20:50
  • That's right. Nothing unclear about it. My company sells hardware -- multiple devices into each customer. Each customer (company) will have their own copy of this on their network to manage their own devices. – Rick242 Apr 23 '13 at 22:13

2 Answers2

1

If you need a small sql database, how about give this a try. SQLlite is just a few hundred kilobyte and easy to use.

There is a c# port of it http://code.google.com/p/csharp-sqlite/.

Also lots of infos about using sql lite in your c# project.

See this links for more infos: http://www.codeproject.com/Articles/22165/Using-SQLite-in-your-C-Application

Is there a .NET/C# wrapper for SQLite?

I tested just a bit with it, it is very small, fast, simple and SQL syntax is often the same. What you can not do the same way is dealing with T-SQL but as you said you just store some simple data you should give it a try.

Community
  • 1
  • 1
YvesR
  • 5,922
  • 6
  • 43
  • 70
0

Both a Windows service and asp.net can access the database concurrently on the same machine, yes. SimpleMemberShip Works with it, no SqlDependency, but you can potentially do lightweight polling fir example by using rowversion columns and the @@dbts function, possibly in combination with some system table queries

ErikEJ
  • 40,951
  • 5
  • 75
  • 115