4 ms·
> Orms are apis that are one to one with SQL queries. Lol. No they aren't. Not even close. > The primary usage of a SQL database is definitely not primary key
by lmm 3y ago
> Orms are apis that are one to one with SQL queries.
Lol. No they aren't. Not even close.
> The primary usage of a SQL database is definitely not primary key queries to fetch one row at a time. Not at all not even close.
It is, MySQL did the benchmarks. It may not be what they're designed for or what theorists want them to be used for, but it's how they end up being used in a typical web setting.
> In your where clause "Id = 2" that would be what you're describing. The problem here is SQL obviously supports more complex where clauses. "Id > 2" "Id != 4" both of which will return lists and sets. And all orms should support features related to list filtering.
Perhaps they "should". But in actuality they have more limited support the more complex your queries get; a basic column filter you can probably do, but as soon as you want to select something other than '*' most ORMs break down. And they're like that because the users don't need or care about those use cases.
> Don't understand how memcache lends any weight to your point.
Then maybe you should put a bit more effort into trying to understand rather than piling on the insults and attacks. You might learn something.
> You can cache parsing in things unrelated to key value stores.
It's not about caching, there's no caching involved. The point was to make it easy to fetch a whole row by primary key without having to parse an SQL query, because for typical MySQL use patterns, it was spending more time parsing the queries than actually executing them. So they enabled using a protocol from a key-value store, because the most common queries were using it like a key-value store.
- corethree 3y ago>Then maybe you should put a bit more effort into trying to understand rather than piling on the insults and attacks. You might learn something. I did not insult you. Read carefully. You should put more effort into your replys because nobody understands what you're talking about. Up to you, but clearly everything you're saying sounds ludicrous otherwise. >MySQL did the benchmarks. MySQL is a database and databases don't do benchmarks and benchmarks don't tell you how databases are used. You probably mean some researchers measured how databases were used. Show me this source otherwise I have to assume you're making it up. Most of your argument hinges on this. >select something other than '*' most ORMs break down. And they're like that because the users don't need or care about those use cases. Even if what you say is true, and it isnt with the orms I dealt with, filters are a basic feature of all orms and basic column filtering is 100 percent for sets. Orms are nowhere near turning SQL into key value stores. >The point was to make it easy to fetch a whole row by primary key without having to parse an SQL query, because for typical MySQL use patterns, it was spending more time parsing the queries than actually executing them I can see this optimization happening. But this is drastically different from MySQL being a big key value store. The most frequent query may be a key value fetch but it doesn't make the databases primarily key value stores. For example on Google the most searched terms are for porn. Doesn't make Google a porn site and every user a porn enthusiast. Basically every user who searches for porn on Google likely uses Google for other things too. It's just the aggregate most used queries happen to add up to porn. Same with your basic website. The most frequent queries may be isomorphic to a key value fetch but clearly the websites utilize SQL databases for all the other features too. I find it highly unlikely that the majority of the web literally uses MySQL exclusively as a key value store. It is simply just the analytics showing that type of query as most frequent. There is a clear distinction here.
- lmm 3y ago> I did not insult you. Read carefully. You should put more effort into your replys because nobody understands what you're talking about. So if I don't understand what you wanted to convey that's my fault, and if you don't understand what I wanted to convey that's also my fault? Lol. Note the only third party to comment here came down on my side.
- corethree 3y ago>So if I don't understand what you wanted to convey that's my fault, and if you don't understand what I wanted to convey that's also my fault? I wanted to convey it's your fault for what? The only thing I wanted to convey was that you're wrong. If you have a real point then I'm not understanding it, that is your fault because it's a shitty explanation. Barring the shitty explanation if that's not the case then you're basically just wrong. But I'm open to the fact that you're just bad at explaining stuff. Third party guy doesn't know what he's talking about. He's running some statistical algorithm in the web app. You know what statistical algorithms do right? They do massive compilations of data points. Huge averages and aggregations. He's calling that "business logic" lol and he's implying he puts it in the web app. But that's the correct thing to do according to your misguided thinking. Want to find the average price of all products being sold by an ecommerce website? This is your genius architecture in the web app: //BUSINESS LOGIC! def handleRoute(request: Request) -> Response: result = 0 for i in range(100): result += query(f"SELECT price FROM PRODUCTS WHERE PRODUCTS.ID = {i}") return Response(result)