How to create modern databases with C#?

Do I really need to know how to create databases?

  • I'm a student at a web development bootcamp (e.g. Dev Bootcamp, Hack Reactor). This week is all databases. I'm different from most students here in that I came in with a great deal of web development experience. I've built and deployed many web applications. In the Rails applications I've built, I have never had to write SQL and run a file to populate the database. This process is  taken care of with migrations and Active Record. Is the manual creation of database schemas a skill that is vital for web developers? Is my time this week better spent learning something else?

  • Answer:

    There is always one level of abstraction lower than the level you are currently using. What you're really asking is "what's the last abstraction that I care about?" If you understood how to create Tables and Indexes, you could be here writing the same questions about "Do I need to understand the types of indexes?". If you knew that you could be asking about stored procedures or functions. If you knew that you could be asking about locking mechanisms... the list goes on. Here's the general rule, you want to be familiar with one level of abstraction beyond what you normally use. Note that I did not say "expert at" just "familiar with". Active Record is not a perfect DB abstraction. There are certain things you can do with a DB that you simply cannot do with Active Record (or Entity Framework or Hibernate etc.) In Entity Framework, they actually just accept this and you can drop down to the DB level to execute queries if you really want to. In the case of your question, this learning is exactly one level beyond what you normally use and this is exactly the thing you want to become familiar with. I'm not saying you need to learn about DB replication or table / row locking procedures or stored procedures, just one level beyond what you use.

Gaëtan Voyer-Perrault at Quora Visit the source

Was this solution helpful to you?

Other answers

This is not critical but as a web developer you should know how to create a database and how to write raw SQL. Having an ORM performing queries is great, but you should know what it does under the hood. Else what will you do after Rails? How will you link what you learnt on Rails with another framework/ORM/language? So if you have people with database skill around you this week, you should spend time learning how to manage a database (creating a database is simple: "create database dbname;"), when/how to create indexes (even with options that ActiveRecord does not support natively), how to perform joins, etc.

Michel Pigassou

ActiveRecord is great for simple purposes but soon enough, as your application grows, you will need to go deeper in understanding what is going on on the database level. You have to know how indexes work, because Rails will not cover it for you (especially multi-column indexes), when to use triggers instead of callbacks and how not to end up with 17 joins in one query.

Paweł ŚwiÄ tkowski

Today, there are many tools that remove the difficulty of needing to come up with elegant design, thoughtful architecture and mature code.   Some of these tools take the form of GUI tools, Frameworks, caching strategies or simply just buying more hardware.  Pounding a screw in with a hammer will absolutely work for lots of things and no one need ever know with a little patch up work and paint.  I prefer elegant solutions myself.  That said, not too long ago I left a terrible data model intact, ignored horrible code and solved a serious scalability problem for at least another year just by adding NGINX to the infrastructure.  Unless they quadruple in size again, they may not need to do anything else.   Drastic change is expensive and implementing NGINX was cheap.  I did not like the idea of the solution but it was a viable choice in this case. There does come a point where modeling your data based on the web application or object model will not scale well.  Learning to use a database abstraction layer well, will give you another tool to consider when implementing solutions.   Especially if you are doing it from scratch.   Besides scalability there are business, security, enterprise, performance reasons why you might want a mature database abstraction layer. I suspect you could be gainfully employed without learning anything about a database or its abstraction layers.  I think it is career limiting to only know a few tools and methodologies.

Andrew Hansen

Web development is such a broad category, I can't even imagine making some sort of list of "vital" skills for it. Understanding the backbone of most web applications(i.e. databases) seems like it would be on that list though, if I were trying to write it.

Connor Harwood

As Michel says it is part of the skills that you should have and another thing that in some point you should go deeper and know what is the best option to use. If better to use a relational db or document oriented depending of the app that you will work on.

César Diaz

While it is important to have some knowledge of the underlying systems on which you depend, SQL and databases in general are inherently unfriendly to developers because they often cause you http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch. In particular, the worlds of MVC and OOP don't always translate nicely to database tables and SQL joins. This is one of the reasons I created http://concoursedb.com/–a schemaless and distributed version control database that maps directly to the way that developers think about problems. For example, Concourse forgoes a query language in favor of an expressive programatic API and http://concoursedb.com/blog/index-all-the-things/ so you don't have to worry about it or other mundane tasks that detract from actual app development. https://github.com/cinchapi/concourse is open source. I encourage you to give it a try as you start to build more database backed web applications.

Jeff Nelson

I agree with Pawel, Michel and Gaetan! It's always better to keep learning and I think it's important for a web developer to understand SQL, how to  build manual queries, and how to create and maintain a database. Check out this post that may help you in future. http://www.allerin.com/blog/ruby-on-rails-and-database/

Harshada Thakur

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.