DEV Community

Miguel Teheran
Miguel Teheran

Posted on

Discussion: Is SQL Server still the best database for .NET Developers?

When I started to work as a software developer we used to use AccessDB and SQL server for desktop applications (This was 14 years ago).

In the last year, I have been using cloud providers and remote databases with SQL server but also with other engine like postgreSQL and mariaDB.

postgreSQL is a great database because it is full free, opensource and supported by all the cloud providers.

If you have to start a new project right now with .NET and ASP.NET, which database you prefer?

Top comments (7)

Collapse
 
jockerman_88 profile image
JockerMan_88

If I start again to learn .Net I think that the SQL Servers is good to know, it's easy to integrate with all tools in Visual Studio, the documentation is one of the best and most confortable to read and its very easy to get started with EF.

But on other hand, I currently like PostgreSQL always thinking if is the best option for the app, because all databases are different and different projects may need a different database.

Regards! :)

Collapse
 
drewknab profile image
Drew Knab

If I had my druthers, it would be SQL Server. I think it's ultimately the best middle ground between built-in features and performant reads/writes. PostgreSQL I'm quickly souring on. It's fine, but it has a number of quirks that put me off now that I'm using it in production. MariaDB I quite liked when I was using it professionally.

Collapse
 
mteheran profile image
Miguel Teheran

Agreed, finally in the last years we have more options and .NET works petty well with other database sometime that was difficult in the past.

Collapse
 
aarone4 profile image
Aaron Reese

MSSQL for me. Perhaps Postgress for hobby projects or proof of concept. For any RDBMS you are only going to get out what you put in. Proper modelling, datatyping, primary, foreign and unique key constraints, indexing etc. A properly configured mySQL will still outperform a badly scoped MSSQL or Oracle database.
Can't talk authoritatively about document DBs, but in general I don't trust them for long term transactional storage. Great for fast data capture for later translation into RDBMS but just too much scope for broken schemas and data integrity is moved to the middleware where the rules are difficult to enforce.

Collapse
 
jakecarpenter profile image
Jake Carpenter • Edited

I'm fully versed in SQL Server, but I'd probably go with PostgreSQL unless I needed some specific features of a document DB.

PostgreSQL does a magnificent job of supporting both relational data and JSON to just throw what I want in. SQL Server has much better support for JSON now, but I have not had the opportunity to play with those features as I'm stuck on SQL Server 2014 instances at my work. I suspect the common mapping packages like Dapper are also not quite up to it.

While I love Dapper over the other ORM alternatives for dotnet (#dropthedot), Marten can be used with PostgreSQL for an even better developer experience supporting both relational and document-like structures.

There's not anything wrong with choosing SQL Server, but I'd choose it in more enterprise-focused situations where it's scope is greater than a single app.

Collapse
 
mteheran profile image
Miguel Teheran

I completely agree with you. I like how postgreSQL supports Json, Enumerations, Types and may advanced things and also I don't have to be worry about licensing or run it in different operative system.

Collapse
 
codehaks profile image
Hakim

I would definitly use PostgreSQL for my next project, I'm currently migirating some of my older projects to postgresql, it's ligher than mssql and more compatible with docker and cloud solutions.