News for hackers. Stuff that matters.
Re:Today’s Top Tech Skills by dathinab on Sunday November 24, 2019 @11:32AM (#21621424)
In the recent two or so years I was surprised to see how many people don't _really_ know about SQL. Sure they can write a simple insert and update query and maybe a join, assuming they can just ignore that there actually are different types of joins. But if you ask them about other _still fundamental_ knowledge like a _rough_ idea about what the different transaction isolation level are/mean/imply for you, they fail hard.

Realizing this allowed me to understand why:

1. There is so many used ORM(ish) libraries which make it in practice harder to access the database for anything but trivial queries.

2. NoSqlish databases seem to have became so successful even in application where non of there "benefits" (wrt. scalability and similar) matter and you would normally prefer to avoid some of there drawbacks (e.g. eventual consistency, no "system wide-ish" transaction, enforcement of correct schemata and some parts of data consistency). (Sure there are other reasons for there success, too. Like being fancy, modern or no clear requirements analysis and therefore no idea about scaleability requirements ...).

I mean if SQL and relational databases are for you just structs with a bit more basic types then JSON but which in turn are flat requiring annoying foreign key references and a bunch of ceremony around this with very little added benefits then yes it makes so much more sense to just use a nosql database and be done with.

(PS: Yes I'm aware that for certain use-cases the resulting databases can be very complex and hard to use, what I mean is that it's a skill you have to learn to use efficiently and a scarily large amount of people a came in contact with in the recent years not only don't have that skill but are not aware that, if they don't want to mess up larger databases they work on, they will have to learn that skill.)

Re:Today’s Top Tech Skills by MatekCopatek on Sunday November 24, 2019 @12:07PM (#21621691)
What would you say is the special thing about this particular bit of knowledge that made you point it out? To be perfectly honest, it seems quite arbitrary to me.

I could say I'm surprised to see how many people don't know anything about the browser rendering pipeline and consequently produce badly performing interfaces. Someone else would complain about people's inability to do even the most basic Linux administration tasks.

But at the end of the day any single bit of knowledge doesn't say much about your general ability to be a developer. The term "web development" covers an extremely wide array of topics. Luckily, there are many wonderful pieces of software out there that abstract things away and allow you to produce a finished product even if you aren't an expert in everything involved.

Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @12:20PM (#21621792)
It's not arbitrary because screwing up your data integrity is far and away one of the most painful and business critical mistakes you can make as an engineer. Your product isn't finished if it looks like it works, but is either storing data improperly at rest or doing the wrong thing with it.
Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @12:29PM (#21621865)
I think the point to be made was that if you screw up your browser rending to the point of it being unusable on old devices, that could be just as business critical as the data integrity issue.

Making either of those your line in the sand for what a developer should and shouldn’t know is arbitrary. I don’t know a ‘Scala’ full-stack developer that could do advanced optimisation on React render times, or a ‘React’ developer that knows transaction isolation.

Not knowing either of these does not make you an unworthy developer and unless you have a specific need for these skills it probably does more harm than good expecting everyone to know them.

Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @12:37PM (#21621914)
The difference is that if you screw up your browser rendering, you're not messing up your data integrity at rest and creating compound technical and potential business debt. If anything in the critical path from pricing to payments that talks to your data store makes a mistake, you can risk anything from not recording your transactions properly to charging the wrong amount or not enough at all.

It's very expensive to acquire customers. It gets even more expensive when you have dirty data from incomplete domain modeling.

Re:Today’s Top Tech Skills by littlecranky67 on Sunday November 24, 2019 @12:56PM (#21622044)
Again, you just pick data as the "one" core business critical technology. I guess you are an SQL export? There are dozens of critical points of failure. Losing your HA gateway during an expensive ad campaign, designing your network/data center wrong such that your SQL cluster goes down etc. etc. Even JavaScript that hides the "checkout" feature. I didn't even go into security (think your domain gets hijacked, or XSS injection on your site etc.).
Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @01:10PM (#21622157)
I never said there was only "one" core part of business critical technical competency. What I'd say is that there are several of them in high priority that have an out-sized effect on long term project success. One of them (security) probably has a similarly outsize effect, but everything else you're describing is operations. It doesn't have an effect on how you design your software, and whether it exhibits correct behavior.

At the most basic conceptual level, the business of software rests on reading inputs correctly, processing them, and writing the right outputs with strong guarantees. SQL is historically the most sophisticated, powerful, common and cross platform way to do that in a structured manner that is easy to reason about for a vast majority of use cases. You can layer an application on top of the foundation of an appropriate data model, but the appropriate data model is a root requirement to even get to a passable prototype. That is why gradual mastery of it yields such outsize payoffs compared to mastering other skills.

Re:Today’s Top Tech Skills by arcticfox on Sunday November 24, 2019 @01:03PM (#21622090)
This argument is entirely arbitrary.

What about security? Your business won't succeed if you're hacked daily.

What about monitoring? If you're losing data and don't even know it, you're creating compound technical and potential business debt.

What about performance? Once you have a perfect data model, no amount of trying to optimize it will improve your business further. Optimizing other parts of the application can.

Basically everything is important, saying that just because someone isn't an expert in one phase that they're not as good of a developer is myopic.

Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @01:16PM (#21622202)
I get the sense that you and other commentators are putting a certain binary in place, and I'm not sure it's in good faith. Nobody ever said that you have to pick one particular place to be an expert in, and if you're not an expert there, you're not a good engineer. That's an absurd argument, but it's also not what is being said.

The truth is, you need to be good enough at all of the high priority parts of technical competency. Security, monitoring, performance -- sure, all of those are also extremely important. They're all places where unforced errors can be introduced that can and do hurt the business -- sometimes catastrophically or fatally.

With that said, to not recognize the evergreen utility of domain design skills is ignorant. You will never get the luxury to worry about security, monitoring, or performance if you don't build the state machine that makes the right outputs out of the right inputs because you will either never sell it to a customer, or lose that customer when they choose a competing solution which actually does what it's supposed to do.

It's not true that everything is equally important. I think that's a myopic way to look at software development without considering the business impact of key crucial areas where software design and maintenance intersect with stakeholders.

Re:Today’s Top Tech Skills by taffer on Sunday November 24, 2019 @06:48PM (#21624357)
> Your business won't succeed if you're hacked daily.

Which can be the consequence of setting the wrong isolation level: http://www.bailis.org/papers/acidrain-sigmod2017.pdf

Re:Today’s Top Tech Skills by scarface74 on Sunday November 24, 2019 @03:13PM (#21623014)
Even if you are using an RDMS it doesn’t help to protect you against many business rule violations. Your data may be relationally correct, but that’s about it.
Re:Today’s Top Tech Skills by wehrkeoruw on Sunday November 24, 2019 @01:05PM (#21622108)
We're having this conversation as if everyone making SQL queries is one fat finger away from irrevocable data loss. I know very little about SQL but have managed to build literally dozens of systems on top of Postgres without ever causing a data loss event as a result of my poor SQL skills...
Re:Today’s Top Tech Skills by arbie on Sunday November 24, 2019 @01:18PM (#21622214)
I think we are seeing the difference between software development and software engineering laid bare.

The distinction is similar to a property developer and a civil engineer. Both create buildings, but one does it at scale by offloading functions to known entities and prepackaged solutions, while the other understands one domain in depth.

Both are needed in any team or organization, because not every solution needs to be "engineered" (a Dockerized Redis instance without SSL or auth behind a corporate firewall may survive untouched for a decade), but sometimes you have to engineer something that withstands gale-force winds at 1000 ft height.

Re:Today’s Top Tech Skills by littlecranky67 on Sunday November 24, 2019 @12:30PM (#21621866)
Again, arbitrary. You could also argue a JavaScript bug on your site preventing a shop checkout is the worst, because you lose Cash by the minutes.
Re:Today’s Top Tech Skills by bathtub365 on Sunday November 24, 2019 @12:57PM (#21622056)
While a front end bug that gets in the way of sales is bad for a business, a poorly designed or buggy data layer can cause issues throughout the rest of the application. It can lead to things like lack of isolation between users, loss of data, data inconsistency, and scalability issues.
Re:Today’s Top Tech Skills by ThrowawayR2 on Sunday November 24, 2019 @12:48PM (#21622004)
You have got to be kidding. Corrupting data for a sale already made is far worse than losing a sale because of an outage.
Re:Today’s Top Tech Skills by arcticfox on Sunday November 24, 2019 @01:05PM (#21622115)
> Corrupting data for a sale already made is far worse than losing a sale because of an outage.

I mean, this is still arbitrary. There are millions of small businesses worldwide that do fine with terrible records, but making on-going sales.

If you don't make any sales because of constant outages, you could argue that's worse than trying to deal with corrupted data, especially if you have log files or some other method to recover corrupted data anyways.

Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @01:29PM (#21622272)
You're getting to the crux of the issue now. If you don't have log files to recover corrupted data anyways, or that is you never saved it in the first place -- you CANNOT recover it. If you risk irreparably corrupting old data and new data, what is the value of your software system in the first place? Why not use google forms and google spreadsheets, data entry analysts and a call center and be done with the whole thing anyways?

My point is that the very root of what gives software value is something deeply industrial -- it is a machine that can do something over and over correctly, reliably and without regressions. If you take away that reliability to be depended upon by a business, you are no longer building an industrial strength solution -- you're building a toy.

Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @12:58PM (#21622059)
Not when you’re corrupting only a handful of sales, but losing all of them. It still feels arbitrary to say one is more important for developers to be aware of than the other here.

As long as you have both covered to a reasonable degree within your company/team it’s a waste of time arguing who’s got the most important info in their brains.

Re:Today’s Top Tech Skills by joyeuse6701 on Sunday November 24, 2019 @01:07PM (#21622137)
One is more important because presumably one is harder and thus more expensive to recover from. Typically the deeper the rot in the foundation, the more expensive the repair.
Re:Today’s Top Tech Skills by stefano on Sunday November 24, 2019 @01:58PM (#21622462)
A data corruption might be also impossible to recover from. You could even only notice it after months of it happening, e.g. if your users spend months collecting data which is only analysed at the end of the year.
Re:Today’s Top Tech Skills by darkerside on Sunday November 24, 2019 @01:16PM (#21622197)
You are potentially corrupting ALL of your data, not just a handful. Sure, in the two scenarios you chose to provide (speaking of arbitrary), the JS error is clearly worse. If you take the worst case scenario in both cases, one is much more likely to cause an existential threat to your business.
Re:Today’s Top Tech Skills by LaGrange on Sunday November 24, 2019 @01:03PM (#21622089)
...that's assuming there's some sort of meaningful liability in corrupting the data, either legal or from PR backlash, but sometimes it feels like many companies have discovered that's not really the case.
Re:Today’s Top Tech Skills by yowlingcat on Sunday November 24, 2019 @12:33PM (#21621887)
I think you're proving exactly my point.

SQL is intrinsically very close to the metal of your business logic, especially when it comes to general business logic. General business logic is typically most critical and risky around the surface of payments. A JavaScript bug on your site around your shop preventing checkouts is very bad because you are indeed losing cash by the minutes. A poor domain model that doesn't properly associate active promotions to cart order lines could result in an incorrect charge amount and an irate customer.

Re:Today’s Top Tech Skills by itronitron on Sunday November 24, 2019 @12:29PM (#21621863)
>> many people don't know anything about the browser rendering pipeline

if you can recommend a good source for learning the browser rendering pipeline please post it here, everyone I have asked just shrugs it off and says that no one really knows.

Re:Today’s Top Tech Skills by greenyouse on Sunday November 24, 2019 @01:50PM (#21622406)
I'd be interested in other resources for this too. The best I can think of is Udacity's Web Performance Optimization class[0]. It's by Ilya Grigorik, chair of the W3C Web Performance working group.

Other than that there are some older docs for the Blink engine which drives Chromium. It's much more low level and hard to follow though[1][2].

The Navigation Timing spec is good for building an understanding of the major events that go into a page loading and creating HTML elements[3]. It's not the whole picture but gives the timings for navigation and DOM element events.

[0] https://www.udacity.com/course/website-performance-optimizat...

[1] https://www.chromium.org/developers/the-rendering-critical-p...

[2] https://docs.google.com/document/d/1wYNK2q_8vQuhVSWyUHZMVPGE...

[3] https://www.w3.org/TR/navigation-timing/#processing-model

Re:Today’s Top Tech Skills by simoncarter on Sunday November 24, 2019 @01:22PM (#21622246)
Re:Today’s Top Tech Skills by davidjnelson on Sunday November 24, 2019 @01:15PM (#21622193)
This one is quite good. I posted it to Hn 6 years or so ago but it didn’t get upvotes:

https://www.html5rocks.com/en/tutorials/internals/howbrowser...

Re:Today’s Top Tech Skills by gdy on Sunday November 24, 2019 @01:41PM (#21622343)
How much of it is relevant 8 years later?
Re:Today’s Top Tech Skills by debaserab2 on Sunday November 24, 2019 @01:59PM (#21622475)
Nearly all of it
Re:Today’s Top Tech Skills by davidjnelson on Sunday November 24, 2019 @01:29PM (#21622273)
This series is also quite good, a bit more modern:

https://developers.google.com/web/updates/2018/09/inside-bro...

Re:Today’s Top Tech Skills by LaGrange on Sunday November 24, 2019 @01:04PM (#21622104)
> I could say I'm surprised to see how many people don't know anything about the browser rendering pipeline and consequently produce badly performing interfaces.

I mean, if you're supposed to be a senior front-end dev then that wouldn't be an unreasonable expectation. Meanwhile there's plenty of senior back-end developers out there working on SQL-backed applications who don't know SQL and refuse to learn it.

Re:Today’s Top Tech Skills by liveoneggs on Sunday November 24, 2019 @01:16PM (#21622203)
by this reasoning all knowledge is arbitrary so this comment provides no value beyond arbitrarily shitting on someone
Re:Today’s Top Tech Skills by goatinaboat on Sunday November 24, 2019 @04:11PM (#21623446)
many people don't know anything about the browser rendering pipeline and consequently produce badly performing interfaces

No one cares about that because the website will be redone in the hottest new framework every few months anyway. Whereas serious databases are around for decades.

Re:Today’s Top Tech Skills by brightball on Sunday November 24, 2019 @11:46AM (#21621531)
My go to interview question to test basic SQL knowledge is use of “HAVING”.

It’s a surprisingly good filter.

EDIT: To clarify since this got more attention than I expected...I don’t disqualify any candidate based on the answer to a single question. I just use that question to assess their actual SQL experience. If you’ve spent any amount time writing raw queries by hand for reports or just to pass through to a web service, you’re going to have run into HAVING. It’s a simple part of the basic SELECT syntax without needing to involve joins, subqueries, index optimizations or specific knowledge of database internals.

It’s a fair question and the only way you wouldn’t have run into it is from working purely with ORMs or NoSQL. There’s a lot you can do without it, but it goes a long way in determining my ability to ask you to open up a query analyzer in different environments. It’s also going to tell me a lot about the way you think about data problems and where you are going to gravitate for certain types of logic.

Re:Today’s Top Tech Skills by kradroy on Sunday November 24, 2019 @12:26PM (#21621844)
Eh, HAVING is something that can be learned in 5 minutes. So filtering out for that is probably generating a lot of false negatives. I quiz them on indexes and table design. Those can be done without writing a single SQL query.
Re:Today’s Top Tech Skills by SkyPuncher on Sunday November 24, 2019 @01:32PM (#21622286)
I look up HAVING every time I write it.

I just don't use it enough to keep it in memory as a first class concept. A quick google search with an example is enough to jog my memory.

If I got asked about it on an interview, I'd be completely blank.

Re:Today’s Top Tech Skills by ordinaryperson on Sunday November 24, 2019 @02:05PM (#21622517)
Exactly.

"I use [x] all the time and know it well, so [x] will be a good filter for evaluating someone's technical skills."

No. People do different work tasks depending on the project or company.

Sometimes I'm knee-deep in SQL. Others in React. I'm often forced to do PHP. My familiarity with specific SQL syntax ebbs & flows with what I'm doing.

There's no point in keeping something in your brain if you're not going to use it every day. Just remember the general concept and Google the specifics when you need it.

Just one example why interviewing is terrible and interviewers really should be trained on what not to do.

Re:Today’s Top Tech Skills by SkyPuncher on Sunday November 24, 2019 @11:18PM (#21625422)
Exactly the same with me.

Need me to write an ETL. I probably can't crank it out in an hour like a data scientists, but I can get it done in a reasonable amount of time. I just need to do some major context shifting.

Have me write only ETL's for a week, I'll be cranking them out after the first few.

Re:Today’s Top Tech Skills by babuskov on Sunday November 24, 2019 @01:46PM (#21622381)
I'm curious now. What's there to look up? It's just like WHERE, but you use it on aggregate values.

WHERE filters the data before you aggregate it, HAVING afterwards.

That's all there is to it.

Re:Today’s Top Tech Skills by alasdair_ on Sunday November 24, 2019 @02:05PM (#21622518)
Simply remembering that fact is language trivia that is easy to refresh when needed.

It’s like asking if intel x86 is big-endian or little-endian. It’s trivial to check but if I haven’t had to use that fact in a while, I likely won’t bother to remember because it’s trivial to search for.

Re:Today’s Top Tech Skills by FpUser on Sunday November 24, 2019 @12:23PM (#21621824)
My use of SQL beyond very basic is very sporadic (I do remember about HAVING though). If you ask me out of blue I would most likely fail tests. From time to time however I do have to design database for particular product and in a matter of few days my knowledge gets from basic to very good one. Only to go down again a short while after database design implementation and testing completes.

That does not mean that I do not know basic concepts about how different databases work, including underlying storage engines etc. To the point that for one product I personally designed actual NoSQL (EAV to be precise) database engine and query engine largely resembling SQL to go along.

So would you fail me in your test?

Re:Today’s Top Tech Skills by freedomben on Sunday November 24, 2019 @01:45PM (#21622375)
Exactly. You don't use it, you lose it. That doesn't mean you don't have the capacity to reacquire it in a short period should you need it again. Most humans are not encyclopedias.

I can describe for you in detail the different index types on MySQL and Postgres, and go into when/why you would use each. But it's been so long since I crafted a complex join by hand I would definitely have to google it. However I don't doubt that I could write the query in a short time. One of the most realistic interviews I ever had, they gave me a laptop and allowed me to google during my answer. I took the job.

Re:Today’s Top Tech Skills by sitkack on Sunday November 24, 2019 @11:54AM (#21621590)
I like to structure my questions such that they could using HAVING or a CTE or subquery and not test on the piece of knowledge directly, but the application of knowledge.

Like in Python if you asked lots of questions with list of numbers ... and then generalized it to infinite lists of numbers. If the first case I'd like to see list comprehensions, and then generator expressions or possibly the use of itertools.

Re:Today’s Top Tech Skills by brightball on Sunday November 24, 2019 @05:59PM (#21624109)
That tends to be how it leads in. We’ll talk through building a simple CRUD application with a single table and then ask questions about how to get specific data for somebody in marketing.

There are a lot of ways to answer it, but HAVING is the simplest.

Re:Today’s Top Tech Skills by scarejunba on Sunday November 24, 2019 @12:34PM (#21621894)
My experience with interviewers is that they all believe that their pet question is "a surprisingly good filter". Considering that there is rarely a data-driven approach to recruiting, usually this statement has a heavy confirmation bias.

Usually when you add data to the mix, you'll find that most questions are not significantly correlated with candidate success/failure once you condition on "ability to write any code at all".

Re:Today’s Top Tech Skills by freedomben on Sunday November 24, 2019 @01:51PM (#21622409)
Completely agree. Early in my career I had what I thought was "a suprisingly good filter" question I would ask candidates. For a couple years I did this. We hired one guy who had failed my question and then fired him a couple months later, which heavily reinforced my belief in the value of this question.

A couple years later I found the stack of resumes, some we hired, some we didn't. I realized that some of our best engineers had failed my question, and I had subsequently voted "no" (I was outvoted, fortunately, by my fellow panelists. Another reason I strongly advocate panel interviews but that's a separate discussion).

I soon realized that my question was good at filtering out people who didn't think like me, not at filtering out people who would make good engineers.

My takeaway was that everyone, especially me, could use a healthy dose of humility and self-skepticism. Not advocating swinging the pendulum into Impostor Syndrome (which I now struggle with sometimes), but somewhere in the middle is good and healthy IMHO.

Re:Today’s Top Tech Skills by ClumsyPilot on Sunday November 24, 2019 @01:07PM (#21622130)
That is my experience too. I had people swear by "multiply two numbers without using a multiplication sign" as their one and only coding challenge.
Re:Today’s Top Tech Skills by mypalmike on Sunday November 24, 2019 @02:02PM (#21622499)
I knew a guy, a really good engineer, who used to ask people about a specific thing you would see in a log file from a particular open source server. The SQL "having" question isn't quite as bad, but neither question is good at assessing one's ability to solve problems.
Re:Today’s Top Tech Skills by dadoge on Sunday November 24, 2019 @12:30PM (#21621867)
Is the pun of saying knowing “HAVING” is a good filter intended?
Re:Today’s Top Tech Skills by brightball on Sunday November 24, 2019 @01:42PM (#21622350)
It is now.
Re:Today’s Top Tech Skills by snarfy on Sunday November 24, 2019 @12:10PM (#21621722)
I can barely get candidates to join two tables.
Re:Today’s Top Tech Skills by alasdair_ on Sunday November 24, 2019 @02:00PM (#21622477)
I’ve hand written thousands of sql queries, including a year spent writing nothing but PL/SQL stored procedures. I’d fail your test, not because I’ve never used it but because I’ve not had to use it in years and, importantly, I rely on Google to remind me of syntax trivia when moving back to a language I haven’t actively worked in in a while.

I HATE trivia questions and I’m convinced they are a sign of a lazy interviewer. If you want to test someone’s knowledge of sql, give them a sample schema, an internet connected computer and five minutes to write an appropriate sql query for your use case.

Re:Today’s Top Tech Skills by brightball on Sunday November 24, 2019 @02:47PM (#21622829)
It’s not a trivia question. It’s directly related to GROUP BY and is a core part of standard SELECT syntax.

I’ve never met somebody who has spent any amount of time writing raw SQL who didn’t know it.

I’ve met a lot who overly rely on their ORM but “have done a lot of SQL” who don’t.

Re:Today’s Top Tech Skills by dennis_jeeves on Sunday November 24, 2019 @09:48PM (#21625038)
Brightball, how many years of coding/sql/developer experience do you have?
Re:Today’s Top Tech Skills by brightball on Sunday November 24, 2019 @11:08PM (#21625385)
Going on 20
Re:Today’s Top Tech Skills by dennis_jeeves on Monday November 25, 2019 @07:20AM (#21627442)
How much time would you think, the (+)average programmer, say with 10 years experience needs to learn _basic_ sql, along with the HAVING clause, assuming they have never learnt sql during their entire working career? ( we are talking RDBMS concepts from scratch. like Primary keys, normalization etc, and finally sql).

(+) average= meaning the programmer should be able to say 'solve' the FizzBuzz under comfortable conditions. Or say add the first n items in an integer array etc...

Re:Today’s Top Tech Skills by brightball on Monday November 25, 2019 @09:48AM (#21628517)
Largely depends why you ask? I get the impression that most people have taken this to be a pass fail type question in an interview and that’s where the contention is coming from.

My interviews are conversations to get to know you, your background, your professional interests, how you think about problems and how closely your resume lines up with those conversations. I like to get people talking about their work to see where their energy level goes.

When we start talking through a hypothetical data problem there are people who will describe the problem from the UX perspective, the app code perspective and the database perspective. The question prompts that portion of the conversation.

Re:Today’s Top Tech Skills by dennis_jeeves on Monday November 25, 2019 @09:55AM (#21628575)
>I get the impression that most people have taken this to be a pass fail type question in an interview and that’s where the contention is coming from

Precisely. And why not? I have my fellow developers do that ( ask trivia and label the interviewee incompetent, if he cannot answer it) , and most people who have reacted to your post have also probably seen that.

Anyway humor me and tell me how much time it would take?

Re:Today’s Top Tech Skills by brightball on Monday November 25, 2019 @11:39AM (#21629873)
Learning the concepts? A few hours

Using the concepts in how you naturally think about problems?

That will only come from experience. I can't say exactly how much but I'd imagine something in the realm of 6 months minimum of applied usage to different problems.

Re:Today’s Top Tech Skills by amp108 on Sunday November 24, 2019 @04:55PM (#21623708)
I went to a job interview recently where the interviewer was trying to phrase the question properly: "I'm trying to figure out how to ask this next one, so if you have a lot of Customers, and... umm..."

And I interjected during a long pause and said "It sounds like you're trying to ask a question which could be answered by using a HAVING clause. So something like, only those Customers who have two or more orders, which would be 'GROUP BY Customers HAVING count(Orders) > 2'."

I was right, he was looking for that. Still didn't get the job.

Re:Today’s Top Tech Skills by rockinghigh on Sunday November 24, 2019 @12:08PM (#21621698)
How would you know it’s a good filter? What position are you interviewing for?
Re:Today’s Top Tech Skills by kradroy on Sunday November 24, 2019 @12:39PM (#21621925)
It's about as good a filter as asking a candidate what a "gyascutus" is.
Re:Today’s Top Tech Skills by FpUser on Sunday November 24, 2019 @12:45PM (#21621967)
ROFL. You've made my day.
Re:Today’s Top Tech Skills by ereyes01 on Sunday November 24, 2019 @02:18PM (#21622596)
Trivia
Re:Today’s Top Tech Skills by mmsimanga on Sunday November 24, 2019 @12:42PM (#21621951)
Some months ago I sat in a meeting to discuss design and implementation details for a medicine delivery system. The fact that it was about medicine I thought it would be obvious to everyone that we would have to use a relation database with ACID properties. Last thing we want is to send medicine at best effort, I assumed everyone would be on the same page on the need to use transactions, foreign keys and all other data integrity mechanisms baked into relational databases. I was taken aback when the app developers really could not understand why we needed to use a relational database. A document database was going to be fine. Needless to say it was a long meeting and I wasn't invited back.
Re:Today’s Top Tech Skills by daxfohl on Sunday November 24, 2019 @01:11PM (#21622162)
Blech, the worst thing I've noticed after moving to document databases even when scale does matter is the loss of the relational data model. A nice ERD that shows relationships between your entities makes everything so simple. You could have one for document database as well but people stare at you strangely. So now it's just a random collection of collections of stuff, and it takes 10x more words to describe your design.
Re:Today’s Top Tech Skills by geophile on Sunday November 24, 2019 @01:32PM (#21622289)
This is a really good read: http://www.sarahmei.com/blog/2013/11/11/why-you-should-never...

It shows what happens when you have exactly the misunderstandings being discussed here. Also note that the author still has absolutely no idea how to do a simple ER diagaram.

Re:Today’s Top Tech Skills by andybak on Sunday November 24, 2019 @01:41PM (#21622341)
My favourite line:

> Once we figured out that we had accidentally chosen a cache for our database, what did we do about it?

I'm going to use that one to win imaginary arguments in my head with my pet NoSQL strawman.

Re:Today’s Top Tech Skills by geitir on Sunday November 24, 2019 @12:55PM (#21622042)
So they went with a non relational?
Re:Today’s Top Tech Skills by mmsimanga on Sunday November 24, 2019 @01:04PM (#21622102)
I wasn't invited back so I don't know. The back story is there had been some initial discussions before the meeting I attended. I was invited because my area is data analytics so the project owner wanted to keep me in the loop. It appears I upset the apple cart with my opinions. I was polite but firm. I don't regret it because I spend my life cleaning up messy data from systems not using core relational principles to get analytics out. Very few systems use foreign keys.
Re:Today’s Top Tech Skills by wehrkeoruw on Sunday November 24, 2019 @01:06PM (#21622121)
There are lots of ways to interact with folks who don't understand something that get your point across without making them feel bad. I'm guessing you didn't employ any of those strategies.
Re:Today’s Top Tech Skills by mmsimanga on Sunday November 24, 2019 @01:12PM (#21622170)
The truth is probably somewhere in between. I was firm but polite. I was called in because I was going to be analyzing the data. Build data warehouse and import other data. I had to be firm because I know how much time it takes to clean up data before you can analyse it.
Re:Today’s Top Tech Skills by henrik_w on Sunday November 24, 2019 @01:03PM (#21622093)
I never learnt SQL "properly" until I took one of the first MOOC courses, Introduction to Databases by Jennifer Widom. Really good for getting a better understanding. Also, for a fantastic source on database transactions and isolation levels, check out "Designing Data-Intensive Applications" (chapter 7) by Martin Kleppmann. Really a great book!

I have written about both these here:

https://henrikwarne.com/2011/12/18/introduction-to-databases...

https://henrikwarne.com/2019/07/27/book-review-designing-dat...

Re:Today’s Top Tech Skills by StriverGuy on Sunday November 24, 2019 @11:47AM (#21621537)
Regarding your 2nd point: commercial grade NoSQL db's can do all of these things now. I think the notion that they cannot is from the v1-2 era of Mongo about 7 years ago. You should read the Dynamo white paper and subsequent documentation on write consistency, transactions etc. and also look at the feature set available on Mongo V4.2.
Re:Today’s Top Tech Skills by ken on Sunday November 24, 2019 @01:04PM (#21622101)
Commercial grade databases have done all these things since the 1980's. We just hadn't invented the name "NoSQL" for them, because we hadn't yet realized we were supposed to hate SQL. We called them Object Databases, because it was the decade when objects were cool. It also gave us C++ and Objective-C and Object Pascal. Basically we were just gluing objects onto everything we could.

I've used one. It was great. They (mostly) failed because of business and politics and a whole lot of other reasons unrelated to the technology. I'm sure by now everybody here knows that systems don't succeed or fail based purely on the technical qualities of their design and implementation.

Re:Today’s Top Tech Skills by VectorLock on Sunday November 24, 2019 @12:41PM (#21621940)
We all still get a good laugh at the "MongoDB is webscale" video.
Re:Today’s Top Tech Skills by MiroF on Sunday November 24, 2019 @12:46PM (#21621979)
There are still serious concerns in terms of speed for anything involving analytic applications.
Re:Today’s Top Tech Skills by gigatexal on Sunday November 24, 2019 @12:15PM (#21621761)
I agree. Use the right abstraction and the right number of them: I’ve yet to find an ORM that didn’t kick you in the face In terms of performance to only hold your hand with queries.

SQL queries can be done in code in a sane way to avoid sql injection or you could implement stored procedures and functions to make operations more ORM-like but not pay any of the ORM tax.

It’s just annoying to see the DB treated so flippantly by devs who are Hussein Bolt quick in grabbing an ORM when it’s not always the right tool or even necessary. They’re great for prototyping but not for production imo

Re:Today’s Top Tech Skills by notduncansmith on Sunday November 24, 2019 @12:28PM (#21621861)
I think HugSQL[1] (Clojure library) has really opened my eyes to what DB interaction should be like. It’s not exactly an ORM, but it protects you from SQL injection and makes it convenient to leverage the capabilities of your SQL database.

Also, his name is Usain Bolt[2].

[1] https://github.com/layerware/hugsql

[2] https://en.m.wikipedia.org/wiki/Usain_Bolt

Re:Today’s Top Tech Skills by gigatexal on Monday November 25, 2019 @06:06AM (#21627039)
Sure I am not saying crafting queries explicitly and preventing sql injection etc in code is elegant but it can be done and you can write super thin abstractions over the boring bits and still maintain a ton of power over your queries and know exactly what is going on without having to add another dependency.

The one huge win for ORMs in my mind is the standing up of and the iteration of schemas, defining a schema and then summoning a database in alembic vernacular is really neat whereas one would have to manually manage a set of init scripts and migrations oneself.

In the end there's no really clean way to do DB maintenance and work it's just work and has to be done, imo.

Re:Today’s Top Tech Skills by jareds on Sunday November 24, 2019 @12:58PM (#21622060)
I've found Mybatis[1] to be a better alternative to Hibernate. At least with the version I was using you had to do complex mapping in XML instead of annotations which isn't great but I'll make the trade-off to avoid the ORM. Not sure if this is improved in 3.5. [1] https://github.com/mybatis/mybatis-3
Re:Today’s Top Tech Skills by andybak on Sunday November 24, 2019 @01:36PM (#21622312)
> which make it in practice harder to access the database for anything but trivial queries.

I did my time. I understand normalization. I've got a vague understanding of the various normal forms (except 6NF which nobody seems to understand ;-)

I can use a query profiler and I've occasionally read up on the different index types and their performance profiles.

But I still prefer to use an ORM. SQL syntax just never fitted my brain.

And the ORM I use can handle aggregation, annotation and a bunch of stuff that you couldn't really describe as "trivial queries"

Re:Today’s Top Tech Skills by andybak on Sunday November 24, 2019 @05:09PM (#21623792)
(Actually - just read up my Codd again - I think it's 5NF that always had me stumped)
Re:Today’s Top Tech Skills by chaostheory on Sunday November 24, 2019 @12:09PM (#21621708)
I’ve used both relational DBs and nosql professionally. While in super specific use cases, NoSQL does shine; it’s a giant mistake to use them as a generic, general data store like with a traditional SQL database. You end up doing a lot more avoidable work in the long run especially if you’re doing reporting ie something that SQL can easily handle, you end up having to replicate it in your own code base
Re:Today’s Top Tech Skills by nostrebored on Sunday November 24, 2019 @12:55PM (#21622036)
Why is making a materialized view for reporting hard? Shouldn't components be aware of what they need to enable analytics?

I don't see how adding logic to a service at runtime is any different than fiddling with queries and optimizing them

Re:Today’s Top Tech Skills by chaostheory on Sunday November 24, 2019 @06:02PM (#21624122)
With SQL the logic of filtering and joining is already mostly done for you. You’re basically now reimplementing this logic if you’re not using it. In most cases it isn’t difficult but it still time consuming and more prone to bugs vs using SQL

I don’t see the point of reinventing wheels unless you have to, unless you have lots of time and energy to waste

Re:Today’s Top Tech Skills by JustSomeNobody on Sunday November 24, 2019 @11:53AM (#21621584)
This is a side effect of the extremism that happens in our industry. A decade and a half ago there was a hard push on ORMs, to the point that people would refuse to work on a code base that didn’t use one. So a lot of developers simply “grew up” not learning SQL (properly).

We can easily enumerate dozens of other technologies that developers hard push on only to years later realize they’ve swung too far.

Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @11:45AM (#21621517)
You really don’t need to know transaction isolation to do the vast majority of work on a typical web app.
Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @11:59AM (#21621636)
It can seem that way, but the consequence of not knowing them is lots of subtle race conditions. Granted, most webapps probably don't have enough users to trigger them too often, and the impact is often limited e.g. because the kinds of inconsistencies you can introduce don't actually matter that much in many cases.

For the majority of webapps, I'm not sure the default isolation level of MySQL and Postgres is an appropriate tradeoff, since I'd rather have correctness by default than performance by default.

Re:Today’s Top Tech Skills by jackcodes on Sunday November 24, 2019 @12:13PM (#21621743)
The vast majority of work on web apps is probably writing CRUD controller methods, proxies to upstream services, or React components. It’s like saying CSS transitions are vital; they aren’t, but probably affect the user experience for the average Joe just as much if not more than a phantom read.

At that level of depth you just hand it over to the CSS champ or the DB champ.

Re:Today’s Top Tech Skills by vsareto on Sunday November 24, 2019 @12:20PM (#21621791)
>At that level of depth you just hand it over to the CSS champ or the DB champ.

Developers are blaming other developers for not knowing everything they do because businesses forced them to learn everything (Fullstack), but that's actually a bad arrangement and somehow the solution is to just punish the developers more rather than hiring DBAs.

Re:Today’s Top Tech Skills by vageli on Sunday November 24, 2019 @12:36PM (#21621907)
> >At that level of depth you just hand it over to the CSS champ or the DB champ.

> Developers are blaming other developers for not knowing everything they do because businesses forced them to learn everything (Fullstack), but that's actually a bad arrangement and somehow the solution is to just punish the developers more rather than hiring DBAs.

If the organization views developers as cogs or something like a software assembly line, the desire for interchangeable, unspecialized workers seems like a natural consequence.

Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @12:24PM (#21621825)
Sure, as long as the developer knows what they don't know. Race conditions usually don't fall into that category (and neither do potential UX improvements actually).
Re:Today’s Top Tech Skills by giornogiovanna on Sunday November 24, 2019 @11:58PM (#21625580)
The advice I've received is to just set the isolation level to serializable and stick with that until you get performance problems, which you likely won't. If you stick to that advice, I doubt you're going to get "lots of subtle race conditions".
Re:Today’s Top Tech Skills by mpartel on Monday November 25, 2019 @04:35AM (#21626646)
That is good advice that is unfortunately not widely followed in most of the apps I've seen. There's also the caveat that you should be prepared to retry transactions, but for small apps it's probably fine if you don't.
Re:Today’s Top Tech Skills by bradleyjg on Sunday November 24, 2019 @12:34PM (#21621892)
> Granted, most webapps probably don't have enough users to trigger them too often

It isn't purely a matter of number of users. You can have a billion users, but if your access pattern is embarrassingly isolated you are still probably okay. (And sharding is going to work great to boot.)

Re:Today’s Top Tech Skills by mpartel on Sunday November 24, 2019 @12:48PM (#21622000)
True, though even a single user triggering two actions quickly can cause issues if unlucky.
Re:Today’s Top Tech Skills by taffer on Sunday November 24, 2019 @11:55AM (#21621599)
I wouldn't say so. Concurrency bugs, like lost updates, can be very subtle and hard to debug, and common databases don't prevent these kinds of bugs by default.
Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @12:00PM (#21621641)
If someone on my team was writing a web app and spending time meddling around with transactions outside of whatever abstraction layer we were using on top of the DB without an incredibly good reason, we'd definitely be having a coaching moment, and if it continued, I'd likely help them find a role with another org where they might be a better fit.

Any quality database abstraction provides fairly simple means to perform transactions.

Re:Today’s Top Tech Skills by coldtea on Sunday November 24, 2019 @12:48PM (#21621998)
>If someone on my team was writing a web app and spending time meddling around with transactions outside of whatever abstraction layer we were using on top of the DB without an incredibly good reason, we'd definitely be having a coaching moment, and if it continued, I'd likely help them find a role with another org where they might be a better fit.

And most people with knowledge of DBs should run, not walk, away from a team that operates like that...

Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @01:26PM (#21622259)
Because if you are writing a fairly standard web app, you don't need this. There isn't the scale to make it important. Software is a very large field, with a wide variety of use cases. Obviously an exchange trading platform is going to have much more focus on these DB issues than a SaaS web app for business that expects at most 5,000-10,000 users at a time. With very few of those user modifying the same records.
Re:Today’s Top Tech Skills by coldtea on Sunday November 24, 2019 @04:18PM (#21623491)
>Because if you are writing a fairly standard web app, you don't need this.

Does the app handle user accounts? Payments? Data editing? Multiple logins into the same account? Then it should handle races and transaction properly...

That said, it's true that they can be rare, and might be less worth it (engineering or time wise) than just letting it go.

For an app with like a few thousands users or internal use, the odds might be small.

But a fairly standard web app might serve 1M, or 10M or 100s of millions of people, and they deserve better.

Re:Today’s Top Tech Skills by momokoko on Sunday November 24, 2019 @06:02PM (#21624118)
> deserve better

So less features and slower performance to account for the hypothetical case where someone tries to edit their user account from 50 devices at once over and over again?

> But a fairly standard web app might serve 1M, or 10M or 100s of millions of people

You are talking about less than 0.5% of revenue generating SaaS apps.

Re:Today’s Top Tech Skills by vbezhenar on Sunday November 24, 2019 @12:14PM (#21621754)
Transactions are hard. You can't just abstract it. Those different isolation levels are there for a reason.
Re:Today’s Top Tech Skills by vsareto on Sunday November 24, 2019 @01:18PM (#21622212)
Just slap READ UNCOMMITTED on everything to get your speed back

/s

Re:Today’s Top Tech Skills by ownagefool on Sunday November 24, 2019 @12:16PM (#21621769)
I'd argue you should be aware of the transactions and isolations levels exist, like many things, but having to recite them in an interview situation is a different ballgame.

Otherwise, you end up in the situation where every second person has a different set of pet skills and you can't hire anyone because they need to know all the skills perfectly.

But it depends on what you're doing and your market. I've worked with people who took a pay cuts to go work for FAANG, after several interviews which they've studied for but I've decided it's not really needed when you're just writing a little in house CRUD webapp.

Re:Today’s Top Tech Skills by kevindong on Sunday November 24, 2019 @12:06PM (#21621687)
With SQL, I started out using an ORM at my first internship and I've been using an ORM ever since. Over time, I've grown to dislike ORMs for anything more than anything trivial (a simple select statement with a handful of 'WHERE' clauses, an insert, or a delete). Most ORMs try to generalize the behavior between various RDBMS (Postgres, MySQL, SQLite, Oracle, MS SQL, etc.) and end up being exceptionally leaky abstractions.

When combined with tools that create a schema from code (which are in of themselves quite leaky), the resulting schema is frequently atrocious and lacking in both safety and speed.

Re:Today’s Top Tech Skills by he0001 on Sunday November 24, 2019 @03:35PM (#21623177)
Could you describe what you mean by “leaky” in your experience?
Re:Today’s Top Tech Skills by kevindong on Sunday November 24, 2019 @08:43PM (#21624829)
For ORMs, the ORM is theoretically supposed to hide all details of the underlying RDBMS from the developer and only expose a set of common APIs. In actuality, you have to be acutely aware of the subtle differences between the various RDBMS and how they interact with the ORM. Generally the most frequently used functions are fine. But the less frequently used functions (which tend to be some of the most useful functions) may be dramatically different in behavior dependent upon the RDBMS [0].

For tools to generate a schema from code, the common data types are simple since the tooling is usually good enough to handle those common cases. But once you get into the non-trivial types (notably numerical types with custom scale and precision and timestamps), things go haywire very quickly. Another example is that all of the migration tools I've ever used have required the developer to define the model separately from the actual migration code which inevitably causes drift in the schema/migration code at some point.

Anyone that tries to define non-trivial relationships between tables/entities using non-SQL code is usually doomed to strange relationships in the RDBMS that'll make it arduous/near-impossible to ever use a different migration tool/ORM. I've seen some horrifying schema designs due to a near religious dependency on ORMs/automatic migration tools (foreign key references to the same table, join tables lacking foreign key constraints, columns intended to be foreign keys lacking a foreign key constraint, tables lacking in primary keys, etc.).

[0]: Notice how constraints are deferrable and adding comments onto columns are only available on certain RDBMS. https://sequelize.org/v5/manual/models-definition.html

Re:Today’s Top Tech Skills by kjerzyk on Sunday November 24, 2019 @01:20PM (#21622229)
What would you recommend to pass the level where you can use SQL to get the data you need and move on to a more advanced level? Any particular book/course?
Re:Today’s Top Tech Skills by Guest42 on Sunday November 24, 2019 @04:34PM (#21623590)
Itzik Ben Gan has excellent books and sql for smarties by celko is great as well.
Re:Today’s Top Tech Skills by jackschultz on Sunday November 24, 2019 @12:38PM (#21621919)
Tons of replies to your comment already, but for point #1, this was absolutely the case for me. ActiveRecord is incredibly, incredibly good for pretty much all basic use cases. However, it comes with drawbacks like you said. It took me too long to realize I was behind on knowing sql to get to the next level.

To the point where I'm working today to fix slowness in a client's app where it relies way too heavily on the ORM and plain ruby code instead of going more in depth with sql.

Knowing sql more in further depth is the number one skill I'd want to tell backend devs to learn.

Also, I'm mainly a python guy, and if we're talking about ORMs, I will say that SQLAlchemy doesn't live up to ActiveRecord, to the point where I built my own db connection code for queries in some of the other flask / general python apps I'm working on.

Re:Today’s Top Tech Skills by scarface74 on Sunday November 24, 2019 @03:11PM (#21622991)
There is nothing about Nosql databases that force you to have eventual consistency or lack Transactions. As far as forcing the correct schema, if you are using a statically typed language, it can enforce a “schema”. For instance with C#, LINQ and the standard Mongo driver, you work with strongly typed MongoCollection<T> and perform LINQ queries with IMongoQueryable<T>.

Amazon’s DynamoDB for instance supports transactions and optionally consistent reads. With Mongo you can set your WriteConcern to force strong consistency. Mongo also supports transactions.

Re:Today’s Top Tech Skills by naner on Sunday November 24, 2019 @12:30PM (#21621869)
A simpler explanation is that some people will just "learn" (via googling) the basic SQL they need to get something done. This is not uncommon across all domains in our industry.
Re:Today’s Top Tech Skills by MaxBarraclough on Sunday November 24, 2019 @12:44PM (#21621963)
> But if you ask them about other _still fundamental_ knowledge like a _rough_ idea about what the different transaction isolation level are/mean/imply for you, they fail hard.

More a property of concurrency than of SQL, I believe; your point applies for programming languages too.

It's possible to get by as a programmer with no real understanding of how concurrency works in the relevant languages.

If concurrency bugs were always obvious, doubtless things would be different.

Re:Today’s Top Tech Skills by jugg1es on Sunday November 24, 2019 @12:48PM (#21621996)
My company is in the midst of a modest hiring blitz and it is really eye-opening how few applicants are actually writing SQL in the coding exercise as opposed to using a highly-opinionated ORM. More damning - in my opinion - is that they mostly have blinders to how much time they are spending working around ORM limitations on a day-to-day basis.
Re:Today’s Top Tech Skills by lesservehicle on Sunday November 24, 2019 @01:31PM (#21622284)
Not everyone is a DBA?
Re:Today’s Top Tech Skills by marcosdumay on Sunday November 24, 2019 @02:08PM (#21622533)
You mean that only DBAs need to know SQL?
Re:Today’s Top Tech Skills by free652 on Sunday November 24, 2019 @01:00PM (#21622075)
That's because a different database may have different transaction isolation than an another one. Fairly complex SQL queries cannot be used between different major databases.

I am one of those who don't care about SQL, I assume it will fail and in general avoid transaction as much as possible.

Re:Today’s Top Tech Skills by Aperocky on Sunday November 24, 2019 @12:33PM (#21621881)
TBF, sql queries is something you _don't_ want to have in your code stack. It should be abstracted away in some kind of DAO, and no one should be worrying about SQL queries when they're developing new features.
Re:Today’s Top Tech Skills by NikolaNovak on Sunday November 24, 2019 @12:39PM (#21621929)
Fascinating statement which I feel is probably agreed upon by many. I can see how that can be true; but once again,I feel, demonstrates that HN has a specific subset of "developers"/"techies"/"enthusiasts".

In any "Enterprise" environment I've ever been in - core back-office enterprise resource planning apps or similar - SQL is right there front and center. "Should" it be? I don't know, I'm not a theoretician; but all developers around me for 20 years have had near-DBA level of SQL skills. Their core skills really are a) Understanding business requirements and b) Understanding SQL. For any complex business requirement, by time, we find in transactions code takes 1-10% and database activity takes 90%. So skillset in optimizing database performance of your code vastly outbenefits the skillset of optimizing your code. As much as possible, we push everything to database - queries, looping, even business logic if we can - because it's a robust, mature, optimized product and we don't have to invent optimizations from scratch...

Edit: If it may prove illuminating, even team leads & management on any of the 30+ projects I've been on, understands runstats, index reorg, transaction isolation, database maintenance basics, and a few basic optimizer dos and don'ts. They just wouldn't be able to survive without that knowledge - it's 90%+ of both good stuff we develop, and bad stuff that goes Bang in the night (e.g. a process which worked for 10 minutes for 2 years but suddenly decided to asymptotically explode and not finish before heat-death of the universe :P)

Re:Today’s Top Tech Skills by Aperocky on Sunday November 24, 2019 @01:10PM (#21622153)
I think the phenomenon you're describing is exactly what led to the rise of no-sql dbs.

SQL allow you to do too many things, a lot of things that could happen in programming. From a design point of view, that's not a good thing, you want a data store to do just what it is - a data store, all joining and such can happen somewhere else - just make sure it's in the same transaction.

I see many of the problem stem from a undesirable design of the tables - not splitting them when you can, having too many foreign keys, and generally being a interconnected mess. Having dealt with nosqls, I attest that it is much better in that it forces you to design things in an atomic way, preventing many of the potential problem you might have down the line from the beginning.

Re:Today’s Top Tech Skills by NikolaNovak on Sunday November 24, 2019 @03:10PM (#21622986)
>>From a design point of view, that's not a good thing, you want a data store to do just what it is - a data store, all joining and such can happen somewhere else - just make sure it's in the same transaction.

See, that's exactly why I indicated I'm not a theoretician and do not feel comfortable making such a sweeping "Should" statement (much as I would've made an opposite one:).

Immediately my question is "Why?" and "What data do you have to back it up?". I understand model-view-controller etc is a design pattern, but are we certain that it's always the right one?

From my trenches perspective: relational RDBMS has been around for neigh half a century. It's an INCREDIBLY mature, optimized, understood (by experts), common, standardized (for all the individual RDBMS differences), safe technology. I have team members who have been doing hard-core SQL for 20+ years, and a market full of similar, serious, hardened experts. And it'll survive changes in the higher-up stacks - in my own meager career of ~20 years, relational RDBMS has been the most stable part of the stack.

I can get a 3-5 year 'expert' on a particular programming stack, or a 20-year expert on SQL, who has seen things and will safeguard customer's data and business priorities with their life. Again, a very personal experience, but the dozens of clients I've been with, have broadly similar priorities, objectives and concerns on database level; and occasionally vastly different ones on layers above. It's a brilliant unifying common denominator.

Without a fun discussion over a drink and whiteboard, and it could be my inability to see forest for the trees, but I'm just not convinced that "all joining and such should happen somewhere else" :-\

[note, I didn't downvote your comment - I don't necessarily share the same conclusions, but I think it contributes to discussion :-]

Re:Today’s Top Tech Skills by Aperocky on Monday November 25, 2019 @12:17PM (#21630311)
I think your point is perfectly valid, I put should when I might have said ‘I Believe should’. But nevertheless I stand by my own point and is not quite convinced, both of us bringing anecdotes from our own experience. It is always good to hear different opinions, though.
Re:Today’s Top Tech Skills by dagss on Sunday November 24, 2019 @12:52PM (#21622023)
I strongly disagree. For many backends/purposes, SQL is really the thing doing all the real work and the backend's just some fancy authentication and validation layer.

Stick close to the technology doing the heavy lifting.

If people abstract away SQL too much they just start reimplementing things in buggy underperforming code, using 1000 lines of Go or Java or whatever what should be done in 20 lines of SQL.

Also, don't get med started on people thinking they can abstract away tye database for testing. The automated test suite should always include the real database you are working against and all queries executed. I will never write a backend again without testing against the real database (whether sql or nosql).

Some people justify abstracting away the database saying "one needs to be able to switch to an arbitrary storage engine". Well..storing things is probably the main purpose of your backend. I sometimes turn that around and say, "I want to write things in SQL so that I can easily change what language the backend is written it".

Re:Today’s Top Tech Skills by xrisk on Sunday November 24, 2019 @01:01PM (#21622079)
Testing against the real database? Won't keeping a copy of the database just for that be expensive?

Also, should devs really be seeing potentially sensitive data?

On a side note, "I use SQL so I can change the backend language" is the hottest take I've heard in some time heh.

Re:Today’s Top Tech Skills by dagss on Sunday November 24, 2019 @01:06PM (#21622123)
With database I meant an instance of whatever database engine you are using, not the actual data.

My current project uses mssql. Each test run probably spins up and destroys 100 databases (inside one mssql docker container that is spun up for each test run). Each test function populates a DB from scratch (using the same sql migration scripts that we have used in prod), runs the test, drops the database.

Can do that quite some times in the minute it takes to run the full suite.

Point is to actually execute the SQL (or whatever NoSQL you use) as part of the test.

Re:Today’s Top Tech Skills by Aperocky on Sunday November 24, 2019 @01:05PM (#21622112)
And that's a problem - my opinion remain that individual sql queries are better left for analyst and data engineers to craft so they can discover whatever correlation they might be interested in. But for a full scale app it shouldn't be in the forefront, at least not in the same package as other logic.

The entire idea of programming is the one where you abstract away things and then abstract away the thing you're currently writing. I agree that it has gone too far in some of the places, but abstracting SQL away is the first and almost one of the best abstraction you can make.

Re:Today’s Top Tech Skills by dagss on Sunday November 24, 2019 @01:17PM (#21622208)
Analysts and data engineers these days mostly work on seperate data warehouses? Do they get involved in the OLTP work in your case?

I was talking about using SQL specifically for the OLTP workload not analysis. If a query that is necessary for a backend response in some REST API ends up taking 10 minutes, but could have taken 100ms if the backend developer just knew what they were really doing over in the SQL land....the backend developer will probably waste a lot of time doing silly things with the tools available to him/her (perhaps introduce redis to cache stuff there is no need for caching, build their own fragile homegrown index table or aggregation table manually using 100 to 1000 lines of backend code plus tests, and so on).

I mean, noone ships a totally broken application that noone can use because it is so slow then asks the SQL expert to optimize it onve it has shipped!! Instead any lack of knowledge of underlying database will just mean reinvention and needless and fragile cruft in the backend code.

Note: I am against abstracting away the specific database technology you sit on (whether some SQL or not). If you are on SQL, know about indexes and materialized views (and their limitations) and so on and use them to implement efficient API endpoints, let your model in SQL directly handle any questions about idempotency or races in your API, and so on.

If you are talking about just abstracting away the SQL syntax, not the DB technology as such... such abstractions I am "meh" about, not very against them but they are usually very leaky so... They don't seem to bring anything fundamental for or against just syntax candy (getting in the way in my case).

Re:Today’s Top Tech Skills by xrisk on Sunday November 24, 2019 @12:46PM (#21621982)
You can't optimize well enough if your abstraction layer is too far away from your application layer.
Re:Today’s Top Tech Skills by pmoriarty on Sunday November 24, 2019 @01:33PM (#21622298)
I really don't get all the hoopla about learning SQL. There's really not much to it. It can be learned in an afternoon. It's by far the easiest language I've ever learned.

To all the naysayers and downvoters: There's a difference between knowing SQL and being an SQL ninja or a master of database architecture. Those are three different things. The former, and what my original comment concerned, was just learning the language itself.

I concede that learning to be able to craft complicated, performant queries and design complex databases with any desired property you might dream of is not quick or easy, but I still maintain that learning the language itself (sans extensions) is.

Re:Today’s Top Tech Skills by AlphaSite on Sunday November 24, 2019 @01:39PM (#21622333)
Basic SQL sure, but the moment you start getting into complex operations, upserts, extensions, functions, custom aggregate operators, arrays, HStores, etc it gets complicated. At least for me.

I would not be able to do this super quickly: https://stackoverflow.com/a/42939280

Re:Today’s Top Tech Skills by vsareto on Sunday November 24, 2019 @01:38PM (#21622325)
The finer points probably require a bit more than that.

If you're already technically proficient in general programming (or Excel), you're likely to pick up SQL quickly.

There is immense, unwarranted filtering of people from jobs for relatively minor things.