OpenCart có cấu trúc database khá rõ ràng, theo kiểu core table + module table, tiền tố mặc định là oc_ (có thể đổi khi cài đặt).
Dưới đây là cấu trúc DB OpenCart (từ bản 2.x → 4.x gần giống nhau):
oc_product → thông tin cơ bản sản phẩmoc_product_imageoc_product_to_categoryoc_product_to_storeoc_reviewoc_attributeoc_attribute_groupoc_product_attributeoc_optionoc_option_valueoc_product_optionoc_product_option_valueoc_categoryoc_category_descriptionoc_category_to_storeoc_category_path (quản lý cây phân cấp cha–con)OpenCart dùng nested set model đơn giản (path table) chứ không phải left-right tree.
oc_customeroc_customer_groupoc_addressoc_customer_ipoc_customer_loginoc_customer_wishlistĐây là phần quan trọng nhất:
oc_orderoc_order_productoc_order_optionoc_order_totaloc_order_historyoc_order_statusOrder được snapshot lại toàn bộ thông tin tại thời điểm mua (không join ngược product).
oc_extensionoc_settingoc_weight_classoc_length_classoc_tax_classoc_tax_rateoc_geo_zoneoc_zoneoc_zone_to_geo_zoneoc_useroc_user_groupoc_apioc_sessionoc_seo_urloc_url_alias (bản cũ)OpenCart tách bảng description riêng:
Ví dụ:
oc_product_descriptionoc_category_descriptionoc_information_descriptionMỗi record có language_id
oc_settingoc_eventoc_banneroc_couponoc_voucheroc_returnproduct_id
↕
product_to_category
↕
category_id
product_id
↕
product_description
↕
language_id
order ↕ order_product ↕ order_option
✅ Không dùng foreign key (đa số MyISAM hoặc InnoDB nhưng không khai báo FK)
→ App tự quản lý quan hệ
✅ Tối ưu đọc nhiều hơn ghi
✅ Phù hợp shop nhỏ → trung bình