I have been given a spec to create a new MVC4 website, it will not be too large a project at first but I suspect it will grow as the business gets new ideas for it.

Using .NET 4.5 ASP.NET MVC4 and EF I have to choose between code-first with migrations or Sql Server Data Tools (SSDT) for handling my database.

With the SSDT I can control my database in a project as part of my solution and handle the changes all the way from dev through to production and beyond using dacpac files. My experience of code-first from MVC3 was not to use it beyond development due to the limited database options. It would always end up with dropping the Db on model change or handle the Db changes manually. However I am led to believe with MVC4 Migrations that is no longer the case and I can now push updates to the Db.

So my question is which one is the most efficient to use based on saving time/effort in development but also scalable and able to handle production changes. I liked code-first and the ability to generate my Database from Models, does the introduction of migrations now make it viable in production?

1 Answer 1


My personal opinion is that codefirst great tool and great for development. The steps of databasefirst development should be scripting external tools or by hand, if you already have a production database.

The codefirst to be included in the development of database version control system and provides a distributed database development.

Starting point, it's a good series:


  • Have you tried the ssdt, able to compare the 2?
    – Lotok
    Commented Jun 5, 2013 at 16:05
  • 1
    Yes, I use it regularly in previous version of SSDT. I looked the newest at these links: msdn.microsoft.com/en-us/jj650015, sqlblog.com/blogs/jamie_thomson/archive/2013/03/21/…, develop.com/sqlservertwelvedatatools, blogs.msdn.com/b/ssdt/archive/2012/12/13/…. I have not tried the database unit test, but I think the key is to be used next to each other the codefirst and the SSDT. Commented Jun 6, 2013 at 8:30
  • I will read those blogs soon. I didn't think code-first and SSDT would work side by side. Unless you mean using code-first during dev and switching to SSDT for production? I will read your links!
    – Lotok
    Commented Jun 6, 2013 at 9:12
  • I'm doing database development code first method. The codefirst migration solves the steps to install the database (creating a new table, a new column to an existing table, etc). For example, if you want to create database unit tests, you can also use the SSDT. If we want to compare two structures, also can use the SSDT. At least, so I use it. Development and deployment of codefirst very good. Commented Jun 6, 2013 at 11:01
  • From what I seem SSDT is perfect for Db First and from everything you said and posted it seems the migrations options added to MVC4 do in fact make code-first usable beyond initial dev!
    – Lotok
    Commented Jun 6, 2013 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.