Share
Embed
Staying Grounded in Large Software Systems
A guest lecture I prepared for University of Toronto on staying grounded while building large software systems.
Geoffrey Wiseman
February 28, 2013
Transcript
86 slides
-
WWW Thursday, 28 February, 13 I started my career roughly
at the same time as the Web started. I’ve spent most of that time building web applications in a variety of technologies. -
WEB + MOBILE Thursday, 28 February, 13 That means HTML,
CSS, Javascript. I’ve worked on lots of platforms, but my focus is on Java, Ruby, Android and iOS, Postgres and MySQL. -
ENTERPRISE Thursday, 28 February, 13 I’ve done a lot of
work with enterprises of different shapes and sizes. -
LARGE SOFTWARE SYSTEMS Thursday, 28 February, 13 Lots of moving
parts. Multiple client types. Servers working together. Networking and firewalls. Datastore replication and analytics. Cloud servers for spiky demand. External APIs and Integration. -
STAYING GROUNDED Thursday, 28 February, 13 I’d like to talk
about Staying Grounded in Large Software Systems. -
WHY IT’S HARD • Technical Complexity • Organizational Complexity •
Longevity Thursday, 28 February, 13 Notice two things here mention complexity. -
STRIVE FOR SIMPLICITY Not all complexity is necessary. Thursday, 28
February, 13 Large systems are often complex systems. Some of that may be necessary. Some of it is not. Make large systems as simple as possible. -
“Je n’ai fait celle-ci plus longue que parce que je
n’ai pas eu le loisir de la faire plus courte.” - Blaise Pascal Thursday, 28 February, 13 -
- Blaise Pascal I have made this longer than usual
because I have not had time to make it shorter.” Thursday, 28 February, 13 It’s easier to address a subject with a lot of words than a smaller number of better-chosen ones. It’s easier to address a business/user need with a larger, more complicated system than a simpler, better-designed one. -
SIMPLER IS more important for Large Software Systems Thursday, 28
February, 13 Large Software Systems usually solve larger, more complicated problems. They have intrinsic complexity. They may require more complicated solutions. This makes it even more important to simplify wherever possible. -
SIMPLER IS not easy Thursday, 28 February, 13 It’s hard
to make things simple. Making things easy is not making them simple. -
TECHNICAL COMPLEXITY Thursday, 28 February, 13 Very common in large
software. There are many legitimate reasons for that. -
SCALING Thursday, 28 February, 13 Most large software systems need
to scale. Small software systems that need to scale usually become large software systems. Scaling can introduce a lot of complexity: distributed computing, caching, robustness. -
CACHING Thursday, 28 February, 13 Caching is often necessary for
scale. Which layers are caching what? Cache invalidation. Caches might also be distributed. -
DISTRIBUTED COMPUTING Thursday, 28 February, 13 Distributed computing introduces lots
of complexity: - concurrency issues - communication between distributed elements - harder to monitor, to automate deployment -
THEN One CPU One Machine Thursday, 28 February, 13 Once,
we could program a single chain of execution that ran on a single cpu inside a single machine. -
NOW Multiple Threads in Multiple Processes in Multiple Virtual Servers
on Multiple, Hyperthreaded Cores in Multiple Machines on Multiple Networks in Parallel all Communicating Thursday, 28 February, 13 Now we have: - multiple threads - in multiple processes - in multiple virtual servers - running on multiple hyperthreaded cores - in multiple machines on - multiple networks - all communicating - all running in parallel -
CONCURRENCY Thursday, 28 February, 13 Race conditions. Locking; pessimistic and
optimistic; Deadlocks. Shared state contention; semaphores, monitors. -
COMMUNICATION Thursday, 28 February, 13 Between: threads, processes, machines, networks
Over: firewalls, protocols Using: actors, channels, messages, queues -
ROBUSTNESS Thursday, 28 February, 13 Systems get bigger, more complicated,
more distributed. More things that can fail. Need to make overall system reliable. Throttling; circuit breakers; chaos monkeys. -
BIG DATA Thursday, 28 February, 13 Vast quantities of data,
or when caches or databases are very widely spread. Keeping consistency across all instances and all datastores can be too much trouble. Non-traditional datastores; eventual consistency; map-reduce; hadoop. -
INTEGRATION Thursday, 28 February, 13 Integrating: - pre-existing systems -
external apis and services - core systems with client systems - different technologies - different communication apis - REST; WS-*; Messaging; Database; Exchanging Data Files over FTP. - shared models, anti-corruption layer -
MULTI-TENANCY Thursday, 28 February, 13 Before the web, multi-tenancy was
a rarity. Different customers = different installs. Rise of SaaS makes this a bigger deal. Not only is separation important, can be in contracts. -
MULTI-PLATFORM Thursday, 28 February, 13 Delivering your software to multiple
platforms: - Windows, Mac, Linux - Android, iOS - Web and Native - Multiple Target Browsers - Bleeding edge makes this worse (e.g. offline) -
“organizations which design systems ... are constrained to produce designs
which are copies of the communication structures of these organizations” Conway’s Law Thursday, 28 February, 13 The environment in which you build software has a big impact on the software you build. -
PROCESS Thursday, 28 February, 13 Decision-Making Approvals. (incl. Clients?) Yearly
reviews. Architecture review boards. -
DISTRIBUTED WORK Thursday, 28 February, 13 Can affect small companies
too, when distributed. Harder to do well, but can have benefits. cf. Yahoo, GitHub, Automatic -
TECHNICAL DEBT Thursday, 28 February, 13 Technical bankruptcy - when
a project is abandoned because it has accrued so much debt? -
LEGACY CODE Thursday, 28 February, 13 Technical debt you aren’t
responsible for. Strangler vines. Test then refactor. “Working effectively with legacy code.” -
DEPENDENCIES DON’T CHANGE Thursday, 28 February, 13 When you need
them to, of course. -
VERSIONING Thursday, 28 February, 13 Backward compatibility. Supporting older versions
deployed to customers. Supporting older customizations made by customers. API Versioning. -
RED FLAGS ⚑ Thursday, 28 February, 13 Things to watch
for. These don’t prove problems, they’re just cues; indicators. -
ARCHITECTURE ASTRONAUTS Thursday, 28 February, 13 Over-abstraction. Not directly connected
to what you’re trying to solve. Focused on the architecture instead of the problem. “Wouldn’t you want?” -
TECHNOPHILIA Thursday, 28 February, 13 New technology can be fun.
New development technology can be fun for developers. I’m not saying you can’t use node.js, but do you know why you’re using it? JWZ: “Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” Technophilia can help/hinder recruiting if you’re using a technology that people want to use, it will be easier to hire. If you’re using a technology people don’t want to use, it will be harder. -
MASSIVE FORMALITY Thursday, 28 February, 13 Architecture review boards. Architecture
frameworks. Governance. -
PROCESS FOR PROCESS’ SAKE Thursday, 28 February, 13 Process is
a means, not an end. What is the problem? How does this process solve it? Adopting a process wholesale. How people work is the implicit process; does it need to be explicit? -
VENDOR / ANALYST HYPE Thursday, 28 February, 13 Specialized version
of grandiose claims. Gartner mentions. Appeal to authority. -
PREDATORY VENDORS Thursday, 28 February, 13 No pricing model. “What
are you using for?” Percentage-based pricing. Limited documentation or extensive configurability - consulting fees. -
POOR COMMUNICATION Thursday, 28 February, 13 Can’t understand what they
do - vendor, consultant, coworker. If they can’t explain, that’s their fault, not yours. Are they unable, or unwilling to explain? Or maybe it’s really, really complex. Does it have to be? -
BUZZWORDS Thursday, 28 February, 13 Specialized version of poor communication.
These can sometimes be acronyms or references to complex technology names gone overboard: WS Splat. Other times, they’re increasingly vague and meaningless: Web 2.0, AJAX, Cloud. -
BEST PRACTICES Thursday, 28 February, 13 What problem is this
supposed to solve? Do we have that problem? Will this solve it? Everything is a tradeoff. Don’t just think about benefits, think about costs, downsides. Almost no guideline is true for all situations. “Wouldn’t you want” Reasonable-sounding bad idea. -
HYPER-CONFIGURABILITY Thursday, 28 February, 13 Use configuration to avoid decisions.
Have an opinion. The opposite of “one thing well” -
YAK-SHAVING Thursday, 28 February, 13 Very easy to get distracted
by yak shaving; this is one of the problems with adopting a new technology. -
OVER-DEPENDENT Thursday, 28 February, 13 Too many dependencies. Where to
draw the line? Do you know what the dependencies are? What they’re used for? Does your project depend on multiple versions of the same dependency? Due diligence. -
MORE TIME Thursday, 28 February, 13 We’ll go back to
that when we have more time. When we have a chance. Temporary measure. Make sure you can live with it. -
EXPLICIT DECISIONS Thursday, 28 February, 13 Product design is about
making tradeoffs, choices, elimination. Don’t “let things happen”. Make explicit choices. Slow down to hurry up. -
USE YOUR JUDGEMENT Thursday, 28 February, 13 Even simple is
a judgement call. Marco Arment, The Magazine, No Settings. -
FOCUS ON NOW Thursday, 28 February, 13 Current needs. What’s
the problem we need to solve right now. -
YAGNI Thursday, 28 February, 13 Unable to predict the future.
Even when flexibility is needed, the points of flex are unknown. Leather glove analogy. -
CONSIDER TRADEOFFS Thursday, 28 February, 13 Not just pros, also
cons. What is the impact of this choice to the project? What is the cost of it? -
DEFER COMMITMENT (a little) Thursday, 28 February, 13 Lean. Last
responsible moment. -
SIMPLE TECHNOLOGY Thursday, 28 February, 13 Choose the primary tools
in your toolbox carefully. Is this the right technology? What are its dependencies? Is it mature? Abandoned? What is its license? Why this? -
SMALL TEAMS Thursday, 28 February, 13 Choose your team carefully.
Prefer a small great team over dilution. This is hard. It’s easier if you only hire the people who you can’t afford not to hire. -
SUSTAINABLE PACE Thursday, 28 February, 13 Massive growth is a
problem everyone wants, but a sustainable pace will make it a lot easier to stay grounded. -
JUST ENOUGH Thursday, 28 February, 13 No more dependencies or
processes than you need. That’s your call. But think about it. -
0 - 1 - ∞ Thursday, 28 February, 13 Zero-One-Infinity
Rule Don’t bother with arbitary N values If you need more than one, support infinity. -
THERE IS NO MORE TIME Thursday, 28 February, 13 If
you can’t commit to getting back to it soon, you won’t come back to it later. -
Q&A Thursday, 28 February, 13 Have any of you been
involved in large software systems yet? What kind of projects and organizations are you interested in? -
SEE ALSO • Rich Hickey’s talks on simplicity: • Simplicity
Matters, Railsconf, 2012 or • Simple Made Easy, Strange Loop, 2011 Thursday, 28 February, 13 -
SEE ALSO • Architecture Astronauts: • Don’t Be Afraid of
Architecture Astronauts, Joel Spolsky • Architecture Astronauts Take Over, Joel Spolsky • It Came from Planet Architecture, Jeff Atwood Thursday, 28 February, 13 -
SEE ALSO • Defer Commitment, Kelly Waters • Last Responsible
Moment, Jeff Atwood • Last Responsible Moment Reconsidered, Alistair Cockburn Thursday, 28 February, 13 -
CC ATTRIBUTION • samurai by Gustavo Peres • electronic brain
by Aranya Sen • data centre photo by Steven Kreuzer • complexity by Domenica Nardone • watch movement photo by Guy Sie • silver bullet by Ed Schipul Thursday, 28 February, 13