Live data from Hacker News

Ideas to improve the user and developer experiences of databases

dnlhg.com

21–30 of 56 posts

Re: Ideas to improve the user and developer experiences of databases

#22
post #16

This author is spot on. Raise your hand if you've committed the PostgreSQL to memory for looking at the DDL for a table, or identifying slow queries. Too many database management operations require highly specialized knowledge about a given database's internals. Folks are far too willing to spend huge money on expensive licenses for db analytics tools to tell them when queries are slow or suboptimal. Love the idea of…

Why would I want to have the examine DDL or slow query query committed to memory? I need to know that the concept exists and I can google the syntax in 90 seconds. I’m never within 90 seconds of disaster avertable with this knowledge.

Of course anyone can look anything up. The point I think the author is making is that the database is better positioned to tell us about potential performance issues. Would be wonderful if we could avoid reading through slow query logs, or paying big money for APM tools, if the db exposed more user friendly information about perf issues or other useful metadata.

The UX of 'damn I have to look that one weird query up again' to look up some metadata is not as good as it could be.

Re: Ideas to improve the user and developer experiences of databases

#23
post #13

The main thrust seems to be tooling in the db to give developers some idea of the performance impact of the code they write. But most programmers are using frameworks and ORMs and things that hide away what is actually happening with the database. A normal developer can look at a chunk of code on their side and have no real idea of what is happening on the database behind them. What webdevelopers need is backend prof…

You could easily instruct the orm to add a comment in front of the sql query so the database can profiling of a complete http request and show you all the bad things your orm is doing. Something like: /* dbxperience:request=9a7cd2a6 */ SELECT .... I have not tested it, but this is something google cloud sql recently promoted: https://cloud.google.com/blog/products/databases/get-ahead-o...

"Easily", not sure that is always easy to do. Is a clever approach to be sure, but to the author's point there could probably be better UX.

Re: Ideas to improve the user and developer experiences of databases

#24
post #4

Lambdas would be nice, as the author says there are external options. Postgres has the notify function that lets you build this sort of thing. https://gist.github.com/colophonemes/9701b906c5be572a40a84b0...

Thanks, I didn't know about this.

I've been trying in vain to find something similar for MySQL. I think Lambdas are the killer feature that's missing from databases, you'd basically be able to handle all cache-invalidation / notification systems etc easily from the database layer, it would drastically simplify large numbers of common CRUD web-app problems.

Re: Ideas to improve the user and developer experiences of databases

#25

The author doesn't state what RDMS he's used, but I think Microsoft's SQL Server Platform covers a lot of these, and third party tools, such as Redgate's amazing suite of DB tools, fill in a lot of the gaps.

Which of those ideas does it cover? I’m working with SQL Server as well, and I’d say none.

Re: Ideas to improve the user and developer experiences of databases

#26

For me I wish the language was more standardized between vendors. It would be nice if I could run my mssql statements against sqllite for quick testing. You don’t have to go deep before incompatibilities with ansi sql... top/limit statements.

It would be nice, but at the same time, running mssql in a docker container is a thing now, and it goes pretty far towards solving those issues, at least for my use cases.

>You don’t have to go deep before incompatibilities with ansi sql... top/limit statements. Neither TOP nor LIMIT are ANSI. We didn't get syntax in ANSI SQL for constraining rows until SQL 2008, with FETCH FIRST N ROWS. You could do it in SQL 2003 with window functions, but that was a bit wordy.

Re: Ideas to improve the user and developer experiences of databases

#27
post #6

I’d like a tool that automatically suggests which indexes to add/remove, including use of different types of indexes and partial indexes, based on the queries being performed. Even better if it can automatically test the results of that on a production workload. Or suggest schema changes that would improve normalization or performance.

> I’d like a tool that automatically suggests which indexes to add/remove, including use of different types of indexes and partial indexes, based on the queries being performed

The data to do this is built into Microsoft SQL Server, and the open source sp_BlitzIndex does exactly what you're asking for.

Re: Ideas to improve the user and developer experiences of databases

#28

The main thrust seems to be tooling in the db to give developers some idea of the performance impact of the code they write. But most programmers are using frameworks and ORMs and things that hide away what is actually happening with the database. A normal developer can look at a chunk of code on their side and have no real idea of what is happening on the database behind them. What webdevelopers need is backend prof…

Re: Stackoverflow and showing profiling information on the front end, you are likely talking about Miniprofiler.

https://github.com/MiniProfiler/dotnet

Re: Ideas to improve the user and developer experiences of databases

#30

I like the article but I wish the author mentioned more real-world solutions for comparison.

Thanks! I didn’t want to bring up existing tools unless I knew them in enough detail be thorough and accurate. That said, Vitess can apply query limits as described under Insights. Migrations seem to have dozens of solutions from home-grown to enterprise. Not sure about reducing deadlocks, I’ve seen academic articles in passing that I don’t think have been commercialized yet. Lambdas are common with NoSQL databases like Firebase and DynamoDB. Supabase is working on a Functions feature which is interesting because it’s on Postgres, but they haven’t released many details.

What I’d really like to see is how the combination of features could be more than the sum of its parts.

Post reply on HN