By Sivaji | SAP Commerce by Sivaji
In this post, weβll explore the architecture of SAP Commerce (Hybris) β a powerful and flexible enterprise eCommerce platform used by major global brands.
ποΈ Overview
SAP Commerce follows a layered, modular architecture designed for scalability and clean separation of concerns. Each layer has its own responsibilities, ensuring easy customization, testing, and extension.
The architecture can be visualized as a flow from the frontend (storefront) to the database, with supporting APIs and integration layers.
(Insert Architecture Diagram Here β e.g., the image you generated earlier.)
π§© SAP Commerce Code Architecture
SAP Commerce is built on top of Java and Spring Framework, providing both flexibility and enterprise-grade performance.
Layered Structure Overview
- Presentation Layer (Frontend / Storefront)
- Handles user interaction through Accelerator templates or Spartacus (Angular).
- Includes Controllers, JSPs, CMS Components.
- Uses OCC REST APIs to communicate with the backend.
- Facade Layer
- Acts as a bridge between controllers and business logic.
- Provides simplified methods like
ProductFacade,CartFacade.
- Service Layer
- Implements the main business logic.
- Handles transactions and orchestration between DAOs and Facades.
- Examples:
ProductService,CartService.
- DAO Layer (Data Access Object)
- Responsible for querying the database.
- Uses FlexibleSearch to perform CRUD operations.
- Examples:
ProductDao,OrderDao.
- Model Layer
- Represents database entities (e.g.,
ProductModel,CartModel). - Models are defined in
items.xmland managed byModelService.
- Represents database entities (e.g.,
- Database Layer
- Stores persistent data and indexes (e.g., product info, orders, users).
π Data Flow Example
Letβs see how data moves across layers when a user views a product page:
- User requests
/p/12345. ProductControllercallsProductFacade.getProductForCode("12345").ProductFacadecallsProductService.ProductServiceinvokesProductDao.ProductDaofetches data via FlexibleSearch from the database.- Response flows back: Model β Service β Facade β Controller β Frontend.
π§± Extension-Based Development
SAP Commerce is structured around extensions.
Each extension encapsulates a specific feature or module.
Typical structure:
/hybris/bin/custom/myextension/
βββ resources/
βββ src/
βββ web/
βββ items.xml
βββ spring/
βββ project.properties
Developers can add or override functionality by creating new extensions without modifying core ones β ensuring maintainability and upgrade safety.
π Integration and OCC APIs
SAP Commerce provides OmniCommerce Connect (OCC) β a RESTful API layer enabling:
- Integration with mobile apps or headless frontends.
- Communication with external systems (ERP, Payment, Search, CRM).
- Secure access using OAuth and role-based permissions.
π§ Summary
SAP Commerceβs architecture is clean, layered, and extensible.
Each component has a clear responsibility, making it an ideal platform for complex enterprise eCommerce solutions.
In upcoming posts, Iβll dive deeper into:
- How to create custom extensions
- Building OCC APIs
- Performance tuning tips
Stay tuned β and feel free to comment below if you have specific topics you’d like me to cover!

Leave a comment