2 ms·
> There will be a tighter coupling of programming frameworks and DBMSs such that all database interactions will be transparent (and optimal). Likewise, SQL (or
by gwbas1c 7y ago
> There will be a tighter coupling of programming frameworks and DBMSs such that all database interactions will be transparent (and optimal). Likewise, SQL (or some dialect of it) will remain the de facto language for interacting with a DBMS, but humans will never actually write SQL.
I've seen two disasters where someone mistakenly thought they could use an ORM to make a database look like a giant, in-memory data structure.
To make a long story short, in both cases, working with a trivial amount of data in an embedded database was painfully slow.
In general, I think we'll see application programming languages expose more semantics that streamline data access. The problem is we keep thinking the way to solve the impedance mismatch is to make the database look like traditional data structures; when the real solution requires languages that have the high degree of flexibility that a SQL database normally has.
For example: A table T might have columns Id, A, B, and C. We can "select Id, B from T". But, if I make a class to map to table T, I probably have fields Id, A, B, and C. Then, if I want to make a little utility function that just looks at Id and B, it's probably taking a full T object, with all of the fields loaded.
In such a case, the programming language needs to evolve. My function doesn't need a full T object, just an object of a class that we, semantically, know is a "T", but also has the fields that I care about. Then, we need enough automation within the compiler to know that, if I add a call to my new utility method, it has to change some code to "select Id, A from T" to "select Id, A, B from T", and leave other code unchanged.
- takeda 7y agoAgree with you that the problem is more on language side, I also believe that the problem isn't as bad as it seems with the right tooling. For example I recently discovered that I can configure PyCharm to a database. Interestingly, after I did just that, the IDE downloaded the database schema and suddenly I got highlighting, autocomplete and refactoring available (well as migrations). Suddenly I felt like I didn't actually need an ORM. C# seems to also have thing called LINQ I'm not as familiar with it but my understanding is that it is a language within language that can represent SQL statements. I'm guessing this might be what you're talking. Ultimately I think the solution is that: - there's a way to efficiently express what data we need (ORM has the issue you mentioned) - an IDE can understand this syntax so it can help with it the same as with rest of the code.
- gwbas1c 7y agoLINQ lets you query and filter collections. You're thinking of LINQ to SQL.
- cwbrandsma 7y agoI don’t think that is used much anymore. Most shops I’ve been on moved to Entity Framework. Uses a very similar syntax tho.
- gwbas1c 7y agoThe few times I looked at LINQ to SQL, it didn't meet my requirements. The first time it had the "update" problem, meaning, it appeared that I had to always load an object into memory before updating it. (2008) The second time, it wasn't available in Mono. (2011) Granted, a lot changed since
- takeda 7y agoI see, I never used it myself, from the outside it looked promising it is sad that it didn't deliver.