Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Microservices with Laravel Lumen
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mathias Hansen
November 18, 2015
Technology
2.9k
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
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
140
Don't write the architecture only in the prompt.
neohsu
0
300
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
140
Autonomous AI Lakehouse - Live AI Hubから始めるセキュアなAIデータ活用 -
oracle4engineer
PRO
3
190
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
2.8k
Jev の中身は50行で再現できる。でも本物との差はどこにあるのか
hisuzuya
0
290
20261031_IoTLT_vol140_kitazaki_v1.pdf
kitazaki
0
160
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
480
ひとりで始めた AI駆動開発、チームに広げて何が変わったのか
kenichiodo
1
210
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
1
7.1k
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
200
Deep Data Security 機能解説
oracle4engineer
PRO
3
1k
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
247
13k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
330
Building AI with AI
inesmontani
PRO
1
1.4k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
290
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
A better future with KSS
kneath
240
18k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Practical Orchestrator
shlominoach
192
12k
Amusing Abliteration
ianozsvald
1
380
Deep Space Network (abreviated)
tonyrice
0
400
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Tell your own story through comics
letsgokoyo
1
1.1k
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]