Slide 1

Slide 1 text

PRESENTED BY Matt Stauffer @stauffermatt IN THE LARAVEL

Slide 2

Slide 2 text

Laravel and the Enterprise Laravel Live UK 2018

Slide 3

Slide 3 text

Laravel in the Enterprise Laravel US 2023

Slide 4

Slide 4 text

“Type a quote here.”

Slide 5

Slide 5 text

Why this talk?

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

en•ter•prise [en-tər-prīz ] 
 noun 🤷

Slide 9

Slide 9 text

Started with Wikipedia…

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

“[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

Slide 12

Slide 12 text

“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

Slide 13

Slide 13 text

Then asked on Twitter…

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

• What is enterprise? • Aside: Is Laravel enterprise-ready? • Key considerations for enterprise: • Code • Process • Summary Agenda

Slide 18

Slide 18 text

What is enterprise, really?

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Is Laravel enterprise-ready? 1

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

Moving on…

Slide 26

Slide 26 text

Code considerations for the enterprise 2

Slide 27

Slide 27 text

PAUSE

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

RESUME

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

IT’S KONSTANTIN AGAIN CODE CONSIDERATIONS FOR THE ENTERPRISE 2

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

CODE CONSIDERATIONS FOR THE ENTERPRISE 2

Slide 35

Slide 35 text

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)

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

A few other tips…

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

CODE CONSIDERATIONS FOR THE ENTERPRISE 2

Slide 42

Slide 42 text

CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Decide your conventions • Automate linting and fi xing • Document everything (especially startup) Set a standard

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

CODE CONSIDERATIONS FOR THE ENTERPRISE 2 • Run those tests often • Run those tests automatically Test more than just your code

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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…

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

Process considerations for the enterprise 3

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

PROCESS CONSIDERATIONS FOR THE ENTERPRISE 3 Tech debt management strategy 🎯

Slide 56

Slide 56 text

PROCESS CONSIDERATIONS FOR THE ENTERPRISE 3 Hiring and contractors 📃

Slide 57

Slide 57 text

Conclusions

Slide 58

Slide 58 text

Enterprise apps are just apps 
 where everything that can be hard is hard.

Slide 59

Slide 59 text

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

Slide 60

Slide 60 text

Learn more enterpriselaravel.com Need help? tighten.com