Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Laravel in the Enterprise

Laravel in the Enterprise

"Laravel and the Enterprise" was a talk to convince folks that Laravel could hang in the enterprise space.

This talk, "Laravel *in* the Enterprise", is about *how to do that.* Code, process, communication, and organization tips from someone who's interacted with dozens of enterprise software projects using Laravel.

Matt Stauffer

July 19, 2023
Tweet

More Decks by Matt Stauffer

Other Decks in Technology

Transcript

  1. PRESENTED BY
    Matt Stauffer
    @stauffermatt
    IN THE
    LARAVEL

    View Slide

  2. Laravel and the Enterprise


    Laravel Live UK 2018

    View Slide

  3. Laravel in the Enterprise


    Laravel US 2023

    View Slide

  4. “Type a quote here.”

    View Slide

  5. Why this talk?

    View Slide

  6. View Slide

  7. View Slide

  8. en•ter•prise


    [en-tər-prīz ]

    noun
    🤷

    View Slide

  9. Started with Wikipedia…

    View Slide

  10. “[Enterprise software…] is computer
    software used to satisfy the needs of an
    organization rather than individual users.”
    WIKIPEDIA

    View Slide

  11. “[Enterprise software is…] a collection of
    computer programs with common business
    applications, tools for modeling how the entire
    organization works, and development tools for
    building applications unique to the organization”
    WIKIPEDIA

    View Slide

  12. “According to Martin Fowler, ‘[a]bout
    the display, manipulation, and storage of
    large amounts of often complex data
    and the support or automation of
    business processes with that data.’”
    WIKIPEDIA

    View Slide

  13. Then asked on Twitter…

    View Slide

  14. J.T. GRIMES
    I don't think you can find consensus on what
    "enterprise" means, which means your
    audience will spend an hour arguing "but
    that's not enterprise!" instead of learning.


    Here there be elephpant-shaped dragons.
    @JT_GRIMES

    View Slide

  15. JOHN CORRY
    [You know it’s enterprise if] we spend
    more time in meetings than we do
    building things.
    @JPCORRY

    View Slide

  16. MATT JOHNSON
    “Enterprise” is just code for “I have no idea
    what I’m doing on a project this big, please
    take this money and give me a 1-800
    number to call when $#!7 goes south”.
    @MATTJOHNSONSTL

    View Slide

  17. • What is enterprise?


    • Aside: Is Laravel enterprise-ready?


    • Key considerations for enterprise:


    • Code


    • Process


    • Summary
    Agenda

    View Slide

  18. What is enterprise,
    really?

    View Slide

  19. Factors in enterprise projects/teams
    Team size Customer
    base size
    Legal and
    compliance
    constraints
    Dev team size

    View Slide

  20. Factors in enterprise projects/teams
    Complication of
    operations /
    deployments
    Distance to
    other teams
    (legal, QA,
    product, etc.)
    Length of
    projects
    Pain if
    of
    fl
    ine

    View Slide

  21. Factors in enterprise projects/teams
    Legal and
    compliance
    constraints
    Customer
    base size
    Dev team size
    Team size
    LARGE LARGE LOTS
    LARGE

    View Slide

  22. Complication of
    operations /
    deployments
    Factors in enterprise projects/teams
    Length of
    projects
    Distance to other
    teams (legal, QA,
    product, etc.)
    Pain if
    of
    fl
    ine
    LOTS GREAT LOTS
    LONG

    View Slide

  23. Is Laravel enterprise-ready?
    1

    View Slide

  24. Yep.
    https://speakerdeck.com/mattstauffer/
    laravel-and-the-enterprise

    View Slide

  25. Moving on…

    View Slide

  26. Code considerations


    for the enterprise
    2

    View Slide

  27. PAUSE

    View Slide

  28. The biggest threat to
    enterprise Laravel apps is
    leadership who thinks all
    enterprise apps need
    {{ BUZZWORD }}

    without knowing why.

    View Slide

  29. RESUME

    View Slide

  30. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • You’ve probably heard me talk about YAGNI before:
    You Aren’t Gonna Need It


    • Enterprise means more need for structure…

    therefore more risk of over-engineering


    • Enterprise means more people who know what you
    “should” do but don’t actually know why.


    As always, don’t do anything unless it’s actually
    clear why you’re doing it.
    YAGNI

    View Slide

  31. ANTHONY CLARK
    “It’s a lot easier to make simple things
    complex than it is to make complex
    things simple."
    DEVELOPER AT TIGHTEN
    CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  32. IT’S


    KONSTANTIN


    AGAIN
    CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  33. https://www.youtube.com/watch?v=uQUxJObxTUs
    CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  34. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  35. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • YAGNI doesn’t mean “don’t plan”…


    • Rather, invest your time and e
    ff
    ort wisely.


    • Focus on e
    ff
    ort that keeps your developers
    productive and
    fl
    exible
    YAGNI (CONTINUED)

    View Slide

  36. KENT BECK
    “Software design is not about
    minimizing design complexity, but
    rather spending our complexity budget
    where it can do the most good.”
    CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  37. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Lorem ipsum dolor sit amet, consectetur adipiscing
    Page Title

    View Slide

  38. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    YAGNI: Scale edition
    • There’s no one magical tool for scaling!


    • Match the needs as they arise; extract DB, add caching, etc.


    • Use all the caches (CDN, Varnish/HTTP cache, database
    caches, etc.) and have smart caching/key/rotation
    strategies


    • Make it *very* easy to spin up a new instance of your app

    View Slide

  39. A few other tips…

    View Slide

  40. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Lean on Laravel’s established conventions


    • Bene
    fi
    t:


    • Requires less decisions


    • Plays nicer with future tools


    • Allows you to onboard new devs more easily


    • Requires less documentation
    Stick to conventions

    View Slide

  41. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View Slide

  42. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Decide your conventions


    • Automate linting and
    fi
    xing


    • Document everything (especially startup)
    Set a standard

    View Slide

  43. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Test that your code works


    • Test that your code works with the other systems it
    touches
    Test more than just your code

    View Slide

  44. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Lorem ipsum dolor sit amet, consectetur adipiscing
    Page Title

    View Slide

  45. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Run those tests often


    • Run those tests automatically
    Test more than just your code

    View Slide

  46. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Make the time between “I wrote the code” and “the
    code is in production” as short as possible


    • If possible, deploy on every push (CD)


    • The less frequently you ship code, the more
    traumatic it will be each time


    • https://charity.wtf/2018/08/19/shipping-software-
    should-not-be-scary/
    Deploy often

    View Slide

  47. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Bugs and performance issues aren’t bad; they’re signs
    from the app that we can now have a guided refactor


    • Plenty of tools to identify (debug bar, bug tracking
    services, etc.)


    • Plenty of solutions to consider (cache, queued jobs,
    microservices, etc.


    • “Fail fast,
    fi
    x fast”
    When things go wrong…

    View Slide

  48. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Build your own thin abstraction in front of any
    external services (*even if* they have an SDK)


    • Abstractions we own are:


    • easier to standardize


    • easier to test


    • easier to swap depending on the environment


    • easier to update to use a di
    ff
    erent backing service
    Working with external services

    View Slide

  49. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Build local seeders! Preferably in di
    ff
    erent states


    • “Take good care of your local seeds.”

    - Tony Messias


    • At very least, build a local database state and load
    that .SQL
    fi
    le in your seeders
    Local seeds

    View Slide

  50. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2
    • Microservices and APIs should meet real needs.


    • You build bad microservices if you don’t need
    them yet, bad APIs if you don’t need them yet.


    • https://m.signalvnoise.com/the-majestic-monolith-
    can-become-the-citadel/


    • API-
    fi
    rst is overrated 🔥
    Microservices and API-first

    View Slide

  51. Process considerations


    for the enterprise
    3

    View Slide

  52. View Slide

  53. PROCESS CONSIDERATIONS FOR THE ENTERPRISE
    3
    Why?
    • More developers; more new developers; more
    developers from other stacks; more junior developers


    How?
    • Conventions, documentation, IDE-friendliness


    • Bin scripts for setup; pre-packaged local dev
    environments


    • Good tests and seeds
    Make onboarding easy

    View Slide

  54. PROCESS CONSIDERATIONS FOR THE ENTERPRISE
    3
    Sprint cycles
    and lower-case
    “a” agile

    View Slide

  55. PROCESS CONSIDERATIONS FOR THE ENTERPRISE
    3
    Tech debt
    management
    strategy
    🎯

    View Slide

  56. PROCESS CONSIDERATIONS FOR THE ENTERPRISE
    3
    Hiring and
    contractors
    📃

    View Slide

  57. Conclusions

    View Slide

  58. Enterprise apps are just apps

    where everything that can be hard is hard.

    View Slide

  59. The best practices for writing
    Laravel in the enterprise


    Are the same as the best practices
    for writing Laravel anywhere else.

    View Slide

  60. Learn more
    enterpriselaravel.com
    Need help?
    tighten.com

    View Slide