How JUCR delivers real-time EV charging status with federated subscriptions from Apollo

50+

microservices and 20 federated subgraphs

1,000

events/sec in a distributed system

Switching

to Rust boosted performance by up to 10x

As the electric vehicle (EV) market grows rapidly, reliable and user-friendly charging infrastructure is increasingly critical. JUCR, the fastest-growing EV charging provider in Germany and expanding throughout Europe, set out to simplify the charging experience for customers by developing in-house, end-to-end hardware and software. However, creating a robust and real-time feedback loop between the chargers, apps, and customers proved to be a challenge. 

The challenge: complex infrastructure and real-time interaction hurdles

Charging has become one of the top concerns in the EV market, and a number of issues have emerged in an effort to improve this process: every car has different hardware, availability and wait times vary, and charging stations can suffer from poor internet connectivity, leading to delays in response times. Such issues can leave users feeling confused about whether their cars are actually charging and how long they need to wait.

To improve customer experience in EV charging, JUCR aims to provide customers with total transparency by indicating charging status using real-time updates and statistics. If a charging session stops prematurely or experiences other issues, JUCR’s customer assurance team works to resolve the problem as quickly as possible. As a result, real-time interaction between the customer, the app, and the charger is crucial to create a reliable and seamless experience.

“Turning on a charger should be as simple as flipping a light switch,” Max Grollmann, JUCR’s CTO and Co-Founder, explained. “When this one request happens, our backend architecture coordinates nearly 100 events to ensure flawless execution. There are complications in that.” 

Beyond charging, JUCR also manages a complete PCI-compliant billing system with wallet functionality, payment redirections, and extensive provisioning processes for setting up and maintaining charging stations. With so many moving parts across their architecture, JUCR needed to build a robust system that could connect multiple APIs /services and handle high throughput with efficiency. That’s where Apollo came in.

The solution: building real-time updates with Apollo Federation

“At JUCR, we are handling a ton of traffic. This means we require scalable platform architectures to ensure robust, flexible systems that can adapt to growing demands and technological advances,” Max said.


JUCR’s infrastructure team initially implemented polling so that the application made repeated HTTP requests at regular intervals. While simple and effective for basic updates, this approach had its drawbacks. For one, latency carried a minimum lag that was equal to the polling interval, which could be any number of seconds or minutes. Additionally, multiple requests over a short time period resulted in unnecessary server load, meaning the system often returned redundant data.

Transitioning to subscriptions

In search of a better option, the team turned to GraphQL subscriptions through Apollo to provide a low-latency publish/subscribe (pub/sub) channel between the client and server—which in their case was the GraphOS Router and their mobile applications. Like queries, subscriptions enable users to fetch data, except they are long-lasting operations that can change their result over time. These are particularly useful for notifying customers about changes to back-end data in real time. 

JUCR’s charging app subscribes to updates about ongoing charging sessions, including battery status, charging speed, and any changes in the session timeline. Using Apollo Federation, the router splits the query into parts and forwards the subscription to the graph that owns it while fetching data from multiple other subgraphs seamlessly. But for this architecture to fully work, the service owning the subscription must store all open subscriptions to a charging session. 

“Because subscriptions are infrastructure, and infrastructure has nothing to do with the domain layer, we need to decouple the domain,” Max explained. To remove the subscriptions out of JUCR’s model, the infrastructure team created a layer between their subgraphs and other services that could feed the router with data while also handling new requests. 

GraphOS Router

The next step in JUCR’s journey was handling subscription management. With the help of GraphOS Router, this led the platform team to build Pathfinder, an event-driven relay between asynchronous message brokers and the router. Pathfinder tracks subscriptions, processes updates, and ensures that only relevant updates are sent to the router, helping to maintain real-time efficiency and scalability. The tool is highly configurable, Kubernetes-native, and open-source, and it can handle millions of incoming messages per second while also integrating with key-value stores like Redis and supporting external schema registries. 

By decoupling subscription management from JUCR’s services, Pathfinder makes it easier to scale real-time capabilities across their platform. For example, the team had initially made only charging sessions live, but Pathfinder now allows them to select multiple subscriptions to extend real-time capabilities to transactions, charging stations, or other features without modifying the core services. This could not have been accomplished without using the GraphOS Router as a gateway for executing GraphQL queries across distributed subgraphs. 


“Waiting 10 seconds for your EV charger to respond might not seem long, until you’re standing outside in -10°C weather in Germany. Now, thanks to our latest advancements, that wait is reduced to milliseconds, giving our customers a seamless, near-instant charging experience when they need it most” –  Max Grollmann, JUCR’s CTO and Co-Founder


Moving to Rust

“We’ve been exploring a deeper integration of Rust across our technology stack, inspired in part by Apollo’s approach to building code in Rust,” Max said. The company is currently transitioning more systems to Rust as part of its engineering roadmap, developing custom implementation of a GraphQL server in Rust and leveraging Apollo’s Rust-based parser. 

Rust is a great option for its reliability and maintainability, and the language is easily understood which is crucial for smaller teams like JUCR’s where unexpected delays could impact timelines. Adopting Rust has also brought JUCR significant performance improvements, particularly in parsing GraphQL queries. For example, while parsing is resource-heavy in a Node.js architecture, moving to Rust has resulted in performance gains of up to 10x

This shift has been especially impactful for JUCR’s backend services, though there are some gaps in tooling and libraries compared to existing solutions in other languages. As the company continues to build and refine its systems, its teams are also contributing to the Rust ecosystem to help bridge these gaps and demonstrate the potential of Rust for server-side GraphQL implementations for the development community. As such, partnering with Apollo was a natural step.

Results and key takeaways

By replacing inefficient polling with subscriptions using Apollo’s architecture, JUCR reduced redundant requests and overall server load. The company’s distributed architecture operates at an impressive scale, consisting of over 50 microservices and 20 federated subgraphs that communicate asynchronously and process over 1,000 events per second. Additionally, their API includes 854 fields and 214 types, reflecting the complexity and depth of the platform.

Now, JUCR’s updates occur in milliseconds instead of seconds or minutes, and they can provide immediate responses so that customers feel reassured knowing their session status in real time. Max shared that Apollo’s tools were pivotal in enabling this growth.

For one, building a distributed system is much cleaner using GraphQL and Apollo Federation,” he said. This is true due to Apollo’s unified API layer, modular and scalable architecture, and schema composition, but also because of its efficient data retrieval: “Apollo’s ability to fetch only the specific data needed was especially valuable in our mobile app context, where limited network conditions could otherwise hinder performance. For example, mobile users not on strong Wi-Fi or 5G can still experience a seamless interface,” Max said. 

Finally, Max shared that developer experience at JUCR has improved tenfold due to Apollo’s well-documented, intuitive platform. The implementation of the GraphOS platform in particular streamlined processes and reduced friction for new and existing team members alike, allowing developers to define their entire schema within a single tool. Additionally, GraphOS Studio Explorer enables developers to test queries and use real-time insights to determine whether they will work before implementation. Using these tools, new team members can become familiar with the API and how to fetch data within just a few days, a stark contrast to the processes of a REST API.


“With Apollo GraphOS and federated subscriptions, JUCR delivers seamless live updates to thousands of EV charging sessions across Europe, keeping our customers up-to-date in real time during their charging experience” – Max Grollmann, JUCR’s CTO and Co-Founder


With the help of Apollo, JUCR has improved latency, efficiency, and customer and developer experience across EV charging in one fell swoop, carving out an approach that will serve as a blueprint for a rapidly growing EV market. Apollo’s state-of-the art GraphQL solutions help companies build the scalable architecture they need to modernize their tech stack and accelerate growth.  

To hear more about JUCR’s GraphQL journey straight from the source, watch Max’s talk at GraphQL Summit 2024

Next story

Share article

Instagram