Laravel in the Enterprise
Extracto
"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.
Contenido
"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.
Transcript
-
PRESENTED BY
Matt Stauffer
@stauffermatt
IN THE
LARAVEL -
Laravel and the Enterprise
Laravel Live UK 2018
-
Laravel in the Enterprise
Laravel US 2023
-
“Type a quote here.”
-
Why this talk?
-
en•ter•prise
[en-tər-prīz ]
noun
🤷 -
Started with Wikipedia…
-
“[Enterprise software…] is computer
software used to satisfy the needs of an
organization rather than individual users.”
WIKIPEDIA -
“[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 -
“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 -
Then asked on Twitter…
-
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 -
JOHN CORRY
[You know it’s enterprise if] we spend
more time in meetings than we do
building things.
@JPCORRY -
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 -
• What is enterprise?
• Aside: Is Laravel enterprise-ready?
• Key considerations for enterprise:
• Code
• Process
• Summary
Agenda -
What is enterprise,
really? -
Factors in enterprise projects/teams
Team size Customer
base size
Legal and
compliance
constraints
Dev team size -
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 -
Factors in enterprise projects/teams
Legal and
compliance
constraints
Customer
base size
Dev team size
Team size
LARGE LARGE LOTS
LARGE -
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 -
Is Laravel enterprise-ready?
1 -
Yep.
https://speakerdeck.com/mattstauffer/
laravel-and-the-enterprise -
Moving on…
-
Code considerations
for the enterprise
2 -
PAUSE
-
The biggest threat to
enterprise Laravel apps is
leadership who thinks all
enterprise apps need
{{ BUZZWORD }}
without knowing why. -
RESUME
-
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 -
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 -
IT’S
KONSTANTIN
AGAIN
CODE CONSIDERATIONS FOR THE ENTERPRISE
2 -
https://www.youtube.com/watch?v=uQUxJObxTUs
CODE CONSIDERATIONS FOR THE ENTERPRISE
2 -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2 -
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) -
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 -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2
• Lorem ipsum dolor sit amet, consectetur adipiscing
Page Title -
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
-
A few other tips…
-
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 -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2 -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2
• Decide your conventions• Automate linting and
fi
xing• Document everything (especially startup)
Set a standard -
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 -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2
• Lorem ipsum dolor sit amet, consectetur adipiscing
Page Title -
CODE CONSIDERATIONS FOR THE ENTERPRISE
2
• Run those tests often• Run those tests automatically
Test more than just your code -
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 -
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… -
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 -
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 -
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 -
Process considerations
for the enterprise
3 -
PROCESS CONSIDERATIONS FOR THE ENTERPRISE
3
Why?
• More developers; more new developers; more
developers from other stacks; more junior developersHow?
• Conventions, documentation, IDE-friendliness• Bin scripts for setup; pre-packaged local dev
environments• Good tests and seeds
Make onboarding easy -
PROCESS CONSIDERATIONS FOR THE ENTERPRISE
3
Sprint cycles
and lower-case
“a” agile
⚙ -
PROCESS CONSIDERATIONS FOR THE ENTERPRISE
3
Tech debt
management
strategy
🎯 -
PROCESS CONSIDERATIONS FOR THE ENTERPRISE
3
Hiring and
contractors
📃 -
Conclusions
-
Enterprise apps are just apps
where everything that can be hard is hard. -
The best practices for writing
Laravel in the enterpriseAre the same as the best practices
for writing Laravel anywhere else. -
Learn more
enterpriselaravel.com
Need help?
tighten.com
Fuente: Speaker Deck