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. “[Enterprise software…] is computer software used to satisfy the needs

    of an organization rather than individual users.” WIKIPEDIA
  2. “[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
  3. “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
  4. 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
  5. JOHN CORRY [You know it’s enterprise if] we spend more

    time in meetings than we do building things. @JPCORRY
  6. 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
  7. • What is enterprise? • Aside: Is Laravel enterprise-ready? •

    Key considerations for enterprise: • Code • Process • Summary Agenda
  8. 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
  9. 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
  10. The biggest threat to enterprise Laravel apps is leadership who

    thinks all enterprise apps need {{ BUZZWORD }} 
 without knowing why.
  11. 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
  12. 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
  13. 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)
  14. 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
  15. CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Lorem ipsum dolor

    sit amet, consectetur adipiscing Page Title
  16. 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
  17. 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
  18. CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Decide your conventions

    • Automate linting and fi xing • Document everything (especially startup) Set a standard
  19. 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
  20. CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Lorem ipsum dolor

    sit amet, consectetur adipiscing Page Title
  21. CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Run those tests

    often • Run those tests automatically Test more than just your code
  22. 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
  23. 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…
  24. 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
  25. 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
  26. 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
  27. 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
  28. The best practices for writing Laravel in the enterprise Are

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