Microservices with Laravel


520
Tham khảo
287
Lượt Đọc
36
Tải về
Ủng hộ chúng tôi
https://api.timsach.vn/go/3828979349

Microservices with Laravel

What’s the problem with monoliths?

In order to understand what microservices are, first, we have to talk about monolith systems and their drawbacks.

Imagine Amazon as a Laravel project. It is one huge git repository, and it’s made of classes like these:

- Product
- Inventory
- Catalog
- Rating
- Shipping
- Order
- OrderHistory
- Payment
- Discount
- Refund
- Recommendation - Wishlist
- Account
- PrimeMember
- OneClickBuy

And so on. Just ask yourself: what does the one-click buy functionality have to do with shipping? One-click buy cares about credit card numbers, and user info, while shipping cares about product attributes, like weight and height, and addresses. Similarly refund logic has nothing to do with a wishlist.

Despite the fact that these modules, these classes are very different from each other, they live in the same repository, they can be accessed by the same API, they can call each other, and they can share some general functions or classes.

They are tightly coupled and have low cohesion. But in great architecture, we’d like to have loose coupling and high cohesion.

Ngôn ngữ
Tất cả sách điện tử, ebook trên website TimSach.VN đều có bản quyền thuộc về tác giả. Chúng tôi khuyến khích các bạn nếu có điều kiện, khả năng xin hãy mua sách giấy để ủng hộ Tác giảNhà xuất bản
Mượn Ebook Tốc độ cao - Không quảng cáo
Trang chủ