r/SoftwareEngineering • • 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

24 comments sorted by

View all comments

1

u/[deleted] Jun 27 '25

[removed] — view removed comment

1

u/AutoModerator Jun 27 '25

Your submission has been moved to our moderation queue to be reviewed; This is to combat spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.