DEV Community

Cover image for Refactoring an E-commerce Core: Bringing Doctrine DBAL, PostgreSQL, and PHP 8.5 to CS-Cart
CS-Cart
CS-Cart

Posted on

Refactoring an E-commerce Core: Bringing Doctrine DBAL, PostgreSQL, and PHP 8.5 to CS-Cart

If you work at a web development agency or act as a system integrator, you know that an e-commerce platform isn’t just a “product.” It’s a foundational framework. Your clients aren’t asking for simple storefronts anymore—they need high-load multi-vendor marketplaces, B2B portals, and deep API integrations.

To build these complex systems without reinventing the wheel, you need a flexible, future-proof core.

At CS-Cart, we are shifting our engineering focus heavily toward enterprise architecture and Developer Experience (DX). We are currently rolling out some massive under-the-hood updates. Here is a technical look at what’s changing and how it will help your agency build better, more scalable applications.

🐘 1. Database Agnosticism: Hello, PostgreSQL

For years, CS-Cart has been highly optimized for MySQL. It worked great, but as agencies started using our platform to build enterprise and government solutions, a massive roadblock appeared: strict infrastructural requirements.

In the enterprise space, PostgreSQL isn’t just a nice-to-have; it’s often a mandatory requirement for compliance, stability with massive datasets, and complex concurrent queries.

What we are building: We are deep into a massive core refactoring project to introduce native, seamless support for PostgreSQL and Postgres Pro. To achieve this, we are moving away from database-specific raw queries and standardizing our data access layer using Doctrine DBAL.

This makes our core CRUD operations, schema generation, and migrations completely database-agnostic.

💻 How it looks in practice:

Instead of relying on legacy, MySQL-specific query wrappers, the new architecture allows developers to write clean, abstract queries.

Before (Legacy MySQL approach):

// Tied strictly to MySQL syntax and custom wrappers
$users = db_get_array(
    "SELECT * FROM ?:users WHERE company_id = ?i AND status = ?s", 
    $company_id, 
    'A'
);
Enter fullscreen mode Exit fullscreen mode

After (New Doctrine DBAL approach):

// Completely database-agnostic. Works natively on MySQL and PostgreSQL
$queryBuilder = $this->connection->createQueryBuilder();

$users = $queryBuilder
    ->select('*')
    ->from('users')
    ->where('company_id = :company_id')
    ->andWhere('status = :status')
    ->setParameters([
        'company_id' => $company_id,
        'status'     => 'A'
    ])
    ->executeQuery()
    ->fetchAllAssociative();
Enter fullscreen mode Exit fullscreen mode

By abstracting the DB layer, your dev team can simply select between MySQL and PostgreSQL during deployment based on the client’s strict IT requirements. (A Developer Preview of this architecture is dropping later this fall).

⚡ 2. The PHP Version Balancing Act: 7.4 to 8.5

The PHP ecosystem moves fast. Official security support for PHP 7.4, 8.0, and 8.1 is completely dead. CS-Cart currently runs perfectly on PHP 8.2 and 8.3, but agency work comes with a harsh reality: legacy clients.

Forcing a long-term client to overhaul their server stack just to get a platform patch is a massive bottleneck.

Our dual-approach solution:

  1. Frictionless Legacy Support: We are temporarily maintaining compatibility with PHP 7.4. This ensures your existing clients have a smooth, uninterrupted upgrade path without forced, expensive server migrations.
  2. Next-Gen Readiness: At the exact same time, we are ensuring our new architecture natively supports the upcoming PHP 8.4 and 8.5.

Why this is a superpower for dev agencies:

• Passing Security Audits: When you pitch a custom marketplace to a large corporation, infosec is everything. Deploying on PHP 8.5 (which will receive active security support until 2030) gives you a massive advantage in security compliance.
• Under-the-hood Performance: Leveraging the newest PHP JIT compiler and optimizations means the marketplaces you build will handle higher concurrent traffic while eating up fewer CPU resources.

🛠 We handle the Core, You handle the Business Logic

Our goal as a platform is simple: we want to be the ultimate PHP framework for your e-commerce projects.

By handling the heavy architectural lifting—balancing legacy PHP compatibility, migrating to Doctrine DBAL, and introducing enterprise PostgreSQL support—we free up your engineering team.

Instead of fighting core updates and writing database wrappers, your developers can focus on what actually brings value to your clients (and revenue to your agency):

• Complex third-party API integrations
• High-margin custom microservices
• Advanced UI/UX implementations

Let’s build together 🤝

If you are a tech lead or run a dev agency building complex e-commerce solutions, we’d love to have you in our ecosystem. The upcoming Developer Previews will give your tech teams a chance to touch the new PostgreSQL architecture early.

• 👉 Check out our Partner Program (https://www.cs-cart.com/partnership?utm_source=devto)
• 📅 Schedule a dev-to-dev sync (https://calendly.com/mkorobko-cs-cart/60min) — Let’s jump on a quick 30-minute call to discuss architecture, explore our developer benefits, and see how we can help scale your agency.

Let us know in the comments: Are your enterprise clients pushing for PostgreSQL over MySQL lately? How are you handling the PHP 8.x upgrade cycles?

Top comments (0)