Background Paths
Background Paths
← Selected Work

Software · Mobility

EV Charging Backend

A pan-European EV charging network operator needed a reliable, regulation-compliant backend for several hundred charging stations across six countries. The system had to handle real-time session management, dynamic load balancing, payment processing, and roaming interoperability — and do so at a service level that supports 24/7 highway corridor operations. MobilityCortex designed and delivered the full backend stack.

Problem: Scaling Beyond a Pilot

The client had run a successful 40-station pilot on a minimal OCPP 1.6 backend that was never designed for scale. Moving to several hundred stations across multiple countries introduced requirements the pilot system could not meet: multi-currency billing, eMSP roaming via OCPI, dynamic load management to stay within site power budgets, and the EU Alternative Fuels Infrastructure Regulation (AFIR) mandate for ad-hoc card and QR payment acceptance.

Architecture: OCPP 2.0.1 Native, Microservices

The backend is structured around the OCPP 2.0.1 protocol for charge point communication and OCPI 2.2.1 for eMSP/CPO roaming. Each functional domain — session management, pricing, load management, notification, and roaming — is a separate service with its own persistence layer and independent deployment lifecycle.

Session Management

The session-service handles the full OCPP transaction lifecycle:RequestStartTransaction authorization via RFID/QR/app deep-link, heartbeat tracking, metering value collection (signed meter values per eichrecht, PTDB-compliant for Germany), and TransactionEvent processing. All session state is persisted to PostgreSQL with a Redis write-through cache for sub-millisecond status queries from the dashboard.

Dynamic Load Management

The load management service monitors site-level grid capacity in real time via Modbus TCP integration with site energy meters. When aggregate charging power approaches the contracted site limit, the service redistributes available capacity across active sessions using a priority-weighted algorithm: drivers who have been charging longest receive lower priority, preserving fast-charging capability for new arrivals.

// Simplified load allocation sketch
function allocatePower(sessions: Session[], siteLimitKw: number): Map<string, number> {
  const sorted = [...sessions].sort((a, b) => b.startTime - a.startTime); // newest first
  let remaining = siteLimitKw;
  return sorted.reduce((map, session) => {
    const alloc = Math.min(session.maxKw, remaining);
    map.set(session.id, alloc);
    remaining -= alloc;
    return map;
  }, new Map());
}

Billing & Roaming

Pricing is configured via a rules engine that supports time-of-day rates, energy-based tariffs, and flat session fees — meeting AFIR ad-hoc price transparency requirements. Payment is processed via Stripe (card) and a white-label in-app flow. OCPI Hub integration enables roaming with major eMSP networks, so users of partner apps can charge seamlessly without a separate account.

Reliability Engineering

Highway corridor charging stations cannot afford extended downtime. The backend is deployed across three AWS availability zones with a 99.95% uptime SLA. Charge points maintain local authorization caches and can continue sessions in offline mode (OCPP offline authorization) for up to 72 hours without backend connectivity. Incident response is automated: on charge point disconnection, a monitor triggers PagerDuty within 90 seconds.

Results

MetricValue
Stations managed340+, 6 countries
Backend uptime (12 months)99.97%
Session authorization latency (P99)280 ms
OCPI roaming partners8 eMSPs
AFIR complianceAd-hoc payment, price display, accessibility ✓

Technology Stack

  • OCPP 2.0.1 WebSocket gateway (Node.js, custom protocol layer)
  • OCPI 2.2.1 for eMSP/CPO roaming
  • PostgreSQL + Redis for session state; TimescaleDB for metering data
  • Stripe for payment processing; eichrecht-compliant signed meter values
  • AWS ECS Fargate, multi-AZ, with Route 53 health-check failover
  • Grafana + CloudWatch for operations dashboards and alert routing

Interested in this capability?

Get in touch →