惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
A
About on SuperTechFans
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
I
InfoQ
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
U
Unit 42
The Cloudflare Blog
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built CarvePHP: finding service boundaries in Laravel m...
Muhammad Waleed Khalil · 2026-06-28 · via DEV Community
Cover image for I built CarvePHP: finding service boundaries in Laravel monoliths

Muhammad Waleed Khalil

I built CarvePHP: finding service boundaries in Laravel monoliths

I recently released CarvePHP v0.1.2-alpha, an open-source Laravel package that helps teams analyze large Laravel monoliths and identify possible service boundaries.

The idea came from a common problem:

Moving from a monolith to services is not hard because creating a new service is hard.
It is hard because deciding what to extract and why is hard.

Most Laravel monoliths grow naturally over time. Routes, controllers, models, migrations, jobs, events, and database tables become connected in ways that are not always obvious from the folder structure.

CarvePHP tries to make those connections visible.


What CarvePHP does

CarvePHP combines static analysis and runtime tracing.

Current alpha features:

  • scans Laravel routes, controllers, models, migrations, and database usage
  • optionally traces real runtime route/table coupling
  • builds a dependency graph
  • suggests candidate service boundaries
  • generates Markdown/JSON migration reports

It is not a “one-click microservices” tool.

That would be misleading.

The goal is to help developers make safer, more explainable migration decisions.


Example workflow

Install it with Composer:

composer require carvephp/carve:^0.1@alpha --dev

Then run:

php artisan carve:install
php artisan carve:doctor
php artisan carve:scan --pretty
php artisan carve:analyze
php artisan carve:boundaries --report=carve-boundaries.md
php artisan carve:report --output=carve-report.md

The output is a migration report showing possible boundaries, related routes/controllers/models/tables, coupling signals, and warnings.


Why static analysis is not enough

Static analysis can tell you what the code appears to depend on.

But real applications often behave differently at runtime.

For example:

  • one route may touch multiple tables
  • two tables may frequently appear together in the same request
  • a controller may indirectly depend on a model through a service
  • shared tables may make extraction risky

That is why CarvePHP supports optional runtime tracing.

Runtime tracing is disabled by default and is designed to be safe. It does not log request bodies or SQL bindings by default.


Example boundary idea

A report might suggest a boundary like:

Candidate: Billing

Tables:
- invoices
- payments
- customers

Evidence:
- invoice and payment routes touch related tables
- invoices and payments co-occur in runtime traces
- billing controllers and models are strongly connected

Risk:
- customers table may be shared with other areas

This does not mean “extract Billing automatically.”

It means:

“Here is a possible boundary, and here is the evidence behind it.”

That is the kind of information I would want before starting a real migration.


What it does not do yet

CarvePHP is still alpha.

It does not currently provide:

  • automatic service extraction
  • automatic database splitting
  • production-ready migration orchestration
  • guaranteed perfect boundaries

Those are hard problems and should not be hidden behind marketing language.

For now, CarvePHP is focused on analysis, visibility, and explainable reports.


Supported versions

Current alpha supports:

  • PHP 8.2+
  • Laravel 11, 12, and 13
  • Composer 2.x

Links

GitHub:

https://github.com/Muhammad-Waleed-Khalil/CarvePHP

Packagist:

https://packagist.org/packages/carvephp/carve

Install:

composer require carvephp/carve:^0.1@alpha --dev


Feedback wanted

I am looking for feedback from Laravel/PHP developers who have worked with large monoliths.

A few questions:

  • What evidence would you want before trusting a service boundary suggestion?
  • Would graph visualization be useful?
  • Should the next release focus more on FormRequest analysis, API Resource analysis, or better reporting?
  • What Laravel patterns should the scanner support first?

Any feedback, criticism, or real-world edge cases would be appreciated.