Nick Fisher's tech blog

Recent Posts

Configuring Lettuce/Webflux to work with Clustered Redis

Lettuce has some pretty nice out of the box support for working with clustered redis. This combination–a reactive client and application along with clustered redis–is about as scalable, performant, and resilient as things can get in distributed systems [though there are other tradeoffs which are not the subject of this post].

Bootstrap a Local Sharded Redis Cluster in Five Minutes

If you’re interested in understanding details of how clustered redis works [that is to say, if you’re more or less responsible for operationalizing it], there is an excellent section in the redis documentation that goes into some detail on it. I would advise everyone to read that at some point, but if you just want to get started hacking this is the TLDR; article that you’re looking for. We will run through some basic commands to get up and running, and you can use this cluster to help figure out the details later on.

Setup and Use a DynamoDB Test Container with the AWS Java SDK 2.0

The source code for this article can be found on Github.

Using embedded dynamodb for testing is, in my experience, kind of flakey and unpredictable. Because of the weird way it pulls in SQLite on a per operating system basis, it can sometimes work locally and not work on the build server. Sometimes it’s just not working for some unexplained reason and wiping the directory that the code is in and re-cloning fixes it. Not a fun time.

Set up a Basic Leader/Follower Redis Cluster Locally using Docker

In general, you will want to keep your development environment and your higher environments as similar as makes sense [times it doesn’t make sense: when it costs too much], to catch bugs early and often. Here, we’ll quickly run through how to set up a leader/follower topology for redis using docker/docker-compose on your local machine.

How to Configure Lettuce to connect to a local Redis Instance with Webflux

The source code for this post can be found on Github.

In a previous post, we detailed how to write integration tests for lettuce clients in spring boot webflux using a redis test container. That’s fine and well when you’re just writing code for a quick feedback loop, but is useless when it comes to running the application in real life. This post will start up redis locally and then explain how to best connect to it using lettuce in webflux.

How to use a Redis Test Container with Lettuce/Spring Boot Webflux

The source code for this post can be found on Github.

Another way to write integration tests for code that verifies your interactions with redis actually make sense is to use a test container. This framework assumes you have docker up and running, but if you do it will pull a specified container image [typically you’ll just use docker hub, though it’s important to note that they rate limit you, so don’t go overboard], then you can interact with that container in your integration tests.

How to use Embedded Redis to Test a Lettuce Client in Spring Boot Webflux

The source code for this article can be found on Github.

Lettuce is a redis client with reactive support. There is a super handy embedded redis for java project out there, and this kind of integration testing inside your service is worth its weight in gold, in my humble opinion. This post will detail how to merge both of these worlds together, and set up redis integration tests when you’re using a lettuce client.

Newer Posts