4 ms·
> So given a mental model is inevitable, seems reasonable that that model should be the actual model. I think the longevity of SQL has proved there's value is
by ethbro 9y ago
> So given a mental model is inevitable, seems reasonable that that model should be the actual model.
I think the longevity of SQL has proved there's value is non-leaky abstracted interfaces.
- flukus 9y ago> I think the longevity of SQL has proved there's value is non-leaky abstracted interfaces. How is sql non-leaky? To be proficient with sql you have to understand how results are stored on disk, how indexes work, how joins work, etc. To debug and improve them you need to look at the query plan which is the database exposing it's inner workings to you. You have to know about the abstractions an sql server sits on as well. Why is it faster if it's on an SSD instead of an HDD? Why does the data dissapear if it's an in memory DB?
- bch 9y ago> To be proficient with sql you have to understand how results are stored on disk, how indexes work, how joins work, etc No, you don’t. As far as I know, the data is stored in discrete little boxes and indexes are a separate stack of sorted little boxes connected to the main boxes by spaghetti. This is the abstraction, it works, and I don’t need to know about btrees, blocksizes, how locks are implemented, or anything else to grok a database.
- webbles 9y agoYou clearly are not a DBA.
- flukus 9y agoYou've never had to look at a query plan that explains what the database is doing internally? If not then I wouldn't consider you proficient, or you've only ever worked with tiny data sets. Have you created an index? Was it clustered or non-clustered? That's not a black box, that's you giving implementation details to the database.
- bch 9y agoI don’t think being a professional DBA managing an enterprise Oracle installation is isomorphic to the general populace that might use git. There’s no question that knowing more will get you more, but I think for the question of “when will things go sideways and I need to understand internals to save myself”, one would be able to use a relational database with success longer than git, getting by on abstractions alone. Running a high-performance installation of either is really outside the scope of the original point.
- LyndsySimon 9y agoThose things don't generally influence how you structure the query, though - you can choose to structure your query to fit the underlying structure better, or you can modify the underlying structure to better fit your data and the manipulations you are trying to preform. Yes, most of us will have to do both at some point, but they can be thought of as discrete skills.
- btschaegg 9y agoThis isn't a bad analogy though. Git itself is similar - once you understood the graph-like nature of commits (which isn't all that complicated to begin with), it's generally not hard to skim through a repository and understand its history. Diffing etc. is also simple enough this way. If, on the other hand, you are working to create said history (and devise/use an advanced workflow for that), it's very helpful if you understand the underlying concepts. Which also goes for designing database layouts - someone who doesn't understand the basics of the optimizer will inevitably run into performance problems, just as someone who doesn't understand Git's inner workings will inevitably bork the repository.
- DomreiRoam 9y agoYou don't need to know more than sql to manipulate the data. The semantic of your query is fully contained in sql. You may need to go deeper and understand the underline model if you want performance but sticking to normal form can make unnecessary for a lot of people a lot of the time. You can have a useful separation of work between a developer understanding/using sql and a DBA doing the DDL part and the optimization when needed.
- eesmith 9y agoYou have a very high standard for what 'proficient' means, and yet a very low one. That is, I am not proficient with relational databases, and I can handwave why an SDD is faster, and why data may disappear from an in-memory DB. But I couldn't do an outer join without help. Nor do I know when I would want to do one. Bob Martin wrote the essay at http://blog.cleancoder.com/uncle-bob/2017/12/09/Dbtails.html http://blog.cleancoder.com/uncle-bob/2017/12/09/Dbtails.html , in which he writes: > Relational databases abstract away the physical nature of the disk, just as file systems do; but instead of storing informal arrays of bytes, relational databases provide access to sets of fixed sized records. This isn't true. SQLite does not use fixed size records. This suggests to me that a lot of people who consider themselves proficient with SQL don't know how the results are stored on disk, nor the difference between the SQL model and the actual implementation details, making them not proficient under your definition.
- flukus 9y ago> That is, I am not proficient with relational databases, and I can handwave why an SDD is faster, and why data may disappear from an in-memory DB. Because you know that information for other reasons as most people would. Just because the information is gained for other reasons does not make it irrelevant when using a database though. > This isn't true. SQLite does not use fixed size records. It's actually true of most/all modern databases these days. The point isn't knowing the exact structure the database uses to store it's information (even though it can be useful) but knowing how efficiently it can find the information for any given request. Knowing when a database is doing an index lookup or a full table scan is very important and I wouldn't consider someone that can't make a reasonable guess to be proficient in sql. Many of these details are even exposed in the sql, when you create an index and decide if it's clustered or non-clustered your giving the database specific directions about how the data will be physically stored. The fact that you need to know anything about how they do their work internally to be reasonably competent at using them makes them a leaky abstraction.
- blattimwind 9y agoSQL leaks for complex queries and schemas if performance needs to be optimized. I argue virtually all abstractions leak heavily when performance is considered, some more than others. SQL leaks relatively little in comparison to some other technologies IME. Also, SQL has well-established processes and formalisms to design schemas which generally result in solid performance by themselves. That's what RDBMS are around for, after all: enabling efficient and consistent record-oriented data manipulation. This is quite difficult to do correctly in reality; for example, if you write your own transaction mechanism for disk/solid-state storage, you are going to do it wrong. This is genuinely difficult stuff. There is a ton of internals that SQL abstracts so well that very few DB programmers know or (have to) care about them. Things like commit and rollback protocols, checkpointing, on-disk layouts, I/O scheduling, page allocation strategies, caching etc.
- i2om3r 9y agoYou seem to be talking about a different kind of leakiness. In my mind, there are two kinds: conceptual and performance leakiness. You are talking about the latter. Pretty much any non-trivial system on modern hardware leaks performance details. From what I understand, git's UI tries to provide a different model that the actual implementation but still leaks a lot of details of the implementation model.