Re-Architecting Applications (Without a Rewrite!)

D225ebf0faa666ac7655cc7e4689283c?s=47 Daniel Lew
February 10, 2018

Re-Architecting Applications (Without a Rewrite!)

Talk given at DevFestMN 2018 & MinneBar 13.

Recording here: https://youtu.be/dKm7MKoxVIg

D225ebf0faa666ac7655cc7e4689283c?s=128

Daniel Lew

February 10, 2018
Tweet

Transcript

  1. 3.
  2. 4.
  3. 5.
  4. 6.
  5. 7.
  6. 10.

    Danger • Pure architectures require fresh code • Rewrites always

    take longer than expected • Old code == battle tested • Expectations may not match reality
  7. 11.
  8. 12.
  9. 15.

    Re-Architecting Safely • Prevent overly ambitious rewrites • Prevent regrettable

    architecture choices • Steps • Explore • Experiment • Expand • Embrace
  10. 16.

    Explore • What is the problem? • Define goals •

    Define constraints • What are the solutions? • Brainstorm • Research
  11. 17.

    Experiment • Pick a project • Minimize work • Small

    project • Simplified implementations • Minimize damage • Self-contained project • Unimportant project
  12. 18.

    Expand • Run more experiments • Pick projects wisely •

    Use architecture in new ways • Pick hardest problems • Stretch architecture to limits
  13. 19.

    Embrace • Write all new code with new architecture •

    Deprecate old architecture • Delete old code (optional)
  14. 27.
  15. 28.
  16. 34.

    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/
  17. 36.

    Explore Failures • Architecting with no purpose • Navi •

    Choosing new and shiny without understanding • RxJava
  18. 37.

    Experiment Failures • Making the experiment too large • JavaScript:

    The Good Parts • Not recognizing a failed experiment • Operations
  19. 38.

    Expand Failures • Choosing only easy problems • Identifiers •

    Not recognizing a failed corner case • RxLifecycle
  20. 42.

    Omni Models • Single model • Deserialized from JSON •

    Written to ORM • Used by UI • Problems • Which fields are present? • How do we avoid mutability issues?
  21. 43.

    Domain-specific models • ApiModel • Only used when talking to

    server • DbModel • Mutable, flexible • UiModel • Immutable, guarantees values • ApiModel <-> DbModel <-> UiModel