Solving Test Data Chaos in Performance Testing with Redis​

Solving Test Data Chaos in Performance Testing with Redis

Thank you so much for stopping by to read this article !

I will be sharing my experience and insights on a recent performance testing engagement I had with a NSW government client, where I elevated the test data management process using Redis. I chose Redis but there are other tools available that could do similar jobs.

My company was engaged to deliver performance testing services for NSW Government client. I was appointed to that project.

This was one of those rare projects where performance testing wasn’t just a checkbox at the end, it was genuinely seen as critical to the success of the entire project.  In fact, the application performance was so important that it was one of the key success factors for the whole project. So application has to handle certain load with response time SLAs.

To add more pressure, since ,I was managing key event of high profile Government Client ! the go-live date was fixed, completely immovable.! So not only was performance crucial, but the timelines were extremely tight, with absolutely no room for slippage. 

Though this is common pressure for testers!

There was no budget for commercial performance testing tools, and no in-house tooling I could rely on. So bottom line is :

Client wanted champagne solution with beer budget !!

So, I was looking at a high-stakes situation: tight deadlines, critical performance requirements, and zero money for tooling.

Welcome to the world of performance testing! I am sure everyone of you has gone through this situation !

Given the constraints, I opted for JMeterthe most widely adopted open-source tool for performance testing. However, our testing scenario involved a complex scripting structure. For instance, one script would generate data that another script had to use in real time. Each virtual user required unique data, and once a data record was used, it couldn’t be reused.

With traditional parameterization approaches, managing this kind of data flow—and visualizing it—was both difficult and time-consuming. So, I needed to produce a solution that could effectively handle real-time test data coordination and visualization.

After fair study , I came to know that Redis and VTS are the best tools available in market for test data management and visualization !

Both VTS and Redis are opensource. VTS does work very well with Loadrunner . But I chose Redis and with a little bit of custom scripts I found I could use Redis with Jmeter quite easily as there is Redis and Jmeter Plugin readily available.

Issues With traditional Parameterization Techniques :

  • Managing large CSV files for parameterization can become cumbersome.
  • Lack of a built-in database or central data management system for test data. 
  • Typically relies on CSV files stored locally or on the controller machine. 
  • No real-time or database-driven parameter sourcing without custom scripting. 
  • Not ideal for dynamically generated or frequently updated data. 
  • Parameterization is static; it doesn’t adapt to server-generated values like session tokens, CSRF tokens, etc. 
  • Parameters are tightly coupled with scripts.
  • Updates in data sets require manual updates in files.
  • Difficult to ensure unique data across hundreds or thousands of virtual users (Vusers).
  • Risk of data collisions or reusing the same value by multiple Vusers. Can lead to test failures or unrealistic load behaviour.

What Is Redis DB ?

Article content

  • Redis is In- Memory storage DB : Stores data in RAM, making it extremely fast for read/write operations
  • Key-Value Pair : List / Set
  • Persistence Options : AOF (Append Only File) – logs every write operation so rebuild the dataset on restart
  • Automatic Operations: Supports operations like incrementing counters, appending to strings, and pushing/popping from lists – all atomically.
  • Lightweight and Fast: Offers millisecond or sub-millisecond latency.

Example of a Education sector application where Parent , Admin , Student Scripts are passing data to each other through Redis. Here Redis is central repository of test data. Scripts can write data to Redis and read data from Redis .

Article content
Diagram : 1

How to setup Redis ?

Article content
Diagram : 2

Here I have used Docker as a preliminary solution for setting up my Redis.

  1. Docker Environment (Containerized Setup)

  • All core components (Flask API, Redis) are deployed inside a Docker container.
  • This ensures consistency, portability, and isolation during testing and development.

2. Flask API (Port 5000)

  • Acts as a middleware layer or application logic tier.
  • Likely provides endpoints to read/write data into Redis.
  • Receives requests from JMeter and interacts with Redis accordingly.

3. Redis (Port 6379)

  • In-memory data store used for fast read/write access during performance tests.
  • Holds test data and acts as DB for your Test Data.

4. JMeter

  • Performance testing tool used to simulate load.
  • Sends request to Flask API for writing real time data/parameters to Redis.
  • Reads data from Redis via Redis Data set plugin- config element provided by Apache Jmeter.

5. RedisInsight : is used for live inspection and debugging during tests

In docker compose file write " volumes: - redis-data:/data" to make data persistent even though docker is shut down.
We can use RPOP method to remove the data from the Redis as soon as it is read.
We can use flask +python + rpush method to write either bulk CSV data or real time script generated parameter to Redis which can be used by your scripts.
Flush DB (FLUSHALL) before/after tests to avoid stale data.

Below is the example of my Redis Project which I have setup for this walkthrough.

Article content
Diagram : 3

Below are important steps required to be implemented if you want to use Redis with JMeter.

Article content
Diagram : 4

Important URLs :

After installing Redis Data Plug-in from JMeter Plug-in manager , add Redis Data Set to your Test Plan.

Article content
Diagram: 5

Below is the example of my Redis Project which I have setup for this walkthrough.

  • Here I have setup Key as StudentsLogon and it is created as a List.
  • each index has studentID and Password separated by comma.

Article content
Diagram : 6

While configuring Redis Data Set , Maintain the same sequence of Variable names as you have maintained in Redis DB.

  • Data Source : List is used here
  • Recycle Data on use : False as I want to use unique data items across as Vusers. Here Redis used RPOP method internally to remove the data item from Redis , as soon as it has been consumed by a Vuser.
  • Redis Server Host : Need to use your system hostname where Redis is implemented . Here I have used Localhost.
  • Database =0 as I have setup my Redis under DB0 refer : Diagram : 6


Article content
Diagram :7


Article content

Conclusion

We successfully completed the NSW Government Project with economically efficient solution. Redis ensured unique, isolated data access for thousands of concurrent virtual users during test runs !!

Please feel free to ask any question related to implementation.

Thank you so much !!

#Redis #JMter #Testdatamanagement #testdata #manage

To view or add a comment, sign in

More articles by Vidula Pataskar

Others also viewed

Explore content categories