SlideShare une entreprise Scribd logo
1  sur  134
Télécharger pour lire hors ligne
Do Cheaters Prosper?
UNDERSTANDING THE RULES
OF APPLICATION DEVELOPMENT
Scott Tadman (Chief of Research) / Dom Bortolussi (CEO), TWG
@tadmanter @dombort @twg
“The Rules”
• These are taught to you in school.
• Based on conventions, shaped by tradition.
• Supposed to steer you towards best
practices.
• Usually distorted by superstition and
paranoia.
“The Rules”
• These arbitrary rules put you in a box.
• They limit your thinking.
“The Box”
“Cheating”
• Defies convention.
• Thinks “outside the box”.
• Breaks “rules”.
• Yields an “unfair” advantage.
Cheating?
• Isn’t cheating bad?
Bad Cheating
• Breaks laws.
• Puts people at risk.
• Has severe negative consequences.
Good Cheating
• Often called “hacks” or “tricks”
• Circumvents ritual or tradition.
• Cutting corners.
Good Cheating
Good Cheating
Bad Cheating
Bad Cheating
• We usually call it “illegal”.
• Like get you into jail illegal.
So what are the
rules?
The Application’s Rules
• Don’t crash on me.
• Don’t waste my time.
• Don’t lie to me.
• Don’t forget my things.
• Don’t cost me money/bandwidth.
Important Rule
• Don’t kill me.
Asimov’s Law
• “A robot may not harm a human being.”
Developer’s Law?
• “An application may not harm a human
being.”
“Fatal Error?”
Nuclear Reactor
Nuclear Reactor
Nuclear Reactor
Doh
Nuclear Reactor
Consequences?
We all die.
X-Ray Machine
X-Ray Machine
X-Ray Machine
X-Ray Machine
Yikes.
Consequences?
Someone dies.
The Application
You’re Building
Most Applications
Typical Application
Bah.
Consequences?
Nobody dies.
Don’t worry so
much.
Most Applications
• Won’t kill people.
• Won’t misplace lots of money.
• Won’t destroy the universe.
• Have a lot of opportunities to “cheat”.
“Cheating”
It’s like a magic
trick.
Don’t get caught.
It ruins it.
Successful Cheating
• Don’t let me catch you crashing on me.
• Don’t let me catch you wasting my time.
• Don’t let me catch you lying to me.
• Don’t let me catch you forgetting my things.
• Don’t let me catch you costing me money/
bandwidth.
Successful Cheating
• It’s all about not getting caught.
A Magic Trick
• Rough definition:
• A method to achieve the desired effect.
An Application
• Rough definition:
• A programmed method to achieve desired
effects.
Performance Cheats
Performance Cheats
• Doing the “wrong” thing.
• Getting “dirty”, introducing “hacks”.
• Optimized for very specific cases.
• Are focused on delivering the desired effects.
• It’s always about perception.
Applications
Deconstructed
• Capture, retrieve and display resources.
• Resources have varying costs including:
• Cost of transmission.
• Cost of processing.
• Cost of storage.
Application Fundamentals
• Resources may or may not be requested.
• Resources have varying probabilities of being
required.
• Some requests are frequent.
• Some requests are rare.
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
The Box
Expensive
Rare
Free
Frequent
Generalized solutions
to generalized
problems.
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
Effortless
Expensive
Rare
Free
Frequent
These don’t require optimization.
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
Effortless Procrastinate
Expensive
Rare
Free
Frequent
These aren’t a priority.
Cost to Deliver
Probability of Request
ExpensiveLow
Rare
High
Optimization Regions
Pleasure
Effortless Procrastinate
Free
Frequent
These are the ones we love to fix.
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
PainPleasure
Effortless Procrastinate
Expensive
Rare
Free
Frequent
Big wins...if you can figure out how.
Bandwidth
System Power
Low
High
Resources
Marginal
None
Unlimited
Unlimited
Personal Computer
Mobile
Single Server
Server Cluster
Fundamental
Strategies
Perception Matters
• Performance is all about perception.
• People are oblivious to your best.
• People will remember your worst.
• Outliers are what people perceive the most.
• Remember: If the application “feels” fast, it is
fast.
“Cheater’s Bag of
Tricks”
Goals of “Cheating”
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent Identified Problem
Expensive and frequent.
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization A
Method to reduce cost of delivery.
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization B
Method to reduce
frequency of
requests.
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization A + B
Combination reduces cost and frequency.
Real-World
Examples
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
Implemented
Fetch from API on demand
and reformat into widget.
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
Implemented
Fetch from API on demand
and reformat into widget.
Popularity
Widget used by large
percentage of users.
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
Implemented
Fetch from API on demand
and reformat into widget.
Cached
Widget data cached and
re-used for different users.
Popularity
Widget used by large
percentage of users.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Popularity
Blog becomes very popular
due to publicity.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Popularity
Blog becomes very popular
due to publicity.
Content Shift
Large, detailed charts now
a common feature on blog.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Popularity
Blog becomes very popular
due to publicity.
Content Shift
Large, detailed charts now
a common feature on blog.
Solution 1
Lazy-load images further down
page.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Popularity
Blog becomes very popular
due to publicity.
Content Shift
Large, detailed charts now
a common feature on blog.
Solution 2
Host images on cloud.
Solution 1
Lazy-load images further down
page.
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock Solution
Images are loaded on demand
without any processing.
Popularity
Blog becomes very popular
due to publicity.
Content Shift
Large, detailed charts now
a common feature on blog.
Solution 1
Lazy-load images further down
page.
Solution 2
Host images on cloud.
Solution 3
Create smaller inline images.
Specific Strategies
Wait Less
• Work to minimize perceived wait.
• Make things appear instantly.
• Don’t block, lock up, or stall.
• Flip client state immediately, handle in
background.
Cost to Deliver
Probability of Request
Low
High
Wait Less
Expensive
Rare
Free
Frequent
Target Zone
“Add User Comment”
Frequent operation but
requires some heavy
processing to apply correctly,
complicated by convoluted
business logic.
Cost to Deliver
Probability of Request
Low
High
Wait Less
Expensive
Rare
Free
Frequent
Client State Directly Altered
Show result of user action
immediately, actually process in
background.
Wait More
• Make things appear important.
• Keep user informed: spinners, progress bars.
• Keep delay proportional to significance.
• Can avoid really expensive requests by being
annoying.
Cost to Deliver
Probability of Request
Low
High
Wait More
Expensive
Rare
Free
Frequent
Target Zone
“Preview My Book”
Requesting too many
previews can cause severe
server load issues.
Cost to Deliver
Probability of Request
Low
High
Wait More
Expensive
Rare
Free
Frequent
“Your Book is Queued”
Delayed gratification.
More Consideration
People less likely to engage
feature needlessly.
Cost to Deliver
Probability of Request
Low
High
Wait More
Expensive
Rare
Free
Frequent
Target Zone
“Find Best Flight”
Might be trivial to
calculate, but perceived
value is very high.
Cost to Deliver
Probability of Request
Low
High
Wait More
Expensive
Rare
Free
Frequent
“Calculating Results...”
Artificial delay makes task
seem significant, system
more powerful.
Load Less
• Fetching things on demand.
• “Lazy loading”
• Ideal for resources that might not be seen.
• Refrigerator light principle: Always seems
on.
Cost to Deliver
Probability of Request
Low
High
Load Less
Expensive
Rare
Free
Frequent
Target Zone
“Blog Page, Post N”
Things that are requested
but not always utilized.
Cost to Deliver
Probability of Request
Low
High
Load Less
Expensive
Rare
Free
Frequent
Lazy Loading
Puts of loading a resource
until actually required.
Load More
• Fetching resources ahead of time.
• “Eager loading”
• Ideal for resources that will probably be seen.
• Boy-scout principle: Be prepared.
Cost to Deliver
Probability of Request
Low
High
Load More
Expensive
Rare
Free
Frequent
Target Zone “Site Icons”
Many, many requests
for tiny, inexpensive
resources can add up.
Cost to Deliver
Probability of Request
Low
High
Load More
Expensive
Rare
Free
Frequent
Asset Bundling
Create single asset that
can be used to render
all icons.
High Aggregate Cost
Requesting many tiny resources
can be expensive.
Site Icons
Very large number of small files.
Saving Less
• Trim, crop, shrink.
• Strip out redundant or duplicated content.
• Define and enforce limitations.
• One size fits all instead of uncertainty.
• Consider rendering on demand.
Cost to Deliver
Probability of Request
Low
High
Saving Less
Expensive
Rare
Free
Frequent
Target Zone
“Upload Photo”
Users upload full-sized
photos when only smaller
versions are ever actually
displayed.
Cost to Deliver
Probability of Request
Low
High
Saving Less
Expensive
Rare
Free
Frequent
Reduce Size, Compress
Shrinking to sizes required
by actual use cases,
compressed to an
acceptable level of quality.
Saving More
• Make copies of things in different formats.
• A form of “caching”, “pre-rendering”
• De-normalize your data.
• Optimize structure around retrieval patterns.
• Try and have everything important ready
instantly.
Cost to Deliver
Probability of Request
Low
High
Saving More
Expensive
Rare
Free
Frequent
Target Zone
“Image Variants by Size”
Images are used at various fixed
sizes, each needing some
processing to render.
Cost to Deliver
Probability of Request
Low
High
Saving More
Expensive
Rare
Free
Frequent
Pre-Rendering
Reduces frequency of requests
requiring heavy processing.
Cache More
• Fastest database call is the one never made.
• Pre-cache when you have the data on hand.
• Reuse and recycle expensive results.
• Let your client cache images, scripts, pages.
• Learn to love the “expires” feature.
Target
Zone
Cost to Deliver
Probability of Request
Low
High
Cache More
Expensive
Rare
Free
Frequent
Target Zone
High Frequency + Cost
Cache anything you can.
Target Zone
High Frequency
Cache if you can.
High Cost
Cache if likely to
be used more
than once.
Cost to Deliver
Probability of Request
Low
High
Cache More
Expensive
Rare
Free
Frequent
“Friends of My Friends” Database Query
Result unlikely to change except in specific
circumstances. Tricky to compute, easy to
cache.
Cost to Deliver
Probability of Request
Low
High
Cache More
Expensive
Rare
Free
Frequent
“Video Effects Preview”
Result of preview saved temporarily.
First Request
Second Request
Cache Less
• Tuning your database can make caching
redundant.
• Caches can make updates take longer.
• Cache invalidation can be really hard.
• Cache mistakes can be really embarrassing.
• Running without a cache leaves you with
headroom.
Cost to Deliver
Probability of Request
Low
High
Cache Less
Expensive
Rare
Free
Frequent
Target Zone
“Premature Optimization”
Hiding real costs, creating hidden
liabilities.
Cost to Deliver
Probability of Request
Low
High
Cache Less
Expensive
Rare
Free
Frequent Original Implementation
Expensive and slow.
Caching Opportunity
Potential performance
gain.
Cached Result
Quick and easy fix.
Refactoring Without Cache
Solves actual performance
problem.
Distribute More
• Content distribution networks.
• Clustered databases, data replication.
• Client-side storage, content bundles.
• Push data closer to users.
• “Edge caching”
Cost to Deliver
Probability of Request
Low
High
Distribute More
Expensive
Rare
Free
Frequent
Target
Zone
“Server-Side Content”
User provided content is stored
on your application servers,
storage and retrieval is getting
overwhelming.
Cost to Deliver
Probability of Request
Low
High
Distribute More
Expensive
Rare
Free
Frequent
Server Hosted Resource
Stored on server, transmission
impedes other server operations.
CDN Hosted Resource
No effort required to retain
and deliver to client.
Distribute Less
• Keep data and content local.
• Self-hosted databases instead of cloud-
hosted.
• “Dumb client, smart server” applications.
• Way more control over structure, strategy,
technology.
Cost to Deliver
Probability of Request
Low
High
Distribute Less
Expensive
Rare
Free
Frequent
Target
Zone
“Cloud Hosted Metrics Database”
Slow, unresponsive API, charged per
query.
Cost to Deliver
Probability of Request
Low
High
Distribute Less
Expensive
Rare
Free
Frequent
Remote Cloud Service
Takes hundreds of API calls.
Local Data Warehouse
Takes a few SQL queries.
Purge More
• Delete data no longer used.
• Archive to cheaper storage systems.
• Generate on demand.
• Less data equals less overhead.
• Minimalist principle.
Target
Zone
Cost to Deliver
Probability of Request
Low
High
Purge More
Expensive
Rare
Free
Frequent
“Outdated, Detailed User Metrics Data”
Expensive to retain, not likely to get used.
Cost to Deliver
Probability of Request
Low
High
Purge More
Expensive
Rare
Free
Frequent
Deleted
Nobody will miss it.
Purge Less
• Dump it on the cloud, forget about it.
• Keep things cached longer.
• Pre-render instead of render on demand.
• Long-tail: Sometimes unpopular things
matter.
Cost to Deliver
Probability of Request
Low
High
Purge Less
Expensive
Rare
Free
Frequent
Save Alternate Formats
Also store as XML or
JSON, exactly sent by API. High Aggregate Cost
Requests for unrelated
resources can add up.
“Movie Actors”
Extensive library of
movies, but queries aren’t
predictable.
Compress More
• Lossless or lossy compression.
• Use deflate (gzip) for transfers.
• Aggressively minify scripts.
Target ZoneCost to Deliver
Probability of Request
Low
Compress More
Expensive
Rare
Free
Almost Anything
Most resources benefit
from some form of
compression.
Frequent
Cost to Deliver
Probability of Request
Low
Compress More
Expensive
Rare
Free
Frequent
Text Resource
Some things compress really well.
JPEG Image Resource
Some things can’t be
compressed much more
without damage.
Compress Less
• Keep data in pure, raw form.
• Databases can’t interact with compressed
data.
• Serialized or compressed data can’t be
queried.
• Some databases love JSON or key-value
types.
Cost to Deliver
Probability of Request
Low
High
Compress Less
Expensive
Rare
Free
Frequent
“User Profile Data”
Hundreds of arbitrary fields, stored as JSON.
Store as Raw JSON
Slightly higher write and retrieval cost.Query JSON in DB
Much lower query cost.
Index More
• Every query has a cost.
• Examine access patterns, index accordingly.
• A query without an index: painful.
• A query with a tuned index: bliss.
• Indexes massively reduce retrieval time.
Cost to Deliver
Probability of Request
Low
Index More
Expensive
Rare
Free
Frequent
“Message Board Table”
Queried very frequently,
indexing is vital.
Aggressive Indexing
Use index to reduce read
cost.
Index Less
• Every index makes writes more expensive.
• Indexes don’t always get used.
• Some indexes you might want but not need.
• Awkward but fast can be better than easy
but slow.
Cost to Deliver
Probability of Request
Low
Index Less
Expensive
Rare
Free
Frequent
Aggressive Indexing
Writes are
significantly more
expensive.
“User Activity Table”
More writes than
reads.
Multitask More
• Do things in parallel.
• Break down dependencies, avoid contention.
• Distribute work across many systems.
• Map-reduce doesn’t have to be hard.
Cost to Deliver
Probability of Request
Low
High
Multitask More
Expensive
Rare
Free
Frequent“Render Page”
Smaller scale task is
easy to
delegate to many
workers.
“Render Album Preview”
Each page is an independent,
but the final book needs to be
one file.
Perceived Result
Processing time
massively reduced.
Multitask Less
• Stream things in sequentially.
• Keep load on server light.
• Keeps more network resources available.
• Buffer requests and process casually.
Cost to Deliver
Probability of Request
Low
High
Multitask Less
Expensive
Rare
Free
Frequent
“Sync Calendar Entries”
Operation that’s expected to
take considerable time can
be delayed.
Background Tasks
Create a simple work
queue to minimize
number of parallel
operations.
Provision More
• Server hardware can be scaled up.
• Desktop/mobile apps can leverage server
hardware.
• On-demand cloud services can be awesome.
• No inherent limit on server capability.
• If you can throw hardware at it, maybe do
that.
Cost to Deliver
Probability of Request
Low
High
Provision More
Expensive
Rare
Free
Frequent Relatively Expensive
Uses high percentage of CPU.
Relatively Inexpensive
Same operation on
distributed server cluster
is no big deal.
Provision Less
• Keep your application footprint lean.
• Don’t burn through CPU and battery.
• Don’t use tons of memory.
• Smaller apps load faster, don’t get kicked out
as often.
• Smaller server clusters easier to tune and
manage.
Cost to Deliver
Probability of Request
Low
High
Provision Less
Expensive
Rare
Free
Frequent
“Upload All Photos on Phone”
Interrupts application flow, stalls,
heavy CPU usage.
Batched Operations
Split up task into
smaller, low-impact
tasks.
Breaking Rules
“Cheating”
Focus on the
effects.
Figure the rest out.
Scott Tadman
twg.ca
@ceben @twg
THANK YOU
Scott Tadman / Dom Bortolussi
twg.ca
@tadmanter @dombort @twg
github.com/tadman
twg.ca
hello@twg.ca

Contenu connexe

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Do cheaters prosper? Understanding the rules of application development

  • 1. Do Cheaters Prosper? UNDERSTANDING THE RULES OF APPLICATION DEVELOPMENT Scott Tadman (Chief of Research) / Dom Bortolussi (CEO), TWG @tadmanter @dombort @twg
  • 2. “The Rules” • These are taught to you in school. • Based on conventions, shaped by tradition. • Supposed to steer you towards best practices. • Usually distorted by superstition and paranoia.
  • 3. “The Rules” • These arbitrary rules put you in a box. • They limit your thinking.
  • 5. “Cheating” • Defies convention. • Thinks “outside the box”. • Breaks “rules”. • Yields an “unfair” advantage.
  • 7. Bad Cheating • Breaks laws. • Puts people at risk. • Has severe negative consequences.
  • 8. Good Cheating • Often called “hacks” or “tricks” • Circumvents ritual or tradition. • Cutting corners.
  • 12. Bad Cheating • We usually call it “illegal”. • Like get you into jail illegal.
  • 13. So what are the rules?
  • 14. The Application’s Rules • Don’t crash on me. • Don’t waste my time. • Don’t lie to me. • Don’t forget my things. • Don’t cost me money/bandwidth.
  • 16. Asimov’s Law • “A robot may not harm a human being.”
  • 17. Developer’s Law? • “An application may not harm a human being.”
  • 25.
  • 38. Most Applications • Won’t kill people. • Won’t misplace lots of money. • Won’t destroy the universe. • Have a lot of opportunities to “cheat”.
  • 40. It’s like a magic trick.
  • 43. Successful Cheating • Don’t let me catch you crashing on me. • Don’t let me catch you wasting my time. • Don’t let me catch you lying to me. • Don’t let me catch you forgetting my things. • Don’t let me catch you costing me money/ bandwidth.
  • 44. Successful Cheating • It’s all about not getting caught.
  • 45. A Magic Trick • Rough definition: • A method to achieve the desired effect.
  • 46. An Application • Rough definition: • A programmed method to achieve desired effects.
  • 48. Performance Cheats • Doing the “wrong” thing. • Getting “dirty”, introducing “hacks”. • Optimized for very specific cases. • Are focused on delivering the desired effects. • It’s always about perception.
  • 49. Applications Deconstructed • Capture, retrieve and display resources. • Resources have varying costs including: • Cost of transmission. • Cost of processing. • Cost of storage.
  • 50. Application Fundamentals • Resources may or may not be requested. • Resources have varying probabilities of being required. • Some requests are frequent. • Some requests are rare.
  • 51. Cost to Deliver Probability of Request Low High Optimization Regions The Box Expensive Rare Free Frequent Generalized solutions to generalized problems.
  • 52. Cost to Deliver Probability of Request Low High Optimization Regions Effortless Expensive Rare Free Frequent These don’t require optimization.
  • 53. Cost to Deliver Probability of Request Low High Optimization Regions Effortless Procrastinate Expensive Rare Free Frequent These aren’t a priority.
  • 54. Cost to Deliver Probability of Request ExpensiveLow Rare High Optimization Regions Pleasure Effortless Procrastinate Free Frequent These are the ones we love to fix.
  • 55. Cost to Deliver Probability of Request Low High Optimization Regions PainPleasure Effortless Procrastinate Expensive Rare Free Frequent Big wins...if you can figure out how.
  • 58. Perception Matters • Performance is all about perception. • People are oblivious to your best. • People will remember your worst. • Outliers are what people perceive the most. • Remember: If the application “feels” fast, it is fast.
  • 60. Goals of “Cheating” Cost to Deliver Probability of Request Low High Expensive Rare Free Frequent Identified Problem Expensive and frequent.
  • 61. Cheating Goals Cost to Deliver Probability of Request Low High Expensive Rare Free Frequent Optimization A Method to reduce cost of delivery.
  • 62. Cheating Goals Cost to Deliver Probability of Request Low High Expensive Rare Free Frequent Optimization B Method to reduce frequency of requests.
  • 63. Cheating Goals Cost to Deliver Probability of Request Low High Expensive Rare Free Frequent Optimization A + B Combination reduces cost and frequency.
  • 65. Cost to Deliver Probability of Request Low High Weather Widget Expensive Rare Free Frequent Implemented Fetch from API on demand and reformat into widget.
  • 66. Cost to Deliver Probability of Request Low High Weather Widget Expensive Rare Free Frequent Implemented Fetch from API on demand and reformat into widget. Popularity Widget used by large percentage of users.
  • 67. Cost to Deliver Probability of Request Low High Weather Widget Expensive Rare Free Frequent Implemented Fetch from API on demand and reformat into widget. Cached Widget data cached and re-used for different users. Popularity Widget used by large percentage of users.
  • 68. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing.
  • 69. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing. Popularity Blog becomes very popular due to publicity.
  • 70. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing. Popularity Blog becomes very popular due to publicity. Content Shift Large, detailed charts now a common feature on blog.
  • 71. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing. Popularity Blog becomes very popular due to publicity. Content Shift Large, detailed charts now a common feature on blog. Solution 1 Lazy-load images further down page.
  • 72. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing. Popularity Blog becomes very popular due to publicity. Content Shift Large, detailed charts now a common feature on blog. Solution 2 Host images on cloud. Solution 1 Lazy-load images further down page.
  • 73. Cost to Deliver Probability of Request Low High Financial Blog Expensive Rare Free Frequent Stock Solution Images are loaded on demand without any processing. Popularity Blog becomes very popular due to publicity. Content Shift Large, detailed charts now a common feature on blog. Solution 1 Lazy-load images further down page. Solution 2 Host images on cloud. Solution 3 Create smaller inline images.
  • 75. Wait Less • Work to minimize perceived wait. • Make things appear instantly. • Don’t block, lock up, or stall. • Flip client state immediately, handle in background.
  • 76. Cost to Deliver Probability of Request Low High Wait Less Expensive Rare Free Frequent Target Zone “Add User Comment” Frequent operation but requires some heavy processing to apply correctly, complicated by convoluted business logic.
  • 77. Cost to Deliver Probability of Request Low High Wait Less Expensive Rare Free Frequent Client State Directly Altered Show result of user action immediately, actually process in background.
  • 78. Wait More • Make things appear important. • Keep user informed: spinners, progress bars. • Keep delay proportional to significance. • Can avoid really expensive requests by being annoying.
  • 79. Cost to Deliver Probability of Request Low High Wait More Expensive Rare Free Frequent Target Zone “Preview My Book” Requesting too many previews can cause severe server load issues.
  • 80. Cost to Deliver Probability of Request Low High Wait More Expensive Rare Free Frequent “Your Book is Queued” Delayed gratification. More Consideration People less likely to engage feature needlessly.
  • 81. Cost to Deliver Probability of Request Low High Wait More Expensive Rare Free Frequent Target Zone “Find Best Flight” Might be trivial to calculate, but perceived value is very high.
  • 82. Cost to Deliver Probability of Request Low High Wait More Expensive Rare Free Frequent “Calculating Results...” Artificial delay makes task seem significant, system more powerful.
  • 83. Load Less • Fetching things on demand. • “Lazy loading” • Ideal for resources that might not be seen. • Refrigerator light principle: Always seems on.
  • 84. Cost to Deliver Probability of Request Low High Load Less Expensive Rare Free Frequent Target Zone “Blog Page, Post N” Things that are requested but not always utilized.
  • 85. Cost to Deliver Probability of Request Low High Load Less Expensive Rare Free Frequent Lazy Loading Puts of loading a resource until actually required.
  • 86. Load More • Fetching resources ahead of time. • “Eager loading” • Ideal for resources that will probably be seen. • Boy-scout principle: Be prepared.
  • 87. Cost to Deliver Probability of Request Low High Load More Expensive Rare Free Frequent Target Zone “Site Icons” Many, many requests for tiny, inexpensive resources can add up.
  • 88. Cost to Deliver Probability of Request Low High Load More Expensive Rare Free Frequent Asset Bundling Create single asset that can be used to render all icons. High Aggregate Cost Requesting many tiny resources can be expensive. Site Icons Very large number of small files.
  • 89. Saving Less • Trim, crop, shrink. • Strip out redundant or duplicated content. • Define and enforce limitations. • One size fits all instead of uncertainty. • Consider rendering on demand.
  • 90. Cost to Deliver Probability of Request Low High Saving Less Expensive Rare Free Frequent Target Zone “Upload Photo” Users upload full-sized photos when only smaller versions are ever actually displayed.
  • 91. Cost to Deliver Probability of Request Low High Saving Less Expensive Rare Free Frequent Reduce Size, Compress Shrinking to sizes required by actual use cases, compressed to an acceptable level of quality.
  • 92. Saving More • Make copies of things in different formats. • A form of “caching”, “pre-rendering” • De-normalize your data. • Optimize structure around retrieval patterns. • Try and have everything important ready instantly.
  • 93. Cost to Deliver Probability of Request Low High Saving More Expensive Rare Free Frequent Target Zone “Image Variants by Size” Images are used at various fixed sizes, each needing some processing to render.
  • 94. Cost to Deliver Probability of Request Low High Saving More Expensive Rare Free Frequent Pre-Rendering Reduces frequency of requests requiring heavy processing.
  • 95. Cache More • Fastest database call is the one never made. • Pre-cache when you have the data on hand. • Reuse and recycle expensive results. • Let your client cache images, scripts, pages. • Learn to love the “expires” feature.
  • 96. Target Zone Cost to Deliver Probability of Request Low High Cache More Expensive Rare Free Frequent Target Zone High Frequency + Cost Cache anything you can. Target Zone High Frequency Cache if you can. High Cost Cache if likely to be used more than once.
  • 97. Cost to Deliver Probability of Request Low High Cache More Expensive Rare Free Frequent “Friends of My Friends” Database Query Result unlikely to change except in specific circumstances. Tricky to compute, easy to cache.
  • 98. Cost to Deliver Probability of Request Low High Cache More Expensive Rare Free Frequent “Video Effects Preview” Result of preview saved temporarily. First Request Second Request
  • 99. Cache Less • Tuning your database can make caching redundant. • Caches can make updates take longer. • Cache invalidation can be really hard. • Cache mistakes can be really embarrassing. • Running without a cache leaves you with headroom.
  • 100. Cost to Deliver Probability of Request Low High Cache Less Expensive Rare Free Frequent Target Zone “Premature Optimization” Hiding real costs, creating hidden liabilities.
  • 101. Cost to Deliver Probability of Request Low High Cache Less Expensive Rare Free Frequent Original Implementation Expensive and slow. Caching Opportunity Potential performance gain. Cached Result Quick and easy fix. Refactoring Without Cache Solves actual performance problem.
  • 102. Distribute More • Content distribution networks. • Clustered databases, data replication. • Client-side storage, content bundles. • Push data closer to users. • “Edge caching”
  • 103. Cost to Deliver Probability of Request Low High Distribute More Expensive Rare Free Frequent Target Zone “Server-Side Content” User provided content is stored on your application servers, storage and retrieval is getting overwhelming.
  • 104. Cost to Deliver Probability of Request Low High Distribute More Expensive Rare Free Frequent Server Hosted Resource Stored on server, transmission impedes other server operations. CDN Hosted Resource No effort required to retain and deliver to client.
  • 105. Distribute Less • Keep data and content local. • Self-hosted databases instead of cloud- hosted. • “Dumb client, smart server” applications. • Way more control over structure, strategy, technology.
  • 106. Cost to Deliver Probability of Request Low High Distribute Less Expensive Rare Free Frequent Target Zone “Cloud Hosted Metrics Database” Slow, unresponsive API, charged per query.
  • 107. Cost to Deliver Probability of Request Low High Distribute Less Expensive Rare Free Frequent Remote Cloud Service Takes hundreds of API calls. Local Data Warehouse Takes a few SQL queries.
  • 108. Purge More • Delete data no longer used. • Archive to cheaper storage systems. • Generate on demand. • Less data equals less overhead. • Minimalist principle.
  • 109. Target Zone Cost to Deliver Probability of Request Low High Purge More Expensive Rare Free Frequent “Outdated, Detailed User Metrics Data” Expensive to retain, not likely to get used.
  • 110. Cost to Deliver Probability of Request Low High Purge More Expensive Rare Free Frequent Deleted Nobody will miss it.
  • 111. Purge Less • Dump it on the cloud, forget about it. • Keep things cached longer. • Pre-render instead of render on demand. • Long-tail: Sometimes unpopular things matter.
  • 112. Cost to Deliver Probability of Request Low High Purge Less Expensive Rare Free Frequent Save Alternate Formats Also store as XML or JSON, exactly sent by API. High Aggregate Cost Requests for unrelated resources can add up. “Movie Actors” Extensive library of movies, but queries aren’t predictable.
  • 113. Compress More • Lossless or lossy compression. • Use deflate (gzip) for transfers. • Aggressively minify scripts.
  • 114. Target ZoneCost to Deliver Probability of Request Low Compress More Expensive Rare Free Almost Anything Most resources benefit from some form of compression. Frequent
  • 115. Cost to Deliver Probability of Request Low Compress More Expensive Rare Free Frequent Text Resource Some things compress really well. JPEG Image Resource Some things can’t be compressed much more without damage.
  • 116. Compress Less • Keep data in pure, raw form. • Databases can’t interact with compressed data. • Serialized or compressed data can’t be queried. • Some databases love JSON or key-value types.
  • 117. Cost to Deliver Probability of Request Low High Compress Less Expensive Rare Free Frequent “User Profile Data” Hundreds of arbitrary fields, stored as JSON. Store as Raw JSON Slightly higher write and retrieval cost.Query JSON in DB Much lower query cost.
  • 118. Index More • Every query has a cost. • Examine access patterns, index accordingly. • A query without an index: painful. • A query with a tuned index: bliss. • Indexes massively reduce retrieval time.
  • 119. Cost to Deliver Probability of Request Low Index More Expensive Rare Free Frequent “Message Board Table” Queried very frequently, indexing is vital. Aggressive Indexing Use index to reduce read cost.
  • 120. Index Less • Every index makes writes more expensive. • Indexes don’t always get used. • Some indexes you might want but not need. • Awkward but fast can be better than easy but slow.
  • 121. Cost to Deliver Probability of Request Low Index Less Expensive Rare Free Frequent Aggressive Indexing Writes are significantly more expensive. “User Activity Table” More writes than reads.
  • 122. Multitask More • Do things in parallel. • Break down dependencies, avoid contention. • Distribute work across many systems. • Map-reduce doesn’t have to be hard.
  • 123. Cost to Deliver Probability of Request Low High Multitask More Expensive Rare Free Frequent“Render Page” Smaller scale task is easy to delegate to many workers. “Render Album Preview” Each page is an independent, but the final book needs to be one file. Perceived Result Processing time massively reduced.
  • 124. Multitask Less • Stream things in sequentially. • Keep load on server light. • Keeps more network resources available. • Buffer requests and process casually.
  • 125. Cost to Deliver Probability of Request Low High Multitask Less Expensive Rare Free Frequent “Sync Calendar Entries” Operation that’s expected to take considerable time can be delayed. Background Tasks Create a simple work queue to minimize number of parallel operations.
  • 126. Provision More • Server hardware can be scaled up. • Desktop/mobile apps can leverage server hardware. • On-demand cloud services can be awesome. • No inherent limit on server capability. • If you can throw hardware at it, maybe do that.
  • 127. Cost to Deliver Probability of Request Low High Provision More Expensive Rare Free Frequent Relatively Expensive Uses high percentage of CPU. Relatively Inexpensive Same operation on distributed server cluster is no big deal.
  • 128. Provision Less • Keep your application footprint lean. • Don’t burn through CPU and battery. • Don’t use tons of memory. • Smaller apps load faster, don’t get kicked out as often. • Smaller server clusters easier to tune and manage.
  • 129. Cost to Deliver Probability of Request Low High Provision Less Expensive Rare Free Frequent “Upload All Photos on Phone” Interrupts application flow, stalls, heavy CPU usage. Batched Operations Split up task into smaller, low-impact tasks.
  • 134. Scott Tadman twg.ca @ceben @twg THANK YOU Scott Tadman / Dom Bortolussi twg.ca @tadmanter @dombort @twg github.com/tadman twg.ca hello@twg.ca