Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Re-Architecting Applications (Without a Rewrite!)
Search
Daniel Lew
February 10, 2018
Programming
8
2.7k
Re-Architecting Applications (Without a Rewrite!)
Talk given at DevFestMN 2018 & MinneBar 13.
Recording here:
https://youtu.be/dKm7MKoxVIg
Daniel Lew
February 10, 2018
Tweet
Share
More Decks by Daniel Lew
See All by Daniel Lew
Finding Meaningful, Mission-Driven Work
dlew
0
64
Things Maybe You Don't Know as a Newer Developer
dlew
1
92
Maintaining Software Correctness
dlew
4
840
Grokking Coroutines (MinneBar)
dlew
5
530
ClimateChangeTech.pdf
dlew
0
96
What Tech Can Do About Climate Change
dlew
0
510
Grokking Coroutines
dlew
5
1.1k
Automated Tests Aren't Enough
dlew
0
450
The Importance of Developer Communities
dlew
0
86
Other Decks in Programming
See All in Programming
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
2024 컴포즈 정원사
jisungbin
0
150
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
420
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
120
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
650
マルチモジュールにおけるテスト最適化
fxwx23
0
210
Why Prism?
kddnewton
4
1.7k
Kotlin 2.0が与えるAndroid開発の進化
masayukisuda
1
410
Developer Joy == Developer Productivity (really!)
hollycummins
1
220
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
250
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
580
Featured
See All Featured
KATA
mclloyd
27
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
24
610
A designer walks into a library…
pauljervisheath
201
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
48
2.8k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
Embracing the Ebb and Flow
colly
83
4.4k
A better future with KSS
kneath
235
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
What's new in Ruby 2.0
geeforr
340
31k
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Transcript
Re-architecting Applications (Without a Rewrite!) @danlew42
architecture: the structure and design of a system or product
None
None
None
None
None
“Model-View- Controller is the best thing since sliced bread.” ~Evil
Dan Lew
“OMG, I’m switching to MVC ASAP!” ~You Stability Some New
Architecture
Danger • Pure architectures require fresh code • Rewrites always
take longer than expected • Old code == battle tested • Expectations may not match reality
Goals • Introduce new architectures to existing codebase • Push
releases while re-architecting codebase
None
</Housing Metaphors>
Goal #1: Introduce new architectures to existing codebase
Re-Architecting Safely • Prevent overly ambitious rewrites • Prevent regrettable
architecture choices • Steps • Explore • Experiment • Expand • Embrace
Explore • What is the problem? • Define goals •
Define constraints • What are the solutions? • Brainstorm • Research
Experiment • Pick a project • Minimize work • Small
project • Simplified implementations • Minimize damage • Self-contained project • Unimportant project
Expand • Run more experiments • Pick projects wisely •
Use architecture in new ways • Pick hardest problems • Stretch architecture to limits
Embrace • Write all new code with new architecture •
Deprecate old architecture • Delete old code (optional)
Disclaimer Not an exact science
Goal #2: Push releases while re-architecting codebase
Can’t simultaneously use old and new architecture Can’t keep releasing
Old New Old + New
Parallel Development
Decouple Code BAD GOOD
Feature Flags
Shims
Shims
Offline Mode A parallel development success story
Online Only Offline Enabled
Decoupling Services Before After
Feature Flags
Shims Before After
Offline Mode • Project length: 1.5 years • Never stopped
releasing • Minimal UI changes • Gradual experimentation via flags • Switched over without anyone noticing • https://tech.trello.com/sync-architecture/
Failures With real life examples!
Explore Failures • Architecting with no purpose • Navi •
Choosing new and shiny without understanding • RxJava
Experiment Failures • Making the experiment too large • JavaScript:
The Good Parts • Not recognizing a failed experiment • Operations
Expand Failures • Choosing only easy problems • Identifiers •
Not recognizing a failed corner case • RxLifecycle
Embrace Failures • Continuing to expend effort on old architecture
• Fresh boards
Pet Peeve Telling everyone about an architecture before proving it
out!
Current Architecture Thoughts
Omni Models • Single model • Deserialized from JSON •
Written to ORM • Used by UI • Problems • Which fields are present? • How do we avoid mutability issues?
Domain-specific models • ApiModel • Only used when talking to
server • DbModel • Mutable, flexible • UiModel • Immutable, guarantees values • ApiModel <-> DbModel <-> UiModel
Unidirectional Architecture
Thanks for listening! @danlew42