I am less than sure stackoverflow is a spot for this type of general question, but let us try it out.

Being uncovered to the necessity of storing application data somewhere, I have always used MySQL or sqlite, simply because it certainly is done like this. Because it appears like the world is applying these databases (first and foremost software items, frameworks, etc), it is quite hard for any beginning developer much like me to begin considering whether this is an excellent solution or otherwise.

Ok, say we've got some object-oriented logic within our application, and objects are based on one another in some way. We have to map this logic towards the storage logic, so relations between database objects are needed too. This leads us to presenting relational database, and I am comfortable with that - to place it simple, our database table rows sometimes have to have references with other tables' rows. Why use SQL language for interaction with your a database?

SQL totally a text. I'm able to appreciate this is awesome for really being aware of what it will, but is not it silly to make use of text table and column names for part of application that nobody seen after deploynment? Should you needed to write an information storage on your own, you'd haven't used this type of solution. Personally, I'd used some 'compiled db query' bytecode, that might be put together once in the client application and passed towards the database. Also it surely would title tables and colons by id amounts, not ascii-strings. Within the situation of alterations in table structure individuals byte queries might be recompiled based on new db schema, saved in XML or something like that like this.

Do you know the problems of my idea? Can there be any reason behind me to not write it myself and also to use SQL database rather?

EDIT To create my question more obvious. The majority of solutions declare that SQL, as being a text query, helps designers better comprehend the query itself and debug it easier. Personally, I've not seen people writing SQL queries manually for some time. Everybody I understand, including me, is applying ORM. This case, by which we increase your new degree of abstraction to cover SQL, results in thinking as we need SQL or otherwise. I'd be very grateful should you could give some good examples by which SQL can be used without ORM intentionally, and why.

EDIT2 SQL is definitely an interface from a human along with a database. Now you ask , so why do we must apply it application/database interaction? I still request for good examples of people writing/debugging SQL.

Everybody I understand, including me, is applying ORM

Strange. Everybody I understand, including me, still creates the majority of the SQL manually. You typically finish track of tight, more high end queries than you need to do having a produced solution. And, based on your industry and application, this speed does matter. A lot. yeah, I'll sometimes use LINQ for any quick-n-dirty where I do not mind exactly what the resulting SQL appears like, but so far nothing automated beats hands-updated SQL when ever performance against a sizable database inside a high-load atmosphere really matters.

  • This is an ubiquitous standard. Virtually every programming language available has a method to access SQL databases. Try by using a proprietary binary protocol.
  • Everybody knows it. You'll find experts easily, new designers will often comprehend it to some extent without needing training
  • SQL is extremely carefully associated with the relational model, that has been completely investigated regarding optimisation and scalability. However it still frequently requires manual fine-tuning (index creation, query structure, etc.), that is relatively simple because of the textual interface.

Why use SQL language for interaction with your a database?

I believe it's for the similar reason that you employ an individual-readable (source code) language for interaction using the compiler.

Personally, I'd used some 'compiled db query' bytecode, that might be put together once in the client application and passed towards the database.

It is really an existing (optional) feature of databases, known as "saved methods".


Edit:

I'd be very grateful should you could give some good examples by which SQL can be used without ORM intentionally, and why

After I implemented my very own ORM, I implemented the ORM framework using ADO.Internet: and taking advantage of ADO.Internet includes using SQL claims in the implementation.