![]() ![]() The glove doesn't always need to be a perfect fit. That doesn't mean it is better to have a custom solution. This is because they were designed to be very general, so in practice, you will always get additional features you don't need. Yes, a modern RDMBS might not always be a perfect fit for every project. The whole point of database products is to avoid writing the database layer for every new program. If you don't need many features, a simpler solution may be wiser. If you need a lot of features, at some point it will be easier to use an existing RDMBS then to write your own database from scratch. ![]() Check out static SQL and prepared statements. For example, if you serialize you data to YAML, you can read the file with any text editor or shell. A disadvantage is that it is more difficult to read it. An advantage to SQLite is that if you have a lot of this kind of information, it is all contained in one file. ![]() Serializing your objects and writing them to a file might be simpler in some cases. If all you need to do is store some application data somewhere, then a general purpose RDBMS or even SQLite might be overkill. The question is why do we have to use it for application/database interaction? I still ask for examples of human beings writing/debugging SQL. I would be very grateful if you could give some examples in which SQL is used without ORM purposely, and why.ĮDIT2 SQL is an interface between a human and a database. This situation, in which we build up a new level of abstraction to hide SQL, leads to thinking if we need SQL or not. Everyone I know, including me, is using ORM. Personally, I haven't seen people writing SQL queries by hand for a while. Most of answers claim that SQL, being a text query, helps developers better understand the query itself and debug it more easily. What are the problems of my idea? Is there any reason for me not to write it myself and to use SQL database instead?ĮDIT To make my question more clear. ![]() In the case of changes in table structure those byte queries could be recompiled according to new db schema, stored in XML or something like that. And it surely would name tables and colons by id numbers, not ascii-strings. Personally, I would have used some 'compiled db query' bytecode, that would be assembled once inside a client application and passed to the database. I can understand this is cool for actually understanding what it does, but isn't it silly to use text table and column names for a part of application that no one ever seen after deploynment? If you had to write a data storage from scratch, you would have never used this kind of solution. But why use SQL language for interaction with such a database? This leads us to using relational database, and I'm ok with that - to put it simple, our database table rows sometimes will need to have references to other tables' rows. We need to map this logic to the storage logic, so relations between database objects are required too. Ok, say we have some object-oriented logic in our application, and objects are related to each other somehow. As it seems like the whole world is using these databases (most of all software products, frameworks, etc), it is rather hard for a beginning developer like me to start thinking about whether this is a good solution or not. I'm not quite sure stackoverflow is a place for such a general question, but let's give it a try.īeing exposed to the need of storing application data somewhere, I've always used MySQL or sqlite, just because it's always done like that. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |