![Page 1: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/1.jpg)
Do Cheaters Prosper?UNDERSTANDING THE RULES
OF APPLICATION DEVELOPMENT
Scott Tadman (Chief of Research) / Dom Bortolussi (CEO), TWG @tadmanter @dombort @twg
![Page 2: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/2.jpg)
“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.
![Page 3: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/3.jpg)
“The Rules”
• These arbitrary rules put you in a box.
• They limit your thinking.
![Page 4: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/4.jpg)
“The Box”
![Page 5: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/5.jpg)
“Cheating”
• Defies convention.
• Thinks “outside the box”.
• Breaks “rules”.
• Yields an “unfair” advantage.
![Page 6: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/6.jpg)
Cheating?
• Isn’t cheating bad?
![Page 7: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/7.jpg)
Bad Cheating
• Breaks laws.
• Puts people at risk.
• Has severe negative consequences.
![Page 8: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/8.jpg)
Good Cheating
• Often called “hacks” or “tricks”
• Circumvents ritual or tradition.
• Cutting corners.
![Page 9: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/9.jpg)
Good Cheating
![Page 10: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/10.jpg)
Good Cheating
![Page 11: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/11.jpg)
Bad Cheating
![Page 12: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/12.jpg)
Bad Cheating
• We usually call it “illegal”.
• Like get you into jail illegal.
![Page 13: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/13.jpg)
So what are the rules?
![Page 14: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/14.jpg)
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.
![Page 15: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/15.jpg)
Important Rule
• Don’t kill me.
![Page 16: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/16.jpg)
Asimov’s Law
• “A robot may not harm a human being.”
![Page 17: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/17.jpg)
Developer’s Law?
• “An application may not harm a human being.”
![Page 18: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/18.jpg)
“Fatal Error?”
![Page 19: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/19.jpg)
Nuclear Reactor
![Page 20: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/20.jpg)
Nuclear Reactor
![Page 21: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/21.jpg)
Nuclear Reactor
![Page 22: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/22.jpg)
Doh
Nuclear Reactor
![Page 23: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/23.jpg)
Consequences?
![Page 24: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/24.jpg)
We all die.
![Page 25: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/25.jpg)
![Page 26: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/26.jpg)
X-Ray Machine
![Page 27: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/27.jpg)
X-Ray Machine
![Page 28: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/28.jpg)
X-Ray Machine
![Page 29: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/29.jpg)
X-Ray Machine
Yikes.
![Page 30: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/30.jpg)
Consequences?
![Page 31: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/31.jpg)
Someone dies.
![Page 32: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/32.jpg)
The ApplicationYou’re Building
![Page 33: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/33.jpg)
Most Applications
![Page 34: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/34.jpg)
Typical Application
Bah.
![Page 35: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/35.jpg)
Consequences?
![Page 36: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/36.jpg)
Nobody dies.
![Page 37: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/37.jpg)
Don’t worry so much.
![Page 38: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/38.jpg)
Most Applications
• Won’t kill people.
• Won’t misplace lots of money.
• Won’t destroy the universe.
• Have a lot of opportunities to “cheat”.
![Page 39: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/39.jpg)
“Cheating”
![Page 40: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/40.jpg)
It’s like a magic trick.
![Page 41: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/41.jpg)
Don’t get caught.
![Page 42: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/42.jpg)
It ruins it.
![Page 43: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/43.jpg)
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.
![Page 44: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/44.jpg)
Successful Cheating
• It’s all about not getting caught.
![Page 45: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/45.jpg)
A Magic Trick
• Rough definition:
• A method to achieve the desired effect.
![Page 46: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/46.jpg)
An Application
• Rough definition:
• A programmed method to achieve desired effects.
![Page 47: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/47.jpg)
Performance Cheats
![Page 48: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/48.jpg)
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.
![Page 49: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/49.jpg)
Applications Deconstructed
• Capture, retrieve and display resources.
• Resources have varying costs including:
• Cost of transmission.
• Cost of processing.
• Cost of storage.
![Page 50: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/50.jpg)
Application Fundamentals
• Resources may or may not be requested.
• Resources have varying probabilities of being required.
• Some requests are frequent.
• Some requests are rare.
![Page 51: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/51.jpg)
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
The BoxExpensive
Rare
Free
Frequent
Generalized solutions to generalized problems.
![Page 52: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/52.jpg)
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
Effortless
Expensive
Rare
Free
Frequent
These don’t require optimization.
![Page 53: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/53.jpg)
Cost to Deliver
Probability of Request
Low
High
Optimization Regions
Effortless Procrastinate
Expensive
Rare
Free
Frequent
These aren’t a priority.
![Page 54: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/54.jpg)
Cost to Deliver
Probability of Request
ExpensiveLow
Rare
High
Optimization Regions
Pleasure
Effortless Procrastinate
Free
Frequent
These are the ones we love to fix.
![Page 55: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/55.jpg)
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.
![Page 56: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/56.jpg)
Bandwidth
System Power
Low
High
Resources
Marginal
None
Unlimited
Unlimited
Personal Computer
MobileSingle Server
Server Cluster
![Page 57: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/57.jpg)
Fundamental Strategies
![Page 58: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/58.jpg)
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.
![Page 59: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/59.jpg)
“Cheater’s Bag of Tricks”
![Page 60: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/60.jpg)
Goals of “Cheating”
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent Identified ProblemExpensive and frequent.
![Page 61: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/61.jpg)
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization AMethod to reduce cost of delivery.
![Page 62: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/62.jpg)
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization BMethod to reduce frequency of requests.
![Page 63: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/63.jpg)
Cheating Goals
Cost to Deliver
Probability of Request
Low
High
Expensive
Rare
Free
Frequent
Optimization A + BCombination reduces cost and frequency.
![Page 64: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/64.jpg)
Real-World Examples
![Page 65: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/65.jpg)
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
ImplementedFetch from API on demandand reformat into widget.
![Page 66: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/66.jpg)
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
ImplementedFetch from API on demandand reformat into widget.
PopularityWidget used by largepercentage of users.
![Page 67: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/67.jpg)
Cost to Deliver
Probability of Request
Low
High
Weather Widget
Expensive
Rare
Free
Frequent
ImplementedFetch from API on demandand reformat into widget.
CachedWidget data cached andre-used for different users.
PopularityWidget used by largepercentage of users.
![Page 68: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/68.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
![Page 69: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/69.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
PopularityBlog becomes very populardue to publicity.
![Page 70: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/70.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
PopularityBlog becomes very populardue to publicity.
Content ShiftLarge, detailed charts nowa common feature on blog.
![Page 71: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/71.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
PopularityBlog becomes very populardue to publicity.
Content ShiftLarge, detailed charts nowa common feature on blog.
Solution 1Lazy-load images further down page.
![Page 72: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/72.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
PopularityBlog becomes very populardue to publicity.
Content ShiftLarge, detailed charts nowa common feature on blog.
Solution 2Host images on cloud.
Solution 1Lazy-load images further down page.
![Page 73: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/73.jpg)
Cost to Deliver
Probability of Request
Low
High
Financial Blog
Expensive
Rare
Free
Frequent
Stock SolutionImages are loaded on demandwithout any processing.
PopularityBlog becomes very populardue to publicity.
Content ShiftLarge, detailed charts nowa common feature on blog.
Solution 1Lazy-load images further down page.
Solution 2Host images on cloud.
Solution 3Create smaller inline images.
![Page 74: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/74.jpg)
Specific Strategies
![Page 75: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/75.jpg)
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.
![Page 76: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/76.jpg)
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.
![Page 77: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/77.jpg)
Cost to Deliver
Probability of Request
Low
High
Wait Less
Expensive
Rare
Free
Frequent
Client State Directly AlteredShow result of user action immediately, actually process in background.
![Page 78: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/78.jpg)
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.
![Page 79: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/79.jpg)
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.
![Page 80: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/80.jpg)
Cost to Deliver
Probability of Request
Low
High
Wait More
Expensive
Rare
Free
Frequent
“Your Book is Queued”Delayed gratification.
More ConsiderationPeople less likely to engagefeature needlessly.
![Page 81: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/81.jpg)
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.
![Page 82: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/82.jpg)
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.
![Page 83: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/83.jpg)
Load Less
• Fetching things on demand.
• “Lazy loading”
• Ideal for resources that might not be seen.
• Refrigerator light principle: Always seems on.
![Page 84: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/84.jpg)
Cost to Deliver
Probability of Request
Low
High
Load Less
Expensive
Rare
Free
Frequent
Target Zone
“Blog Page, Post N”Things that are requestedbut not always utilized.
![Page 85: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/85.jpg)
Cost to Deliver
Probability of Request
Low
High
Load Less
Expensive
Rare
Free
Frequent
Lazy LoadingPuts of loading a resourceuntil actually required.
![Page 86: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/86.jpg)
Load More
• Fetching resources ahead of time.
• “Eager loading”
• Ideal for resources that will probably be seen.
• Boy-scout principle: Be prepared.
![Page 87: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/87.jpg)
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.
![Page 88: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/88.jpg)
Cost to Deliver
Probability of Request
Low
High
Load More
Expensive
Rare
Free
Frequent
Asset BundlingCreate single asset that can be used to render all icons.
High Aggregate CostRequesting many tiny resourcescan be expensive.
Site IconsVery large number of small files.
![Page 89: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/89.jpg)
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.
![Page 90: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/90.jpg)
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.
![Page 91: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/91.jpg)
Cost to Deliver
Probability of Request
Low
High
Saving Less
Expensive
Rare
Free
Frequent
Reduce Size, CompressShrinking to sizes required by actual use cases, compressed to an acceptable level of quality.
![Page 92: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/92.jpg)
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.
![Page 93: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/93.jpg)
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.
![Page 94: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/94.jpg)
Cost to Deliver
Probability of Request
Low
High
Saving More
Expensive
Rare
Free
Frequent
Pre-RenderingReduces frequency of requestsrequiring heavy processing.
![Page 95: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/95.jpg)
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.
![Page 96: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/96.jpg)
Target Zone
Cost to Deliver
Probability of Request
Low
High
Cache More
Expensive
Rare
Free
Frequent
Target Zone
High Frequency + CostCache anything you can.
Target Zone
High FrequencyCache if you can.
High CostCache if likely to be used more than once.
![Page 97: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/97.jpg)
Cost to Deliver
Probability of Request
Low
High
Cache More
Expensive
Rare
Free
Frequent
“Friends of My Friends” Database QueryResult unlikely to change except in specific circumstances. Tricky to compute, easy to cache.
![Page 98: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/98.jpg)
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
![Page 99: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/99.jpg)
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.
![Page 100: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/100.jpg)
Cost to Deliver
Probability of Request
Low
High
Cache Less
Expensive
Rare
Free
Frequent
Target Zone
“Premature Optimization”Hiding real costs, creating hidden liabilities.
![Page 101: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/101.jpg)
Cost to Deliver
Probability of Request
Low
High
Cache Less
Expensive
Rare
Free
Frequent Original ImplementationExpensive and slow.
Caching OpportunityPotential performance gain.
Cached ResultQuick and easy fix.
Refactoring Without CacheSolves actual performance problem.
![Page 102: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/102.jpg)
Distribute More
• Content distribution networks.
• Clustered databases, data replication.
• Client-side storage, content bundles.
• Push data closer to users.
• “Edge caching”
![Page 103: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/103.jpg)
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.
![Page 104: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/104.jpg)
Cost to Deliver
Probability of Request
Low
High
Distribute More
Expensive
Rare
Free
Frequent
Server Hosted ResourceStored on server, transmissionimpedes other server operations.
CDN Hosted ResourceNo effort required to retainand deliver to client.
![Page 105: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/105.jpg)
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.
![Page 106: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/106.jpg)
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.
![Page 107: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/107.jpg)
Cost to Deliver
Probability of Request
Low
High
Distribute Less
Expensive
Rare
Free
Frequent
Remote Cloud ServiceTakes hundreds of API calls.
Local Data WarehouseTakes a few SQL queries.
![Page 108: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/108.jpg)
Purge More
• Delete data no longer used.
• Archive to cheaper storage systems.
• Generate on demand.
• Less data equals less overhead.
• Minimalist principle.
![Page 109: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/109.jpg)
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.
![Page 110: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/110.jpg)
Cost to Deliver
Probability of Request
Low
High
Purge More
Expensive
Rare
Free
Frequent
DeletedNobody will miss it.
![Page 111: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/111.jpg)
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.
![Page 112: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/112.jpg)
Cost to Deliver
Probability of Request
Low
High
Purge Less
Expensive
Rare
Free
FrequentSave Alternate FormatsAlso store as XML or JSON, exactly sent by API. High Aggregate Cost
Requests for unrelatedresources can add up.
“Movie Actors”Extensive library of movies, but queries aren’t predictable.
![Page 113: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/113.jpg)
Compress More
• Lossless or lossy compression.
• Use deflate (gzip) for transfers.
• Aggressively minify scripts.
![Page 114: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/114.jpg)
Target ZoneCost to Deliver
Probability of Request
Low
Compress More
Expensive
Rare
FreeAlmost AnythingMost resources benefit from some form of compression.
Frequent
![Page 115: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/115.jpg)
Cost to Deliver
Probability of Request
Low
Compress More
Expensive
Rare
Free
Frequent
Text ResourceSome things compress really well.
JPEG Image ResourceSome things can’t be compressed much more without damage.
![Page 116: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/116.jpg)
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.
![Page 117: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/117.jpg)
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 JSONSlightly higher write and retrieval cost.Query JSON in DB
Much lower query cost.
![Page 118: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/118.jpg)
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.
![Page 119: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/119.jpg)
Cost to Deliver
Probability of Request
Low
Index More
Expensive
Rare
Free
Frequent
“Message Board Table”Queried very frequently, indexing is vital.
Aggressive IndexingUse index to reduce read cost.
![Page 120: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/120.jpg)
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.
![Page 121: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/121.jpg)
Cost to Deliver
Probability of Request
Low
Index Less
Expensive
Rare
Free
Frequent
Aggressive IndexingWrites are significantly more expensive.
“User Activity Table”More writes than reads.
![Page 122: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/122.jpg)
Multitask More
• Do things in parallel.
• Break down dependencies, avoid contention.
• Distribute work across many systems.
• Map-reduce doesn’t have to be hard.
![Page 123: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/123.jpg)
Cost to Deliver
Probability of Request
Low
High
Multitask More
Expensive
Rare
Free
Frequent“Render Page”Smaller scale task is easy todelegate to many workers.
“Render Album Preview”Each page is an independent, but the final book needs to be one file.
Perceived ResultProcessing time massively reduced.
![Page 124: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/124.jpg)
Multitask Less
• Stream things in sequentially.
• Keep load on server light.
• Keeps more network resources available.
• Buffer requests and process casually.
![Page 125: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/125.jpg)
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 TasksCreate a simple work queue to minimize number of parallel operations.
![Page 126: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/126.jpg)
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.
![Page 127: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/127.jpg)
Cost to Deliver
Probability of Request
Low
High
Provision More
Expensive
Rare
Free
Frequent Relatively ExpensiveUses high percentage of CPU.
Relatively InexpensiveSame operation on distributed server cluster is no big deal.
![Page 128: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/128.jpg)
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.
![Page 129: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/129.jpg)
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 OperationsSplit up task into smaller, low-impact tasks.
![Page 130: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/130.jpg)
Breaking Rules
![Page 131: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/131.jpg)
“Cheating”
![Page 132: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/132.jpg)
Focus on the effects.
![Page 133: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/133.jpg)
Figure the rest out.
![Page 134: Do cheaters prosper? Understanding the rules of application development](https://reader034.vdocument.in/reader034/viewer/2022052618/554d67adb4c905f6388b5520/html5/thumbnails/134.jpg)
Scott Tadman
twg.ca @ceben @twg
THANK YOUScott Tadman / Dom Bortolussi
twg.ca@tadmanter @dombort @twggithub.com/[email protected]