Live data from Hacker News

Ask HN: Backend developers of HN, where and how often do you still use SQL?

news.ycombinator.com

1–10 of 20 posts

Ask HN: Backend developers of HN, where and how often do you still use SQL?

#1
I am increasingly feeling that most of SQL used by BE developers is for supporting low-code business teams focused tools or to debug in production. But wanted to understand if this is the feeling with most of you all. If so, do you like it or do it out of compulsion?

Re: Ask HN: Backend developers of HN, where and how often do you still use SQL?

#2
I work at a startup, we are 6 engineers, 2 of us are back-end engineers. I use PostgreSQL everyday. We tried using an ORM, and creating our own ORM, but it wasn't worth it for us. When you are dealing with medium-large databases, you're going to want to use indexes, to do custom queries with joins etc and it's just not worth it trying to use ORMs.

Re: Ask HN: Backend developers of HN, where and how often do you still use SQL?

#3
It's not a matter of liking it or being compelled, it is the right tool for the job. The alternatives have the advantage of being accessible to developers who don't even know what they don't know. I think that this article describes the situation nicely: http://www.sarahmei.com/blog/2013/11/11/why-you-should-never....

Re: Ask HN: Backend developers of HN, where and how often do you still use SQL?

#4
I had to work on different projects where raw SQL queries where all over the place. This usually happens when the ORM does not help building very large dynamic queries or the developers just want to go the easy way and write the query in raw SQL rather than learning the ORM-specific way of doing it (I have done this myself a lot, to be honest).

In my opinion, I feel more comfortable tuning a raw SQL query to get better performance than tuning the ORM to work in a very specific way to run the very same query and get the performance benefit. However, for easy selects/updates it's more convenient using the ORM and getting the benefit of serializing the results to a domain entity

Re: Ask HN: Backend developers of HN, where and how often do you still use SQL?

#5
Define “use sql”?

Most of the time on $client project we use a query builder, so it’s expressing the intended query as methods.

You’d have a hard time using it without understanding what operations you want - it just handles all the repetitive stuff for you.

Then there’s times when we need a query that’s too complex for what the QB methods support, so we use the custom query mode, where we can mix specific parts of a custom query with some of the stuff the QB generates.

Re: Ask HN: Backend developers of HN, where and how often do you still use SQL?

#6
I use sql on a daily basis.

Many of my etl processes are based on stored procedures. These are large transfers usually via bulk copy (bcp).

Crud operations are done via orms (Entity Framework) or a light orm, Dapper which requires sql statements at times.

Generally, I try to avoid complex sql statements though they are necessary.

Post reply on HN