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 full-size slide

  2. Laravel and the Enterprise


    Laravel Live UK 2018

    View full-size slide

  3. Laravel in the Enterprise


    Laravel US 2023

    View full-size slide

  4. “Type a quote here.”

    View full-size slide

  5. Why this talk?

    View full-size slide

  6. en•ter•prise


    [en-tər-prīz ]

    noun
    🤷

    View full-size slide

  7. Started with Wikipedia…

    View full-size slide

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

    View full-size slide

  9. “[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 full-size slide

  10. “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 full-size slide

  11. Then asked on Twitter…

    View full-size slide

  12. 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 full-size slide

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

    View full-size slide

  14. 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 full-size slide

  15. • What is enterprise?


    • Aside: Is Laravel enterprise-ready?


    • Key considerations for enterprise:


    • Code


    • Process


    • Summary
    Agenda

    View full-size slide

  16. What is enterprise,
    really?

    View full-size slide

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

    View full-size slide

  18. 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 full-size slide

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

    View full-size slide

  20. 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 full-size slide

  21. Is Laravel enterprise-ready?
    1

    View full-size slide

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

    View full-size slide

  23. Moving on…

    View full-size slide

  24. Code considerations


    for the enterprise
    2

    View full-size slide

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

    without knowing why.

    View full-size slide

  26. 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 full-size slide

  27. 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 full-size slide

  28. IT’S


    KONSTANTIN


    AGAIN
    CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View full-size slide

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

    View full-size slide

  30. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View full-size slide

  31. 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 full-size slide

  32. 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 full-size slide

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

    View full-size slide

  34. 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 full-size slide

  35. A few other tips…

    View full-size slide

  36. 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 full-size slide

  37. CODE CONSIDERATIONS FOR THE ENTERPRISE
    2

    View full-size slide

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


    • Automate linting and
    fi
    xing


    • Document everything (especially startup)
    Set a standard

    View full-size slide

  39. 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 full-size slide

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

    View full-size slide

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


    • Run those tests automatically
    Test more than just your code

    View full-size slide

  42. 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 full-size slide

  43. 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 full-size slide

  44. 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 full-size slide

  45. 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 full-size slide

  46. 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 full-size slide

  47. Process considerations


    for the enterprise
    3

    View full-size slide

  48. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  52. Enterprise apps are just apps

    where everything that can be hard is hard.

    View full-size slide

  53. The best practices for writing
    Laravel in the enterprise


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

    View full-size slide

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

    View full-size slide