Introducing Hazelcast Striim Hot Cache. You have an application that retrieves and stores information in a database. You want faster response times so you utilize a Hazelcast Cache for rapid access to in-memory data. But other application also make updates which leads to the cache bing inconsistent with the database and the database showing out-of-date information. Hazelcast Striim Hot Cache solves this by synchronizing the cache with the DB using change data capture ensuring the cache and application always have the correct data.
To try Striim for Hazelcast Hot Cache, go here.
Today, we would like to introduce the new Hazelcast Striim hot cache that uses change data capture to solve the cache consistency problem. In much of that you have an application that works by retrieving and storing information in a database. To get faster response times, you utilize a Hazelcast in memory cache for rapid access to data. However, other applications also make database updates which leads to inconsistent data in the cache and the application now shows out of dates or in valid information. Hazelcast Striim hot cash solution by using streaming change data capture to synchronize the cache with the database in real time, ensuring the cache and associated application always have the correct data. In this demo we have a MySQL database, HazelCast cache and Striim server. We’re using test programs to work with the MySQL database to create, modify and dump data and for the Hazelcast cache, which can also dump data. We start by creating a table using the test code and loading it with data.
We then use Striim to load the data from the database into the Hazelcast cache. Next, we created a CDC flow from the database and use this at deliver live changes into the cache. We run continuous modifications against the database which are replicated to the cache. After some time we dumped the database in the cash to files and run a diff to prove that they are the same. In this demo you’ll see the use of wizards to simplify the CDC setup and delivery to Hazelcast real time CDC from the database, real time delivery of change to synchronize the cache and a real time custom monitoring of the whole solution.
The first thing we need to do is set up the demo. By using our test program to create a table in the MySQL database. You can see the table here and that it is initially empty. Next, we use a test code to insert 200,000 rows of data. You can see the count. To perform the initial load from database to cache, we need a data flow. We use a database reader to extract data from MySQL, which we configure for our MySQL instance and test table. The target is a Hazelcast writer, which is configured to map the table data into our cache. To load the cache we need to deploy it and start the application and stream the full table data from the database into the cache. You can see that the cache now has 200,000 entries for Hazelcast. We need to set up change data capture to stream live database to the cache. First, we can figure properties to connect to the MySQL database and Striim checks to make sure CDC will work properly. We’ll tell you if the configuration needs changing and what to do. You can then browse and select tables of interest.
Next you enter the Hazelcast cluster information and mapping information in the form of a file linking database tables to cache objects. You can see the mapping here. The last step finalizes the configuration of the Hazelcast target. The wizard results in a data flow from MySQL CDC source to the Hazelcast target. When deployed and started the cache sync with modifications from database change, let’s run some modifications in the form of inserts, updates, and deletes against the table. You can see the data flowing here in real time. In our application, we stuffed the modifications and see the table size, which we can pair with a number of entries in the cache. Both the table and cache have 180551. If we dumped this equal data from the database into a file and do the same with the cache data into a different file, we can do a diff between the two files with no results proving that they are the same. And here is what the dump data looks like in both cases. The full Striim platform can also monitor the end to end data flow using a separate data flow for analytics and fully customizable dashboards to meet your business requirements. You can download Striim today to test out hot cache and subscribe to our channel for more videos like this one.