.NET Framework - What is the difference betwnn sdf and mdf

Asked By Tony Johansson on 25-Mar-11 02:37 PM
If I right click on the project and select add new iteem.
In this Add New Item dialog there are several templates.
Two of these are called "Local database" which create a sdf file database
and if I select "Service-based Database"
I create a mdf file.

So the difference must be more then just the name sdf or mdf ?


Arne_Vajhøj replied to Tony Johansson on 25-Mar-11 08:03 PM
MDF = SQLServer


And contrary to the almost identical names, then it is
two completely different products.

A database server and an embedded database.

Tony Johansson replied to Arne_Vajhøj on 26-Mar-11 02:35 PM
I assume that the amount of feature and functionallity is limited when I use
the sdf database compared to the mdf database file.

Arne_Vajhøj replied to Tony Johansson on 26-Mar-11 02:48 PM
Actually I think that the SQL dialect on SQLServerCE is fine.

The difference is that SQLServer is a database server intended to serve
1-10000 users (client apps, web requests or whatever) while SQLServerCE
is an embedded database that is superb for serving 1 users but can serve
a small number of users fine.

I would use SQLServer for web app and for a server app, but SQLServerCE
for a desktop app (storing data locally).