Nick Fisher's tech blog

DevOps

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.

Setting up a Python Lambda to Trigger on DynamoDB Streams via the AWS CLI

DynamoDB streams record information about what has changed in a DynamoDB table, and AWS lambdas are ways to run code without managing servers yourself. DynamoDB streams also have an integration with AWS Lambdas so that any change to a DynamoDB table can be processed by an AWS Lambda–still without worrying about keeping your servers up or maintaining them. That is the subject of this post.

How to Setup SNS Message Forwarding to SQS with the AWS CLI

Amazon SNS is AWS’s solution to pub/sub. In a large, distributed system, decoupling events from services that need to act on those events allows for teams that own different services to better work in parallel, and also prevents the need for coordinating code deploys to deliver new features. If a services is already publishing a generic event, other services can hook into that event and act on them without needing anything but a bit of infrastructure.

DynamoDB Streams and Python: A Working Introduction

DynamoDB Streams is AWS’s home grown Change Data Capture [CDC] mechanism, which allows the consumer of the stream to see records probably in approximately the order they were created [it’s basically impossible, at scale, to guarantee that all records across all partitions will somehow stream the data in exactly the same order that it was written]. This is a pretty fantastic feature because it allows us to reliably do —something— after we add new data, update existing data, or delete existing data. As long as all the stream records are read and processed, we can ensure at least once processing on data changes and then go sleep soundly at night knowing that there is one less edge case in our application. Combine that with the natural scale that DynamoDB provides via its leaderless architecture and you can build this thing once and probably never have to worry about it handling more load ever again.

How to Expose Meaningful Prometheus Metrics In a Spring Boot 2.x Application

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

Prometheus is a metrics aggregator with its own presumed format. The basic idea is to have the application gather a set of custom metrics, then periodically collect (or “scrape”) the metrics and send them off to a prometheus server. This server will store the data in its database, and you can thus view the evolution of your application’s metrics over time.