Question

I'm getting a little confused here between LocalDB and SQL Server Express. I have read from websites that LocalDB is an improved version of SQL Server Express (source). I would assume this implies that LocalDB is replacing SQL Server Express.

The confusing thing, however, is that it was also mentioned on several websites that LocalDB is only for development purposes, and it's not meant for production use.

In this case, I will do my development and testing of my web application with LocalDB on my computer. Since LocalDB is a replacement for SQL Server Express and also not for production use, then what database (other than the full SQL Server if I don't have the money) should I use when I'm ready to publish my application?

Was it helpful?

Solution

I would assume this implies that LocalDB is replacing SQL Server Express.

Your assumption is incorrect. Keep reading the article you linked...

LocalDB is not a replacement for SQL Server Express -- it is an addition to SQL Server Express lineup. While LocalDB is meant for developers, the regular SQL Server Express will continue to exist as a free SQL Server edition, fully compatible with and easily upgradeable to higher SQL Server editions.

You would still use SQL Server Express or a higher version of SQL Server for production use. Or better yet, abstract your application from the database in such a way that you could use any server (MySQL, Oracle, etc.)

OTHER TIPS

LocalDB is simply a special version of SqlExpress adapted for development usage.

If you're trying to get your tables, views and stored procedures right, you don't need the SqlExpress instance to be running every time you start your machine. You don't need a DB server to accept incoming connections on port 1433 and verify username and password. Etc. etc.

In the past SqlExpress is installed separately. It is not integrated to Visual Studio and ASP.NET. It's like IIS and IIS Express, no one uses IIS Express to host a shopping website, but it's handy to get the codes going in localhost. LocalDB is the same concept, you use a lightweight version of SqlServer that is not optimized for performance, but starts when you need it to get your codes going.

I've used SqlExpress in production with no problem and many others did so too. As long as you don't hit the limits it's very good and just a small percentage of apps really need more. I'd suggest you develop directly against sql express (localdb didn't even exist until recently, I still develop against sql express) and use it in production until your app becomes very popular or space constraints bite you that you need an upgrade.

Sure you can use other rdbms or even nosql dbs (like ravendb or mongodb), it depends on where you want to host the app or what your experience with a rdbms is etc

It depends on hosting and the amount of administration you want to do. As you mentioned, full SQL Server is an option, but licensing costs can be high.

PostgreSQL is another popular choice, works really well, and is free.

My favorite option though is Azure SQL. The pricing is minimal, especially for small databases, it eliminates the need for a lot of administration, and you still get great tooling support with Visual Studio.

Neither LocalDB nor SQL Server Express should not be used in production environments, because:

  • SQL Server Express is limited in some ways, eg CPU, memory, database size etc. If you're writing a query,you want to make sure it will run in production on 10 million rows that you can't support locally

  • SQL Server Express has a limitation regarding virtualisation, you can't live migrate it etc.

  • LocalDB places you in "god sandbox".

Full comparison between SQL Server Express and standard is here

I'd recommend using SQL Server Standard or PostgreSQL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top