Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Microservices with Laravel Lumen
Search
Mathias Hansen
November 18, 2015
Technology
2.8k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Microservices with Laravel Lumen
PHP World 2015
Mathias Hansen
November 18, 2015
More Decks by Mathias Hansen
See All by Mathias Hansen
Launching & Scaling a Side Project
minicodemonkey
3
1.2k
Other Decks in Technology
See All in Technology
GitHub Copilot app最速の発信の裏側
tomokusaba
1
260
元・セキュリティ学習経験0大学生による業務紹介 / An Introduction to the Job by a Former College Student with Zero Security Training Experience
nttcom
0
180
Zenoh on Zephyr on LiteX
takasehideki
2
110
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
130
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
840
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
520
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
170
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
200
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
190
OTel × Datadog で 「AI活用」を計測し、改善に繋げる
shihochan
2
640
2026-06-24_人とAIの責務分離に基づく開発プロセスの提案.pdf
takahiromatsui
0
120
Lightning近況報告
kozy4324
0
220
Featured
See All Featured
From π to Pie charts
rasagy
0
220
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Tell your own story through comics
letsgokoyo
1
970
The browser strikes back
jonoalderson
0
1.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Un-Boring Meetings
codingconduct
0
320
Why Our Code Smells
bkeepers
PRO
340
58k
Transcript
Microservices with Laravel Lumen by @MathiasHansen php[world] 2015
Who I Am » I speak English, Danish, and PHP
» Have done so for most of my life » Self-proclaimed Laravel evangelist » Started Capital Laravel Group in 2013
What I Do
What We're Going to Do » Microservices, defined » How
we're using Microservices at VB » Benefits and drawbacks » Microservices with Lumen » Questions
What's a Microservice?
A Microservice should be Designed around a single business capability
None
None
We have... » A big monolithic app » A growing
team » Concerns mostly separated » Let's go one step further
! Microservices ! to the rescue
None
Implementing a Microservice
None
Define a contract » REST? » Protobuf? » SOAP? (please
don't do this)
Plan ahead » How big should your service be? »
How many services should you have? » Share common code across services » use composer
Use an API Manager » api.videoblocks.com/search ➡ searchservice.internal » api.videoblocks.com/abtest
➡ abtestservice.internal » Authentication » Rate limiting » Usage tracking
A Microservice Hybrid or go all the way? » Monolithic
app + Micro services » Static Frontend + Micro services » PHP Gateway + Micro services
Immediate benefits
Teamwork, simplified » Can use any programming language or data
store under the hood » A small team can own the entire process from dev to deployments » Great for onboarding
Deployments, simplified » Deploy a "piece" of the app instead
of full monolith » Independent deployment schedule
Testing, simplified » Unit test » Internal functionality » Integration
test » External interface » Load test » Ability to test each service individually
Scaling, simplified Allocate extra resources to the service that needs
it » Isolate hot/cold zones
Hold your horses
None
Things to Consider
Complexity » Increases complexity of your app » Network overhead
» More planning necessary
How big is your team?
Automation is key Development ➡ testing ➡ deployment
None
What is Lumen?
A microframework » But not necessarily in the traditional sense
» Based on Laravel components » Follows Laravel versioning » Laravel Lumen 5.1 ➡ Laravel 5.1
It still packs a punch » Blade (templating) » Caching
» Commands » Controllers » Eloquent ORM » Dependency Injection » Queueing » Testing » And more...
If you're familiar with Laravel, you already know how to
use Lumen.
Lumen is fast
No, seriously! It's kind of the point
Faster routing + Opt-in rather than opt-out = Smaller footprint
out of the box
Routing » Uses nikic/FastRoute for routing » You don't need
a fancy C extension to make routing fast
Opt-in » Core features has to be explictly enabled: »
dotenv, facades, Eloquent ORM, etc. » Service Providers » Middlewares » CSRF protection, cookie encryption, session handling etc.
What is Lumen not? » Does not support Laravel 5
packages » Very minimal config system out of the box » Uses environment variables » Can use full config system if you want » Router has fewer features
Use cases
Use it for Microservices duh!
Tiny websites Status page, landing page Example: status.geocod.io
High-traffic component of your website Example: Envoyer cron job heartbeat
The competition
Conclusion » Define your contract first » Design your microservice
around a single business capability » Plan ahead » Define testing & deployment strategy » Use Lumen for microservices or other small standalone apps
Additional resources Building Microservices by Sam Newman Martin Fowler's Articles
http://martinfowler.com/articles/microservices.html Taylor Otwell's Lumen Laracasts https://laracasts.com/lessons/introducing-lumen
Questions? Talk to me @MathiasHansen
[email protected]