Creating Plants Vs Zombies with Redis

Contribution to the Redis AI Challenge Beyond the Cache: tower defense game powered by Redis, with persistent states, live rankings, and replay via Streams. SQL-free architecture, Pub/Sub, and Redis structures (Hash, Lists, Sets, ZSets, HyperLogLog). Developed by Q2BSTUDIO; code

domingo, 17 de agosto de 2025 • 3 min read • Q2BSTUDIO Team

Artificial-Intelligence-

This is a contribution to the Redis AI Challenge Beyond the Cache and a presentation of an innovative project developed by Q2BSTUDIO

We developed a tower defense game inspired by Plants vs Zombies that redefines the possibilities of Redis as a complete backend. The entire game engine, state management, and real-time features rely exclusively on Redis without the need for traditional SQL or NoSQL databases

Main features of the project

Tower defense game Real-time battles against waves of enemies with planting and defense mechanics

Live rankings Five real-time leaderboards managed with Redis to compete for the top positions

Persistent state Games that can be reconnected and resumed exactly where they were left off, with dynamic player statistics and persistent progression

Smart name suggestions Automatic generation of creative themed names with templates and logic based on Redis

How Redis powers the entire backend

Hashes as the main database Redis stores complex persistent data such as game states, player profiles, and sessions using hashes and serialized JSON

Real-time communication with Pub/Sub All in-game updates and multiplayer events are transmitted with sub-millisecond latencies without the need for polling

Event sourcing with Streams Every game action is recorded in streams to allow full replay, analysis, and auditing without external systems

Leaderboards with Sorted Sets Real-time rankings with logarithmic cost, instant updates, and top N queries

Lane management with Lists FIFO queues for enemy spawning and movement, ensuring order and atomic operations

Sessions and players with Sets Efficient handling of active games and members per match with membership and cardinality operations

Analytics and metrics HyperLogLog for in-memory unique counts, counters, and keys with expiration for rate limiting and global statistics

Technical and architectural benefits

Architecture without additional SQL databases, Redis as the primary store eliminating cache invalidation complexity, event-driven design to reduce polling, and full traceability through streams

In-memory performance with sub-millisecond operations, horizontal scalability ready for Redis Cluster, and memory efficiency through optimized structures such as HyperLogLog

Production-ready

Dockerized implementation with single-container and multi-container options, structured logging by levels, health and metrics endpoints, and deployment and API documentation

Demo and code

Repository with complete code available at github.com/lewisawe/super-adventure and demo on YouTube at youtube.com/watch?v=YjVeeAc05Zc

About Q2BSTUDIO

Q2BSTUDIO is a software development company that offers custom applications and custom software designed to solve real business challenges. We are specialists in artificial intelligence and AI for businesses; we develop AI agents, business intelligence solutions, and dashboards with Power BI. We also offer cybersecurity services, AWS and Azure cloud services, and consulting to transform data into decisions with artificial intelligence and business intelligence

Our services include custom application development, integration of AI models to optimize operations, protection and compliance with cybersecurity solutions, and deployments on AWS and Azure cloud services. We implement analytics pipelines, visualizations with Power BI, and AI agents that automate tasks and improve user experience

Keywords and positioning

Custom applications custom software artificial intelligence cybersecurity cloud services aws azure business intelligence services AI for businesses AI agents Power BI

Conclusion

This project demonstrates that Redis can be the complete platform for real-time and high-concurrency applications. Q2BSTUDIO combines expertise in custom software, artificial intelligence, cybersecurity, and cloud services to bring solutions like this game to production-ready and scalable environments. If you are looking to create custom applications or integrate artificial intelligence and AI agents into your company, Q2BSTUDIO offers experience, tools, and production-ready solutions

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.