Sönke Ruempler2024-02-01T13:28:16.000Zhttps://ruempler.eu/Soenke RuemplerHexoReview-Driven Testing: Enhancing Code Quality, Upskilling Developers, and Promoting Testing Culturehttps://ruempler.eu/2024/01/23/code-review-driven-tests/2024-01-23T11:00:00.000Z2024-02-01T13:28:16.000Z<p>In the world of software development, ensuring the quality and reliability of code is paramount. One popular approach to achieving this goal is Test-Driven Development (TDD), where developers write tests before writing the actual code. TDD is also my default way of approaching software development.</p>
<p>However, I’ve started in many environments situations where code changes are made without accompanying automated tests. In such cases, I am using a method I call “Review-Driven Testing”, which helps not only to improve code quality and upskill developers, but also to promote a testing culture within development teams.</p>
<h2 id="What-is-Review-Driven-Testing"><a href="#What-is-Review-Driven-Testing" class="headerlink" title="What is Review-Driven Testing?"></a>What is Review-Driven Testing?</h2><p>Review-Driven Testing is a practical approach to adding automated tests to code changes that were initially developed without them. While traditional TDD focuses on writing tests before writing code, Review-Driven Testing involves writing tests after the code has been developed and submitted for review. It can be seamlessly used in teams that are not used to writing automated tests by default (yet).</p>Easier Code reviews with Git Colored Move Diffshttps://ruempler.eu/2023/12/31/code-reviews-with-git-color-diffs/2023-12-31T11:00:00.000Z2024-02-01T13:28:16.000Z<p>Code reviews can be very time-consuming. Especially if you are reviewing a lot of code changes. Often, code changes are simple refactorings, such as extracting code into methods/functions or moving code around. These changes are more or less irrelevant for the review, since they usually don’t change the behavior of the code. As a reviewer, one still wants to make sure that code hasn’t been changed during the code move.</p>Upgrade CDK/Cloudformation-managed AWS Aurora Serverless v1 (MySQL 5.7) cluster to Serverless v2 (MySQL 8.0) with minimal downtimehttps://ruempler.eu/2023/12/31/upgrade-aws-aurora-serverless-v1-to-v2-cloudformation-cdk/2023-12-31T11:00:00.000Z2024-02-01T13:28:16.000Z<p>Since <a href="https://www.reddit.com/r/aws/comments/18sx0i6/aurora_serverless_v1_eol_december_31_2024/">AWS is going to sunset / auto-upgrade Aurora Serverless v1 in December 2024</a>, it’s time to upgrade to Aurora Serverless v2. Upgrading to Serverless v2 MySQL instances also means upgrading from MySQL 5.7 to MySQL 8.0 under the hood.</p>
<p>This article describes how to adapt the <a href="https://aws.amazon.com/blogs/database/upgrade-from-amazon-aurora-serverless-v1-to-v2-with-minimal-downtime/">AWS provided upgrade path</a> to work with a CDK / CloudFormation infrastructure-as-code project, which requires a few more steps which I call the “<strong>CDK/CloudFormation retain-and-import dance</strong>“.</p>Zero-downtime upgrade from AWS Aurora 2 (MySQL 5.7) to version 3 (MySQL 8.0) with the CDK and Aurora Blue/Green deploymentshttps://ruempler.eu/2023/10/08/zero-downtime-upgrade-aws-aurora-mysql5-7-8-0-with-blue-green/2023-10-08T10:00:00.000Z2024-02-01T13:28:16.000Z<p>This article demonstrates how to upgrade an CDK (or Cloudformation)-managed AWS Aurora cluster from MySQL 5.7 compatible AWS Aurora 2 to MySQL compatible Aurora 3 engine without any - ok, I lied - one minute of downtime. The process utilizes the <a href="https://aws.amazon.com/blogs/aws/new-fully-managed-blue-green-deployments-in-amazon-aurora-and-amazon-rds/">blue/green deployment feature</a> of Aurora. It also shows how CDK/CloudFormation stacks are brought back in sync with the upgraded Aurora clusters.</p>Minimizing downtimes when managing AWS RDS parameter groups with CloudFormationhttps://ruempler.eu/2023/04/13/mininizing-downtime-cloudformation-rds-parameter-groups/2023-04-13T10:00:00.000Z2024-02-01T13:28:16.000Z<p>When managing RDS parameter groups with CloudFormation, you might have noticed that changes to a DB cluster or instance parameter group will always cause a reboot of the RDS instance. This happens when the RDS cluster or instance parameter group and the RDS instance are managed by the same CloudFormation stack.</p>Automated MySQL RDS/Aurora initialization with CDK, Fargate and the MySQL CLIhttps://ruempler.eu/2023/03/26/rds-mysql-aurora-inititization-with-cdk-fargate/2023-03-26T10:00:00.000Z2024-02-01T13:28:16.000Z<p>A recurring task when provisioning databases is to initialize them with initial users, stored procedures, and/or tables.</p>
<p>In the CDK world, there is currently no native support for this, but there are some workarounds. AWS has a <a href="https://aws.amazon.com/blogs/database/automating-database-initialization-with-aws-cloud-development-kit/">blog post</a> about this, but it’s using a Lambda function, and a bunch of custom code which seemed like too much operational overhead for me. </p>Why real serverless scale-to-zero and no-pay-for-idle are importanthttps://ruempler.eu/2023/03/26/scale-to-zero-no-pay-for-idle-is-important/2023-03-26T10:00:00.000Z2024-02-01T13:28:16.000Z<p>Having defined what is serverless and what not in the last article, this time let’s have a look at one particular characteristic of serverless systems: they can scale to zero also known as: you don’t pay for idling resources. So let’s discuss why this is actually very important.</p>Setting up MySQL Aurora replication from an external primary with GTIDs https://ruempler.eu/2023/03/10/aws-aurora-external-mysql-primary-gtids/2023-03-10T11:00:00.000Z2024-02-01T13:28:16.000Z<p>Setting up Amazon Aurora as a replica of an external MySQL primary is a common way of synchronizing and/or migrating self-managed MySQL databases to RDS/Aurora.</p>Lessons learned when restoring a MySQL Aurora RDS database from S3/Percona Xtrabackuphttps://ruempler.eu/2023/02/19/aurora-xtrabackup/2023-02-19T11:00:00.000Z2024-02-01T13:28:16.000Z<p>Recently I was trying to restore a Aurora database from an Percona xtrabackup, the de-facto industry standard for backing up self-managed MySQL databases. Luckily, RDS and Aurora natively support restoring a cluster from Percona xtrabackups. This comes very handy for migrations of big databases (For more information, check out <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Migrating.ExtMySQL.html#AuroraMySQL.Migrating.ExtMySQL.S3">the docs</a> and <a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/migrate-on-premises-mysql-databases-to-aurora-mysql-using-percona-xtrabackup-amazon-efs-and-amazon-s3.html">this prescriptive guidance article from AWS</a>).</p>Serverless - a new model to run backend softwarehttps://ruempler.eu/2022/10/19/serverless-a-new-model-to-run-software/2022-10-19T10:00:00.000Z2024-02-01T13:28:16.000Z<p>For me, serverless has become the default model of developing backend applications.<br>However, a meeting a few weeks ago was a reminder for me that not the entire world is embracing serverless applications already: I had the task to design an “Energy Data Importer”, an application that collects time series data from different locations, sanitizes and transforms them and stores them in a database for later lookup. So I went ahead and <a href="https://github.com/s0enke/serverless-aws-timeseries-injector-query-architecture/">sketched the application with AWS serverless building blocks and patterns</a>.</p>🤔 The serverless testhttps://ruempler.eu/2022/09/21/the-serverless-test/2022-09-21T10:00:00.000Z2024-02-01T13:28:16.000Z<p>There is a lot of buzz and marketing around the term “serverless”. This article aims to dismantle what’s serverless and what not - with practical examples.</p>How to (PUT) upload files to S3 with Typescript and Axioshttps://ruempler.eu/2022/09/13/nodejs-axios-put-s3/2022-09-13T10:00:00.000Z2024-02-01T13:28:16.000Z<h2 id="Situation"><a href="#Situation" class="headerlink" title="Situation"></a>Situation</h2><p>You want to upload a file to S3 with Axios and the <code>PUT</code> method.</p>
<h2 id="Challenge"><a href="#Challenge" class="headerlink" title="Challenge"></a>Challenge</h2><p>S3 needs a Content-Length for <code>PUT</code> requests, otherwise it throws an 501.</p>Advantages of AWS Multi-Account Architecturehttps://ruempler.eu/2017/07/09/advantages-aws-multi-account-architecture/2017-07-09T10:00:00.000Z2024-02-01T13:28:16.000Z<p>When we begin doing some things in AWS, we usually start with a single AWS account and create our AWS resources in it. And things can become a mess very fast. This article should give you an overview why you should switch to a using multi-account architecture very soon for workloads on AWS.</p>Paul O'Neill: The Irreducible Components of Leadershiphttps://ruempler.eu/2017/06/26/paul-o-neill-the-irreducible-components-of-leadership/2017-06-26T10:58:53.000Z2024-02-01T13:28:16.000Z<p>This is an annotated transcription from <a href="https://www.youtube.com/watch?v=htLCVqaLBvo">Paul O’Neill’s talk on leadership</a> - in my opinion the most powerful and inspiring talk I have ever seen on leadership. I decided to transcribe it (well, Youtube did the most work with its automatic subtitles feature), because there are so many great quotes in it and I wanted to have it as a source for myself, e.g. for futures articles, so I always have a written reference.</p>Dead man's switch with AWS CloudWatch: Freshness-Alerting for Backups and Cohttps://ruempler.eu/2017/06/26/dead-mans-switch-backup-alerting-aws-cloudwatch/2017-06-26T10:00:00.000Z2024-02-01T13:28:16.000Z<p>A recent challenge for one of the teams I am currently involved was to find a way in AWS CloudWatch:</p>
<ol>
<li>To alert if the metric breaches a specified threshold.</li>
<li>To alert if a particular metric has <strong>not</strong> been sent to CloudWatch within a specified interval.</li>
</ol>Lesegruppen / Buchclubs in Unternehmenhttps://ruempler.eu/2017/04/17/lesegruppen-buchclubs-organisationales-lernen-unternehmen/2017-04-17T10:00:00.000Z2024-02-01T13:28:16.000Z<h2 id="Buchbesprechungen-als-Werkzeug-fur-Organisationales-Lernen"><a href="#Buchbesprechungen-als-Werkzeug-fur-Organisationales-Lernen" class="headerlink" title="Buchbesprechungen als Werkzeug für Organisationales Lernen"></a>Buchbesprechungen als Werkzeug für Organisationales Lernen</h2><p>Auf den devopsdays 2015 in Berlin hatten wir eine Open Space Gruppe, die sich mit dem Thema beschäftigte: “Ich lese viele Bücher, Blogs etc, und würde dieses Wissen gerne in das Unternehmen tragen, in dem ich gerade arbeite”. Dabei kam die Idee auf, Lesegruppen zu bilden. Diese Idee fand ich so gut, dass ich sie direkt einmal ausprobiert habe. </p>"Service Discovery" with AWS Elastic Beanstalk and CloudFormationhttps://ruempler.eu/2017/04/09/aws-cloudformation-elastic-beanstalk-dynamic-parameters-service-discovery/2017-04-09T10:00:00.000Z2024-02-01T13:28:16.000Z<h2 id="How-to-dynamically-pass-environment-variables-to-Elastic-Beanstalk"><a href="#How-to-dynamically-pass-environment-variables-to-Elastic-Beanstalk" class="headerlink" title="How to dynamically pass environment variables to Elastic Beanstalk."></a>How to dynamically pass environment variables to Elastic Beanstalk.</h2><p>Elastic Beanstalk is a great AWS service for managed application hosting. For me personally, it’s the Heroku of AWS: Developers can concentrate on developing their application while AWS takes care of all the heavy lifting of scaling, deployment, runtime updates, monitoring, logging etcpp.</p>AWS Continuous Infrastructure Delivery with CodePipeline and CloudFormation: How to pass Stack Parametershttps://ruempler.eu/2017/04/09/aws-codepipeline-cloudformation-parameter-passing/2017-04-09T10:00:00.000Z2024-02-01T13:28:16.000Z<p>When deploying CloudFormation stacks in a “Continuous Delivery” manner with CodePipeline, one might encounter the challenge to pass many parameters from the CloudFormation stack describing the pipeline to another stack describing the infrastructure to be deployed (in this example a stack named <code>application</code>).</p>CodePipeline and CloudFormation with a stack policy to prevent REPLACEMENTs of resourceshttps://ruempler.eu/2017/03/28/aws-codepipeline-cloudformation-stack-policy-prevent-replacement-resources/2017-03-28T10:00:00.000Z2024-02-01T13:28:16.000Z<p><strong>Update 2019-01-24</strong>: <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html">CloudFormation now natively supports a update policy for replacments with the <code>UpdateReplacePolicy</code></a>.</p>
<p>Some operations in CloudFormation trigger a <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html"><code>REPLACEMENT</code></a> of resources which can have unintended and catastrophic consequences, e.g. an RDS instance being replaced (which means that the current database will be <strong>deleted</strong> by CloudFormation after a new one has been created).</p>Idempotent CloudFormation stack creation/update one-liner with Ansiblehttps://ruempler.eu/2017/03/17/ansible-cloudformation-wrapper-one-liner/2017-03-17T11:00:00.000Z2024-02-01T13:28:16.000Z<p>When developing CloudFormation templates, I regularly missed an idempotent one-liner command which does something like “create or update stack N with these parameters”, which provides a fast feedback loop.</p>