r/SoftwareEngineering • u/Faceless_sky_father • Jun 25 '25
Microservices Architecture Decision: Entity based vs Feature based Services
Hello everyone , I'm architecting my first microservices system and need guidance on service boundaries for a multi-feature platform
Building a Spring Boot backend that encompasses three distinct business domains:
- E-commerce Marketplace (buyer-seller interactions)
- Equipment Rental Platform (item rentals)
- Service Booking System (professional services)
Architecture Challenge
Each module requires similar core functionality but with domain-specific variations:
- Product/service catalogs (with different data models per domain) but only slightly
- Shopping cart capabilities
- Order processing and payments
- User review and rating systems
Design Approach Options
Option A: Shared Entity + feature Service Architecture
- Centralized services:
ProductService,CartService,OrderService,ReviewService , Makretplace service (for makert place logic ...) ... - Single implementation handling all three domains
- Shared data models with domain-specific extensions
Option B: Feature-Driven Architecture
- Domain-specific services:
MarketplaceService,RentalService,BookingService - Each service encapsulates its own cart, order, review, and product logic
- Independent data models per domain
Constraints & Considerations
- Database-per-service pattern (no shared databases)
- Greenfield development (no legacy constraints)
- Need to balance code reusability against service autonomy
- Considering long-term maintainability and team scalability
Seeking Advice
Looking for insights for:
- Which approach better supports independent development and deployment?
- how many databases im goign to create and for what ? all three productb types in one DB or each with its own DB?
- How to handle cross-cutting concerns in either architecture?
- Performance and data consistency implications?
- Team organization and ownership models on git ?
Any real-world experiences or architectural patterns you'd recommend for this scenario?
10
Upvotes
View all comments
Show parent comment
2
u/NG235 Jun 25 '25
Super simple (and accurate) way of putting it. Something like a video streaming platform could have different services, where one handles video transcoding, and another manages engagement and user content. They are separate enough where they don't need to be one, but there's also technical reasons as to why the could/should be separate services – different languages, compute requirements, API interfaces (REST or gRPC).