10 ms·
I wrote the SQL query in 5 mins. Why does my engineer say it will take a month?
- deleted 10y ago[deleted]
- pascalxus 10y agoGreat Post! Most people understimate the depth of simple-looking tasks: it's not just managers that make this mistake. Even experienced engineers can end up not realizing all the complexity in the beginning.
- philfreo 10y agoNice. I wrote something similar [1] after noticing that it's easy for developers to make this mistake too (especially more junior developers) -- once your proof of concept works, you still are far from shipping. [1] http://philfreo.com/blog/the-last-20-before-shipping/ http://philfreo.com/blog/the-last-20-before-shipping/
- unethical_ban 10y agoOn the flip side, when something DOESN'T need HA, sub-millisecond query response time, or lynx and IE Edge compatability, people need to know when "good enough" is good enough. On my ops team, we've gotten some flak for not building robust enough of a request queue for some tasks. But it's been down several hours in the past year. The server almost never needs maintenance. None of the workload is real-time. App restarts are acceptable if memory leaks occur. If we did everything by the enterprise book, we'd still be 70% of the way to a deployed product, instead of 15 months into its completion.
- mistermann 10y agoExactly, this is the substantial other side of the argument that almost always seems to be left out of the discussion. "Good enough, done in a week" is a perfectly viable option that is rarely offered by timesheet-padding developers.
- mcbruiser3 10y agoseems often developers tend to over engineer or focus on edge cases that inflate costs, and not given enough attention to ROI
- dsp1234 10y agoConversation from two days ago: manager: Why did you allow this thing to happen. me: It was an edge case that I pointed out 7 months ago. I've put it on the backlog 3 times, and you've removed it each time citing that it's an edge case that would never happen, and other newer features needed to be implemented. manager: That's an engineer's response. Just fix it! me: welp, shrug
- majormajor 10y agoI've had luck redirecting this type of question into "why did the process let this happen" where it becomes less my fault vs your fault and more "i did what you said, you did what the business person told you to prioritize, something broke" from a blame-agnostic point of view. In certain cases I've also overridden the "ignore that for now" in favor of at least some minimal fix because part of my job is to give you what you don't know you need to ask for, not just exactly what you ask for. And there's the value add because compared to people who don't consider that part of their job, my stuff / my team's stuff works better out the door. Another similar question that I've noticed others not always asking are things like "how often would this be used again, is it just a temporary one-off" which, of course, has an answer that's subject to change, but at least guides the initial design. And when it changes it gets revisited.
- taneq 10y ago> In certain cases I've also overridden the "ignore that for now" in favor of at least some minimal fix because part of my job is to give you what you don't know you need to ask for, not just exactly what you ask for. This is a two-edged sword, though. I agree it's best practice from a technical point of view, but enabling wilful ignorance on the part of someone above you in the chain will eventually lead to a showdown when you really do need a week to fix it and it really is critical, and they tell you not to, and they'll stick to their guns because (as far as they know) they've been right every time.
- arethuza 10y agoI once had an infrastructure guy who worked in the same company quote me £70K for new hardware to host a single static HTML web page. £70K of new hardware! I stuck it on an existing server and nobody noticed though I might have got into trouble with the Change Prevention Board for not using the right form or something... Edit: He did have a carefully worked out explanation of where the money had to be spent.... which I ignored after hearing "£70K".
- mabbo 10y agoTsk, poor choice on your part. You should have started a side consultancy (get a spouse to own it maybe?) and say that you can do it for a mere £40K. Then dump the static file on S3, and let the interest from the £40K in your bank account pay for it.
- WrtCdEvrydy 10y agoOkay, that sounds pretty cool. S3 can host static HTML files?
- venning 10y agoYes. Works quite well and can handle quite a bit of load. Some native support within Route 53 helps make setting it up easy. http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHostin... http://docs.aws.amazon.com/AmazonS3/latest/user-guide/static-website-hosting.html http://docs.aws.amazon.com/AmazonS3/latest/user-guide/static...
- Luuseens 10y agoYes, I host my blog that way: - Generate static files using Pelican - Dump the files to S3 - Set up Route53 to point a domain at the bucket - Set up CloudFront (Amazon's CDN) to sit in front of the S3 bucket, since I found pure S3 to be too slow Works incredibly well.
- RonInDune 10y ago
- deleted 10y ago[deleted]
- kafkaesq 10y agoYeah, you have to read the piece as a kind of parable -- emphasizing the most extreme cases of what can go wrong when the manager says "I don't understand, we had this other guy who said it could be done in 10 minutes / 1 hour / 1 day" or whatever. (And who hasn't been through that drill, like, a thousand times?) But as you said, knowing how and and when to negotiate between said extremes is exactly where the "art" lies.
- ktRolster 10y agoBut it's been down several hours in the past year. So has AWS, so you can kind of feel good.
- mullen 10y agoThe good news is that you can blame someone else! PS> Joking, but not really.
- still_grokking 10y ago>The server almost never needs maintenance. None of the workload is real-time. App restarts are acceptable if memory leaks occur. Ah! Classic duct tape programming! Something like this is fine as long as the requirements don't change. But we all know that at a point the requirements will change. And then you have to tell your customer that the "little new requirement" can't be accomplished with a cheap little change but requires instead a complete rewrite that will cost even more then the previous system did. The only question is whether you are a honest company that told the customer before that that will most likely happen in the future or your planed for that inevitable outcome in the first place...
- taneq 10y agoThe "new little requirement" which you couldn't have anticipated is probably no easier accommodated by your Hadoop cluster with GPU processing stack than it would be by a PHP script on a VM.
- paulddraper 10y agoProbably harder, I dare say.
- blackoil 10y agoLot of times, it is easier to rebuild, then try to an anticipate scale and requirements years in advance. Also in most cases a well written simple solution is easy to refactor, then a complex over engineered architecture.
- technion 10y agoHow much is IE Edge hurting the build? I ask because, last project I was on, I "introduced" Edge compat by removing the section of JavaScript that sniffed the UA and kicked people out.
- jessaustin 10y agoI appreciate the sentiment, but without rigorous testing this exercise could be a shot in the dark...
- mancerayder 10y agoOn my ops team, we've gotten some flak for not building robust enough of a request queue for some tasks. But it's been down several hours in the past year. The server almost never needs maintenance. None of the workload is real-time. App restarts are acceptable if memory leaks occur. If we did everything by the enterprise book, we'd still be 70% of the way to a deployed product, instead of 15 months into its completion. Sure. Except if this Ops team is like most Ops teams, they'd prefer to do it the (cue dark, brooding orchestral dum-dum-dum musical interlude) 'enterprise' way rather than be woken up by PagerDuty in the middle of the night because a new release push lead to the CPU spiking. Sorry, but I've almost never seen situations where people have skimped on HA and someone else didn't get excoriated during an outage. Maybe other people's experiences are different, but as a DevOps guy, even in a relatively new environment, my priority is stability. Not faith-based-computing based on someone's positive seat-of-their-pants past experience.
- toomuchtodo 10y agoDevOps guy here! Completely agree. Reliable infrastructure at the cost of velocity isn't just good practice, it's self-preservation if you're ops.
- mancerayder 10y agoYeah. I think that's a huge part of the reason why the so-called 'full stack developers' will probably never obviate pure 'DevOps' roles. A lot of people can't wrap their heads around why setting up infrastructure takes so much time, and focus attention on speed of raw product (code) delivery.
- unethical_ban 10y agoAh, see, we're talking about different things. Our little request queue, though prod-necessary, only needs 98-99% uptime. Same with much of our automation. Once you ask the simple question "Does this cause an interruption to our core business, or to security?" and you can say "no", HA requirements go down, down, down.
- 10y ago
- alfalfasprout 10y agoOverengineering. It's either the young engineer that wants to use the latest trendy technology or the old "architect astronaut" that believes only "enterprise level architecture" can solve all your problems. Even when I worked in electronic trading and we were dealing with 10 million events/second on combined feeds, we kept our architecture simple. Why? Experienced engineers realized that the more moving parts, there's more things that can go wrong (and it makes it that much harder to pinpoint). Just time your queries, get a P95, and stream data to an analytics database if you don't want your prod to be exposed to added latency. No need to create some fancy distributed consistent system with caching layers and enormous test harnesses if the analytics workload might change next week. I'm a huge fan of just creating a separate analytics database you stream prod data to and letting those with SQL knowledge play around there. Surprisingly, they rarely break anything. And if they do, it's not going to take down everything else with it
- sofaofthedamned 10y agoHad a similar thing a while ago. Very complicated IPSEC tunnels, routers switches firewalls and whatnot between us and our customer. Customers techs were - not great - so needed to make sure port 443 worked through the tunnel. Our side mainly Linux, theirs was mainly Windows 10. Asked a programmer our side (.net) who said it'd take a couple of hours to write a simple webserver, package it up into an .msi and give it us. I got annoyed, did it in Golang in about 10 lines of code. I then realised i'd compiled a Linux executable on Linux, remembered it did cross-compiling, 10 seconds later I had a Windows .exe. All for a simple webserver that printed "cock", not useful but it proved the tunnels worked. Sometimes we overcomplicate the simplest shit. EDIT: As it wasn't clear (my fault) - we were trying to get to port 443 at their end - they were on Windows, we mainly Linux but the guys I asked were .net programmers..
- zeeveener 10y agoIt might also be possible that we don't know the simplest methods of doing something. I'm not sure if there is a simpler way to do it from the Windows side of things than what this person told you. I wouldn't know how to do it in Golang because I don't use it. I would default to my most comfortable language, which is almost guaranteed to not be the most efficient method to do anything.
- kogepathic 10y ago> Sometimes we overcomplicate the simplest shit. Indeed. Why not use nc and telnet on port 443 to test? Linux already has nc and Windows already has telnet.
- reddit_clone 10y agoIndeed writing a _webserver_ to test connectivity sounds a bit non-simple.
- sofaofthedamned 10y agoGood point, but the dudes at the other end had no idea. I had to give them an .exe, which was better than a .msi. Bear in mind the server was at the Windows end, so no good with telnet over that side...
- deleted 10y ago[deleted]
- Declanomous 10y ago> Nothing ever works as soon as an engineer writes code; it is an iterative process. One of my complaints about working in an environment where I am the only person who can program is that nobody else understands this. I've taken the time to explain this point to people, and they seem to grasp it fairly well, but once they see something that somewhat resembles the final product they get really impatient. The last 25% of functionality takes far more time than the first 75%, especially once you consider handling edge cases, etc.
- dasmoth 10y agoonce they see something that somewhat resembles the final product they get really impatient. (Especially for internal tool) Is it possible that what they've seen is, actually, good enough? Or at least, good enough to solve 90% of the problem while you fill in the missing piece that covers the rest.
- Declanomous 10y agoKind of. There are a few people who I don't mind using tools as soon as I have even a minimum functionality working. Then we have a few people who completely ignore any limitations I put of tools and use them in ways in which they are explicitly not working. Case-in-point: I created a process that automated a particular task. Said task bears a resemblance to another task, but there are a lot of edge cases in the other task. The manager who runs the second task got upset that I had automated one task but not the other, and complained in a senior staff meeting about this. I mentioned that the second process was much more complex, and a lot could go wrong if she tried using the new process for it. Anyways, I took a sick day yesterday, and she had sent an email to me CCing my boss, complaining about how the new process was broken. She had tried changing the settings to work with her process and broken both processes. She is fully convinced I am just keeping tools from her because I don't like her. The reason she doesn't have any tools is because I have to build the most robust tools possible or she'll break everything, and I can automate 10 other processes with that sort of time.
- monknomo 10y ago
- cnnsucks 10y agoBecause your "5 minutes" is pure bullshit and your engineer knows it. Your engineer knows that if she writes your "5 minute" query without careful analysis, peer review and documentation and the query ever produces a questionable result --- whether it was anticipated by your requirements or not --- it's your engineers ass; you'll throw your engineer under the bus _instantly_. Your engineer knows that if she writes your "5 minute" query and it produces any actual value you'll be back the next day with a "5 minute" enhancement. Anything you ask for that might matter the next day has to be built to be maintained by others because if she happens to take the day off when you show up and demand a revision to your "5 minute" wonder query and there is nothing for the other engineers to go on (revision controlled work, documentation, etc.) then that's her ass; she knows you won't stand up for her. Your engineer didn't just fall out of the boat and is in no hurry to obligate herself to take responsibility for your adhoc miracle queries and the questions that will emerge when you go waving the output under everyone's nose, and she knows that's exactly what you'll do with it. Your little query is your view of the world and that view is highly unlikely to survive the first bit of scrutiny that's applied by anyone other than yourself, much less the second.
- matthewmacleod 10y agoMaybe y'all want to read the article.
- hermitdev 10y agoI had a veteran DBA close to retirement (she was my cube-mate) warn me about this when I was an intern. I had a very simple request come in to update some data. Didn't even take 5 minutes. She told me: never do the simple tasks immediately. Sit on them for a bit. Business users don't understand complexity of different tasks and think they should all take the same amount of effort. So, if you do one thing in just a few minutes, they'll expect everything to take the same amount of time. In my experience, it's proved to be true.
- technofiend 10y agoI heard a story from an ex-wall-street engineer who related he was once asked to fix a message passing system so that it could now pass something like 10 x as many messages per second that before. He rewrote it and it now passed 1000 x messages / sec. He almost turned it in that way and then realized he was undercutting his future self. So he backed off the improvements to the required 10 x. Sure enough he got a big bonus and kudos for his work and a year later he was asked if he could pull another miracle out of his hat. Indeed he could. He sat on it for weeks, updated one line of code and then got another big bonus. LOL.
- coding123 10y agoYou definitely need to think through your requirements or you end up with this: Asked to get some kind of analytics query to someone, and they need it fast and want it in some kind of visualization tool. 1. You open Zeppelin, take a bunch of database tables and whip out a query that is basically what they want and export it to an Elasticsearch + kibana instance. Now comes the edge cases: Oh I forgot, it needs to be on the internet 2. Need to set up a public IP, DNS, Nginx server and a series of rules to make it read-only (and it's still dangerous mind you) Why isn't this password protected? 3. Add a nginx basic-auth with a single password It needs to be available to admins and sales managers only. 4. Set up ngx_http_auth_request_module to hit the our authentication server (the cookies should be present - OHH the DNS name doesn't match the cookies. Set up a /subpath on the existing application. It needs to work as an embedded view in the company's mobile app. 5. That uses tokens not cookies, so the auth-request module no longer works for this, need to come up with a SSO solution with a cookie and a place to store the cookie in a database. That requires a REST service on the existing app server, which will require a redeploy. I just added a product to our system and it's not in Kibana 6. Need to modify the spark code to use spark streaming The Spark server restarted and my new products aren't showing up! 7. Need to set up a service on the system to auto-start the spark job. It is feasibly an actual product feature at this point, but (1) was asked for, but they really wanted 1 - 7. I would argue that (1) would only take 25% the time 2-7 takes to do. Not every product change is like that, obviously, but sometimes people think all changes are just so simple. Often it's the history and unstated features that make a huge difference. Also this for fun: http://outofmymind.scanlen.com/wp-content/uploads/2011/04/What-the-Customer-Wanted.jpg http://outofmymind.scanlen.com/wp-content/uploads/2011/04/Wh...
- kwillets 10y agoBecause he's using Hadoop :P
- SQL2219 10y agoSELECT * FROM ObviousTable?
- kristianc 10y agoThis is a popular anti-pattern with a name - Yak Shaving: https://medium.com/@firehoseproject/a-guide-to-yak-shaving-your-code-d30f98dc759 https://medium.com/@firehoseproject/a-guide-to-yak-shaving-y...
- mikestew 10y agoYou are confused. This is a popular pattern that prevents shaving hairy bovids.
- viraptor 10y agoThat's not yak shaving. Yak shaving is trying to fix issue A and running into issue B. So you try to fix issue B and run into issue C, etc. This post is about engineering a future-proof solution rather than fixing bugs.
- AnonNo15 10y ago"Maybe you ran your SQL query a few times, fixed the errors you got, eyeballed the results, and called it a day. That’s not good enough for code integrated with a product." Biggest lie ever. That's pretty much a production-quality code here.
- bykovich2 10y agoYou ran it more than once? That's battle-hardened, in my book.
- bichiliad 10y agoThis is a little off-topic, but I'm not entirely sure I understand who this article was written for. It reads as a bit condescending to people who might benefit from it (namely the hypothetical MBA who wrote the query), and most of this is what engineers already know about.
- zitterbewegung 10y agoIf I was a CEO, and wanted to create a way for me to analyze data and I don't know much about efficiencies of SQL for ad-hoc analysis If instead I did have an issue where I did create this issue while doing my ad-hoc analysis I would try to search for solutions that would solve the problem. If this occurs then you probably want a data lake or even a local version/snapshot of production if possible.
- trhway 10y agoseems to be apples and oranges. Ad hoc query vs. a modification/new feature of a product. Depending on the product and dev process around it, it may take a month even for the minor among minor modifications/features. >Why does my engineer say it will take a month? if you don't know the answer to that, you're a bad manager. Either you hired bad engineers or you have no idea how your dev process works.
- kemiller2002 10y agoUnless I catch myself breaking my own rule, I never second guess my developer's time estimate unless I think it's too short. I've been a developer (still am one even though I manage people now too), and I've learned that I can't factor in all the things going through that person's mind. I have cleaned up too many messes because of negligence from people who do not understand how hard programming actually is. That's what most people, especially us developers at times, fail to recognize. That 5 minutes someone took to write an "easy" query against the CI and deployment server almost brought it down (true story, luckily I was monitoring it look at another issue). The ability to write code is taken for granted, because anyone can learn it. Some programming is easy, and some is extremely difficult and the real trick is knowing which. What scares me most about the code being written are the one off queries, etc. The ones that will "only be used once" or "only for low transaction instances". That's never true, someone will always have it laying around for that time when "we just really needed to make that update". An old boss of mine used to say "the perfect is the enemy of the good." This is true, there are a number of times you need get something up and running and worry about fixing it along the way. There are other times when that "good little app" got used in the wrong way and cost us hours of downtime because of a mistake due to rushing. Now the perfect solution doesn't look like it was such a bad choice after all. I can wait a day or so for a query that I could write in 5 minutes. In the long term, waiting a few extra hours isn't going to impact anything that much. I'd rather the developer be through then explain why no one went home that night because we had to clean up a mess.
- wcummings 10y agoUgh that domain. "my" engineer? Fuck off.
- paulddraper 10y ago"my" parents? "my" employer? "my" spouse? "my" country?
- Profragile 10y agoIf they have a ready made query that shows you exactly what is required and know exactly what they need to do with the result (in this case, send it out in an email)... and if it takes 1 month, they just need a better engineer.
- geori 10y agoAdam, great to see you on HN. I assume you're the same ABS that founded calc.org. I always love seeing people from the TI Calculator community doing well. - Harper