DockerCon EU 18 – Monitoring Docker Containers in Swarm mode

At DockerCon EU 18 I held a tech talk about monitoring Docker containers in swarm mode. Since the talk was only 20 minutes, it was not possible to cover all the interesting detail. This article provides some additional information and a tutorial for setting up a simple monitoring infrastructure for swarm mode. You can jump directly to the tutorial here.

The slides from the talk are available here.

Continue reading “DockerCon EU 18 – Monitoring Docker Containers in Swarm mode”

Book Review: Clean Architecture

This book is a must read for any serious software developer. It gives a high-level overview of software development that is missing from other more code-oriented books. The primary focus is on Object-Oriented Programming and how we build systems that are maintainable, flexible, extendable and correct. But the approach is high-level so not many code examples.

At 321 pages and 34 chapters, it is not the most extensive book, and it is an easy read because so much of the advice makes perfect sense. But it still has so much depth that I think it can be read multiple times to get all the nuggets of wisdom.

A different view on the book is from Blaine Osepchuk. The only criticism I have of the book is that some of the chapters feel more like intros and does not cover the theme adequately.

I have collected my notes from the book here for all to benefit. But the notes do not give the book the needed credit so please take the time to read it.

Continue reading “Book Review: Clean Architecture”

OAuth and OpenID Connect for dummies

To learn more about how and why OAuth 2 works the way it does, I took part in a workshop hosted by curity.io as part of the Nordic APIS summit 2018. The workshop covered the basics of OAuth 2 and OpenID Connect. I have worked a little bit with OAuth 2  before so I knew the basics, but the workshop helped me gain a better understanding of the protocol and the different parts of it.

I have tried to describe the learnings I had from the workshop here both for my reference and it might help others understand OAuth 2 better.

Continue reading “OAuth and OpenID Connect for dummies”

Scalable baseline website setup with authentification and VueJS, Amazon S3 and .net core 2.1

For my projects, I need a generic website setup that I can reuse for multiple projects.

I want to try out the following setup. A frontend build in Vue served as static files from Amazon S3. A backend built with .net core 2.1 as a REST API presented with Swagger. Finally, using Googles firebase authentification for login requirements.

Since I need a baseline platform for multiple projects, it needs to be generic enough to allow me to reuse the setup. Most of my projects need a similar setup with a frontend exposed to anonymous users and a backend dashboard which requires authentification.

In this article, I am going to cover how I set up the Vue frontend. In later articles, I will cover the authentification and the backend.

Continue reading “Scalable baseline website setup with authentification and VueJS, Amazon S3 and .net core 2.1”

Email forward for adresses where you do not want an account

If you like me have too many domains for different projects, email accounts get a problem. With any domain comes the responsibility to allow people to get in contact with you. Often I use a webmaster@domain or info@domain email address to enable visitors to contact me.

But At $4 / month for an Amazon Work mail account and $5 / month for a Google suite user maintaining many email accounts gets pricey. Also, it is a hassle to monitor all the accounts.

Often you simply want to have emails forwarded to a single email account, where it is possible to set up filters, and allows you to check mail in a centralized place. For example, have info@datadriven-investment.com be forwarded to frederik@patch.dk which is my primary email account. With minimum set up.

Continue reading “Email forward for adresses where you do not want an account”

Amazon S3 backup strategy

Real men do not take backups, but they cry a lot 

But I rather not cry too much 🙂 I try to have a good backup solution. After all, I do spend an awful lot of time creating data; it would hurt a lot if it were lost by accident. Especially since a backup is easy to set up and cheap.

Amazon S3 is my go-to solution for cloud data storage. It is designed never to lose data and to be resilient to disasters. On top of that, it is cheap.

In this article, I dive into what you need to know about Amazon S3 before you start using it for your backup solution.

Continue reading “Amazon S3 backup strategy”

Docker setup monitoring

We do not log in to our servers every day to check how the resource usage is. Just like with uptime monitoring we need a system to help us monitor if everything is inside reasonable limits so we can scale the servers if required. And detect any potential problem before it becomes a problem.

In this article, I will explore how to set up monitoring using, Docker, influxdb, grafana, cAdvisor,  and fluentd.

Continue reading “Docker setup monitoring”

Book Review: C# 7.0 in a Nutshell

The latest update in the C# in a Nutshell series, it obviously covers C# 7.0. With 1037 pages it is a massive volume, most of it can be used as a reference book, and many of the chapters are not important unless you have very specific needs. The topic in each chapter is covered in significant detail, you will be hard-pressed to find a detail that is not covered I think.

It can be read, cover to cover, but I would recommend to read the first 4 chapters and pick from the remaining based on interest or need. The detail level and reference book type of writing make the book dry to read, so be warned!

My notes from the book are collected here, I hope they will be useful to someone.

Continue reading “Book Review: C# 7.0 in a Nutshell”

AWS load balancing Docker hosts and pain with HTTPS

In my continuous effort to make my setup as redundant as possible, the next step is to add a load balancer. I ran into a few problems while setting it up, allowing me to share my experience.

  1. It is not possible to have the apex record of a domain point to a CNAME.
  2. Moving the domain names of a service that runs HTTPS requires great care.

I added a network load balancer to sit in front of my Docker hosts to allow them to be fall over for each other. After that, I moved datadriven-investment.com to www.datadriven-investment.com because of the problem with apex DNS record mentioned above.

Continue reading “AWS load balancing Docker hosts and pain with HTTPS”

WordPress load times below 100ms

To improve the load time from the previous article, we must look to caching. I have always been fascinated by technology that allows us to serve pages very VERY fast. So in this article, I am going to explore a few different options for making WordPress load faster using caching.

It is not feasible to make software like WordPress load in less than 100ms, just loading the front page on this blog takes around 400ms which is already fast for a WordPress site. So we need a caching system in front of it to improve the load time.

Continue reading “WordPress load times below 100ms”