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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mathias Hansen
November 18, 2015
Technology
1
2.8k
Microservices with Laravel Lumen
PHP World 2015
Mathias Hansen
November 18, 2015
Tweet
Share
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
「ストレッチゾーンに挑戦し続ける」ことって難しくないですか? メンバーの持続的成長を支えるEMの環境設計
sansantech
PRO
1
280
Kiro のクレジットを使い切る!
otanikohei2023
0
110
技術的負債の泥沼から組織を救う3つの転換点
nwiizo
5
1.5k
マネージャー版 "提案のレベル" を上げる
konifar
17
12k
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
670
パネルディスカッション資料 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
1.1k
白金鉱業Meetup_Vol.22_Orbital Senseを支える衛星画像のマルチモーダルエンベディングと地理空間のあいまい検索技術
brainpadpr
2
160
作るべきものと向き合う - ecspresso 8年間の開発史から学ぶ技術選定 / 技術選定con findy 2026
fujiwara3
7
2k
製造業ドメインにおける LLMプロダクト構築: 複雑な文脈へのアプローチ
caddi_eng
0
370
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
72k
LINEアプリ開発のための Claude Code活用基盤の構築
lycorptech_jp
PRO
2
1.4k
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
4
210
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
1.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
180
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Design in an AI World
tapps
0
160
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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]