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 Reply