<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ask-a-Tech-Lead on Locally Optimal</title><link>http://www.locallyoptimal.com/tags/ask-a-tech-lead/</link><description>Recent content in Ask-a-Tech-Lead on Locally Optimal</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>© Scott Triglia</copyright><lastBuildDate>Fri, 14 Dec 2018 01:08:01 +0000</lastBuildDate><atom:link href="http://www.locallyoptimal.com/tags/ask-a-tech-lead/index.xml" rel="self" type="application/rss+xml"/><item><title>Ask the Tech Lead: How should I approach simplifying a complex system?</title><link>http://www.locallyoptimal.com/ask-the-tech-lead-how-should-i-approach-simplifying-a-complex-system/</link><pubDate>Fri, 14 Dec 2018 01:08:01 +0000</pubDate><guid>http://www.locallyoptimal.com/ask-the-tech-lead-how-should-i-approach-simplifying-a-complex-system/</guid><description>&lt;p&gt;&lt;em&gt;I’m writing &lt;/em&gt;&lt;a href="http://www.locallyoptimal.com/ask-a-tech-lead-i-have-to-make-a-technical-decision-but-i-cant-know-the-right-answer/"&gt;&lt;em&gt;a series of these posts&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, discussing the unwritten advice for excelling in highly technical leadership and tackling some of the hardest questions I’ve faced in my time as a lead engineer for teams and groups at Yelp.&lt;/em&gt;&lt;/p&gt;&lt;h3 id="the-question-why-is-my-code-so-complex-how-can-i-fix-it"&gt;The question: Why is my code so complex? How can I fix it?&lt;/h3&gt;&lt;p&gt;&lt;em&gt;My team owns a pile of code that has a bit of a reputation for being extra confusing and hard to work with. We often experience our Product Managers rattling off “simple” feature changes that should be easy but we know would take months of effort to execute on. I want to simplify the system but it’s a mess and I’m not sure where to realistically start.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;How do I identify what parts of my system are essential complexity vs accidental complexity? And once identified, how do I remove accidental complexity?&lt;/em&gt;&lt;/p&gt;&lt;h3 id="the-solution-learn-more-gain-context-find-opportunity-then-execute"&gt;The solution: Learn more, gain context, find opportunity, then execute&lt;/h3&gt;&lt;p&gt;If there’s one lesson I’ve learned over and over again, it’s that complexity is the death of a software system.&lt;/p&gt;&lt;p&gt;Sometimes the complexity is hard to avoid (IAM permissions are horribly painful, but also extremely expressive and powerful!) but often the complexity is accidental, coming from the normal wear and tear of time, the organic evolution of requirements, and (most frequently) a lot of people making good local choices in one part of the system while failing to contain the whole of the complexity.&lt;/p&gt;&lt;p&gt;A large part of &lt;a href="http://www.locallyoptimal.com/ask-a-tech-lead-i-have-to-make-a-technical-decision-but-i-cant-know-the-right-answer/"&gt;my job as a technical lead&lt;/a&gt; is applying wise, targeted back-pressure to contain the increasing complexity of the software my group produces. By default, all systems tend toward a tangled mess of code that nobody understands.&lt;/p&gt;&lt;p&gt;I get excited when I see a project proposal where there’s a huge gap between the complexity to fully explain the feature (it might take an expert ~10 minutes to give you all the details) and the complexity of the underlying systems of code (I’ve seen cases where all the experts in a single room couldn’t collectively give a coherent explanation of the current implementation no matter how much time they had).&lt;/p&gt;&lt;p&gt;An engineering lead’s role is to ask (pointedly and repeatedly): “why can’t this software be as simple to own and operate as it is to explain?”.&lt;/p&gt;&lt;h4 id="learn-the-%E2%80%9Cwhy%E2%80%9D-behind-your-system%E2%80%99s-complexity"&gt;Learn the “why” behind your system’s complexity&lt;/h4&gt;&lt;p&gt;The answer is nearly always extremely interesting and informative — get curious! A few reasons for complexity I’ve heard before:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It integrates with $ANCIENT_SYSTEM and that system is very confusing and gnarled. &lt;em&gt;(How can we either not rely on that system, or simplify the interaction model between them? Lots of complexity comes from the naive or outdated integration seam between two systems. Does an interface need to be rewritten to hide its implementation details?)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;I don’t know why it’s so complex. &lt;em&gt;(Ah! Probably our complete lack of understanding is hiding some opportunities for simplifications. Dig deeper and ask “why” recursively until you get some hard lessons. Low hanging fruit often lives in the shadow of lack of knowledge)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;It is complex because this monolithic codebase is big and terrible. &lt;em&gt;(Now we’re getting down to brass tacks. What is keeping this feature in the monolith? Is there a game plan to move it out we can help execute on with this project? Is there &lt;/em&gt;&lt;a href="http://www.locallyoptimal.com/building-self-healing-observable-systems-with-aws-step-functions/"&gt;&lt;em&gt;a way we can partially migrate in the right direction and actually speed up the delivery of the product win we’re building toward&lt;/em&gt;&lt;/a&gt;&lt;em&gt;? Get curious!)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;My team’s part of it is simple, but $OTHER_TEAM’s half is a mess. &lt;em&gt;(Be very cautious here. Sometimes your team’s side is simple because you abandoned complexity to the other team’s half. Sometimes the interface between teams can be easily reworked to reduce complexity for both sides, if only you discussed it! Dig deep, learn more, stay curious, and fight cynicism.)&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4 id="why-curiosity-works"&gt;Why curiosity works&lt;/h4&gt;&lt;p&gt;You might be noting that “curiosity” is a key part of how I discover and dispel unnecessary complexity.&lt;/p&gt;&lt;p&gt;One non-technical reason I like is staying curious is it helps me avoid the danger of the &lt;a href="https://en.wikipedia.org/wiki/Fundamental_attribution_error" rel="nofollow noopener"&gt;Fundamental Attribution Error&lt;/a&gt;: if I purposefully react with curiosity when I don’t understand, I can counteract the normal human temptation to be “sure” they’re wrong (or worse, stupid!).&lt;/p&gt;&lt;figure class="kg-card kg-image-card kg-card-hascaption"&gt;&lt;img src="http://www.locallyoptimal.com/images/0-4h8hnvgf64t1okcr.jpg" class="kg-image" alt="" loading="lazy"&gt;&lt;figcaption&gt;&lt;span style="white-space: pre-wrap;"&gt;I try to avoid imitating Homer in my professional life&lt;/span&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Without some sort of active strategy to prevent it, it’s disturbingly easy for us all to fall prey to the idea that we’re the only ones who have thought through a problem “properly”. Reminding myself to stay curious forces me to actively engage with people who disagree with me, dig into why they feel that way, and very likely learn something important along the way.&lt;/p&gt;&lt;p&gt;It’s not just about what I’m learning though. Being authentically interested and open to someone else’s opinions makes the projects you’re a part of more welcoming and inclusive for everyone involved. &lt;a href="https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside" rel="nofollow noopener"&gt;In the most extreme cases&lt;/a&gt;, being closed off or hostile to dissenting views can completely warp the way people interact with you. Actively being curious instead of dismissive of other views does wonders for encouraging contribution from everyone involved in a project. Encourage participation!&lt;/p&gt;&lt;p&gt;Curiosity also helps me build a mental model of the “why” behind the systems we have. Telling the difference between “historical quirks” and “crucial design or product decisions” is incredibly important for navigating the complexity of large production systems and the only way to know which is which is by digging deep and asking questions when you start projects.&lt;/p&gt;&lt;h3 id="no-silver-bullet"&gt;No silver bullet&lt;/h3&gt;&lt;p&gt;There’s no single bit of advice for diagnosing and fixing unnecessary complexity in systems. But I believe very strongly that in nearly all cases, the best thing you can do to improve the state of your code is to stay curious and learn more.&lt;/p&gt;&lt;figure class="kg-card kg-embed-card"&gt;&lt;blockquote class="twitter-tweet"&gt;&lt;a href="https://twitter.com/scott_triglia/status/1017453906207571968"&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;/figure&gt;&lt;p&gt;I’ve lost count of the number of times a deep dive into a system (and the people who use it!) has revealed opportunity for improvement. Applying this approach for the last couple years has produced multiple projects where we took years of accumulated complexity and reduced it to something much closer to what the feature actually required.&lt;/p&gt;&lt;p&gt;Engineering thrives when we can produce systems that are as close to their essential complexity as possible. Shine a light in the dark corners of your codebase and you’ll be amazed at the volume of easy-to-fix technical debt you find.&lt;/p&gt;&lt;p&gt;&lt;em&gt;If you found this interesting, follow Scott Triglia here or on Twitter (&lt;/em&gt;&lt;a href="https://twitter.com/scott_triglia" rel="nofollow noopener noopener"&gt;https://twitter.com/scott_triglia&lt;/a&gt;&lt;em&gt;)&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Ask a Tech Lead: I have to make a technical decision but I can’t know the right answer</title><link>http://www.locallyoptimal.com/ask-a-tech-lead-i-have-to-make-a-technical-decision-but-i-cant-know-the-right-answer/</link><pubDate>Mon, 26 Nov 2018 22:31:48 +0000</pubDate><guid>http://www.locallyoptimal.com/ask-a-tech-lead-i-have-to-make-a-technical-decision-but-i-cant-know-the-right-answer/</guid><description>&lt;h3 id="ask-the-tech-lead-i-have-to-make-a-technical-decision-but-i-can%E2%80%99t-know-the-right-answer"&gt;Ask the Tech Lead: I have to make a technical decision but I can’t know the right answer&lt;/h3&gt;&lt;p&gt;&lt;em&gt;I’m hoping to make this a series of posts, discussing the unwritten advice for excelling in highly technical leadership. &lt;/em&gt;&lt;a href="https://www.oreilly.com/tags/ask-the-cto" rel="noopener"&gt;&lt;em&gt;In the spirit of Camille Fournier’s excellent series&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, I’ll tackle some of the hardest questions I’ve heard from coworkers and mentees in my time as a lead engineer for teams and groups at Yelp. Huge credit to &lt;/em&gt;&lt;a href="https://medium.com/u/8d2bea2f61e6" rel="noopener"&gt;&lt;em&gt;Jonathan Maltz&lt;/em&gt;&lt;/a&gt;&lt;em&gt; for help refining this particular post and the overall format.&lt;/em&gt;&lt;/p&gt;&lt;h3 id="the-question-how-do-i-make-an-impossible-technical-decision-wisely"&gt;The question: How do I make an impossible technical decision wisely?&lt;/h3&gt;&lt;p&gt;&lt;em&gt;I’m struggling with making a choice about the technical direction of an upcoming project. This choice will involve significant expense: multiple engineer-months worth of work either way. I need to make a call, but I don’t feel like I have enough information to guarantee what the right direction is.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;What’s the right approach when I need to make a big bet but have little guarantee of the right call in the end?&lt;/em&gt;&lt;/p&gt;&lt;h3 id="the-solution-think-like-a-scientist"&gt;The Solution: Think like a scientist&lt;/h3&gt;&lt;p&gt;Major decisions aren’t easy. There are many reasons a technical choice might feel impossible:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The decision is often between the status quo and some option we have no or little experience in.&lt;/li&gt;&lt;li&gt;Sometimes the best and worst case outcomes are either unknown or have a scary amount of variance.&lt;/li&gt;&lt;li&gt;Sufficiently new or different ideas often imply unknown challenges lurking. What if those unknown challenges are really bad and make it unappealing in hindsight?&lt;/li&gt;&lt;li&gt;New ideas might imply major architecture changes that are outright dangerous. If we fail to control risk, it may not matter how good a choice we make.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The reality is you still have to make impossible decisions, even if the right choice can’t be known until later.&lt;/p&gt;&lt;p&gt;My advice is to work your decision like you would a scientific experiment: deeply invest in learning about the problem, build a hypothesis about the right call, &lt;strong&gt;and then, most importantly, propose a series of small, incremental experiments to build confidence that your choice is correct.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;As a whole, my approach to these big questions looks like:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Frame the big question and take an opinionated stance on the answer based on whatever data is currently available.&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Come up with an initial experiment to partially vet that stance.&lt;/strong&gt; It should be quick (~1 quarter) to accomplish, give meaningful directional feedback on whether the opinionated stance is still correct, and hopefully provide engineering leverage to test the next experiment more easily/quickly/safely.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Evaluate the experiment’s result.&lt;/strong&gt; Does it suggest our opinionated answer to the original big question was right? Wrong? Have you learned something that needs to alter your answer to the big question?&lt;/li&gt;&lt;li&gt;&lt;strong&gt;If needed, update our best current proposal from this feedback.&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Rinse and repeat&lt;/strong&gt; steps 2–4 until you’ve answered the big question empirically.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id="applying-this-to-a-concrete-problem"&gt;Applying this to a concrete problem&lt;/h3&gt;&lt;p&gt;In my own work, I’ve been digging into whether we should invest in using AWS Lambda more &lt;a href="http://www.locallyoptimal.com/building-self-healing-observable-systems-with-aws-step-functions/"&gt;within Step Functions&lt;/a&gt;. Unfortunately we don’t yet have much experience using Lambdas and this would imply a pretty big technical effort to make the switch. Is it worth it? This is a big, uncertain question, so let’s see the framework in action.&lt;/p&gt;&lt;h4 id="frame-the-big-question-take-a-stance"&gt;Frame the big question, take a stance&lt;/h4&gt;&lt;p&gt;We’ve been using an &lt;a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-tasks.html" rel="noopener"&gt;API-drive pull architecture&lt;/a&gt; up until now, but nearly all companies in the industry use Lambdas. Let’s pick the largest change for our framed question: “should we use Lambdas for all of our Step Functions tasks”?&lt;/p&gt;&lt;p&gt;After a little research and my anecdotal survey of industry, I’m sufficiently curious about the alleged development velocity and ease-of-use of Lambdas to take an opinionated stance: “we should use Lambdas by default with Step Functions, with the pull-based architecture only used as a fallback in rare cases”.&lt;/p&gt;&lt;h4 id="come-up-with-an-initial-experiment"&gt;Come up with an initial experiment&lt;/h4&gt;&lt;p&gt;Our initial experiment should have a few traits: it should be quite small, give us meaningful feedback, and be technically feasible. In particular, the size and scope of our experiments should start very small and grow larger as we gain confidence in our overall hypothesis.&lt;/p&gt;&lt;p&gt;So for our first experiment, I aimed small and replaced a trivial task with a Lambda: all it did was reformat some JSON and log the result. This is incredibly “boring” from a technical perspective, but still required making some important directional choices. Namely:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;How do we deploy and monitor lambdas?&lt;/li&gt;&lt;li&gt;Should we use any frameworks?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This line of thought led us to discover a few important hypotheses I wanted to prove/disprove with our first experiment:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.serverless.com" rel="noopener"&gt;Is the serverless framework&lt;/a&gt; a good tool to leverage to build Lambdas?&lt;/li&gt;&lt;li&gt;Can we build a CI/CD pipeline that feels like best-in-class service tooling that actually deploys Lambdas instead of our normal SOA setup?&lt;/li&gt;&lt;li&gt;&lt;a href="https://hackernoon.com/cold-starts-in-aws-lambda-f9e3432adbf0" rel="nofollow noopener"&gt;Are Lambdas performant in production&lt;/a&gt;?&lt;/li&gt;&lt;li&gt;In the end, will this change let us get a functional change through the coding lifecycle faster, without sacrificing safety or architectural sanity?&lt;/li&gt;&lt;/ul&gt;&lt;h4 id="evaluate-the-experiment%E2%80%99s-result"&gt;Evaluate the experiment’s result&lt;/h4&gt;&lt;p&gt;For my particular experiment, production experimentation suggests the answer to all of these questions is “yes, Lambdas seem to do as well or better than the status quo”.&lt;/p&gt;&lt;p&gt;Our hypotheses happened to mostly be answering yes/no questions, but this isn’t the only way to measure success. Depending on your particular experiment you may want to check business metrics or even squishier human ideas like “oncall happiness”. The important thing is that you have a clear idea of what you want to learn from your experiment and an clear sense of how you plan to measure that learning once the experiment is live.&lt;/p&gt;&lt;h4 id="update-our-overall-proposal-and-iterate"&gt;Update our overall proposal and iterate&lt;/h4&gt;&lt;p&gt;After our first Lambda experiment, the result reinforced the direction of the overall plan, and no major updates were required. Excitingly, we did learn enough to reprioritize the next steps: several problems we thought would require entire future experiments to vet were actually completely solved by &lt;a href="https://serverless.com/framework/docs/providers/aws/guide/plugins/" rel="noopener"&gt;Serverless framework plugins&lt;/a&gt;. This feedback made us more confident betting on the Serverless Framework as a technology and let us tweak our roadmap to actually be more aggressive on what we tried next.&lt;/p&gt;&lt;p&gt;This feedback loop (experiment, see results, modify hypothesis, experiment again) is crucial to noticing problems and course correcting. Make sure that even your big nebulous bets have a clear way to learn + iterate and you’re comfortable with the cost of the worst-case outcome. This helps protect your project from losing momentum halfway due to an unsuccessful experiment.&lt;/p&gt;&lt;h3 id="final-thoughts"&gt;Final thoughts&lt;/h3&gt;&lt;p&gt;As the problems get messier and more complex, it can help to centralize this process in a single long-running document. It’s a great scratch space for thinking through future experiments and making sure others can follow along with your thought process while you’re at it. My rough format:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;What’s the big idea? (&lt;em&gt;add historical context, frame the opportunity)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Who are the owners this project(s)? (&lt;em&gt;clear ownership helps avoid death by analysis and offers clear points of contact)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;What’s my best guess at the right answer? (&lt;em&gt;doesn’t have to be correct in hindsight, just has to be a useful, opinionated stance that implies action)&lt;/em&gt;&lt;/li&gt;&lt;li&gt;What experiments have we already done in this effort? What did we learn from them?&lt;/li&gt;&lt;li&gt;What is the next, most valuable experiment we should try?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The ability to take on a vague project of potentially massive scope without succumbing to a blind guesswork is quite challenging. But on the upside, it’s also a rare skill that you’ll use more and more as you become a more senior technical leader.&lt;/p&gt;&lt;p&gt;Luckily for all of us, the key isn’t to magically know the right answer up front. Instead you need to build deep context in the problem space — really live and breathe it — until an initial educated guess forms itself. Your first experiment should provide directional feedback and force you to take theoretical ideas and build them for real. Then each ensuing bet shapes your hypotheses about the overall question, and guides you down the rest of the decision tree for your project.&lt;/p&gt;</description></item></channel></rss>