May 11, 2016

Learning Erlang #1

after attending dotScale 2016 I finally got enough motivation to properly start learning Erlang. From past experience I know that I need a project to play around with while learning a new language. So I decided to work on an outstanding task for traq, my CLI time-tracking tool: a JSON API to use as a remote storage backend. While rsync (or dropbox, fwiw) would work great as a solid synchronization mechanism I want an API which allows me to write a mobile app for traq someday. Read more

May 6, 2016

The five important abilities of systems

Reading The Architecture of Open Source Applications, especially Chapter 4, struck a cord with me: The authors, Margo Seltzer and Keith Bostic, state, that building systems based on simple components as building blocks lead to systems which are superior to monoliths in the five important -abilities: understandability, extensibility, maintainability, testability, and flexibility. This made me wonder how to clearly differentiate between these abilities, since many discussions about software architecture evolve around one or more of these abilities. Read more

March 30, 2016

docker-compose and load balancing

We’re using docker-compose in production @work and I needed an ad-hoc, lightweight solution to load-balance requests across multiple instances of a specific service, all running on a single host. While docker-compose allows you to scale your services you need to take care of load balancing yourself. Before sharing my approach, which uses golang, let’s start with the problem description first. I’ll be using a dummy service, httpd echo, for demonstration purposes. Read more

February 13, 2016

Prototyping with XCode Playgrounds

With the introduction of the Swift programming language Apple also introduced Playgrounds, interactive environments for easy sharing & prototyping. Today I want to share a tiny example on how to use them to prototype custom UIViews. Specifically a PolarClock. You can download the complete Playground here. I love playgrounds because they allow you to quickly sketch ideas, and visualize steps, before heading for a fully fledged implementation. Let’s try it out: Read more

January 19, 2016

AWS ECS with CloudWatch

AWS ECS is a nice environment to run your applications in. But sometimes you want “hot of the press” Docker features, which you can not configure in your task definitions just yet - like the awslogs log driver, which forwards your Docker logs to CloudWatch. When using the Amazon provided ECS AMIs the setup can be bit complicated for non-us regions, so here’s a simple solution to make it work until the task definitions support the log driver: Read more

December 6, 2015

Migrating applications to AWS

Today I want to demonstrate how to move a web application into “the cloud”, specifically AWS. Along the way I’ll point out some details about the general steps necessary. I’ll be using a simple Sinatra based url-shortener service I found on github. The general steps look like this: create an AMI containing all necessary dependencies create the necessary infrastructure in the cloud adjust deployment strategies Before going into the details, I’m aiming for a reliable solution, which ideally scales quickly. Read more

April 9, 2015

serving static, embedded assets with go

Today I’d like to share a tiny example of why I’ve come to love golang as a programming language during the last two years: how to embed into & serve static assets from your compiled binary. First, the entire code for this example: // main.go package main import ( "bytes" "io" "net/http" ) //go:generate go-bindata -pkg main -o bindata.go frontend/ func main() { http.ListenAndServe(":3000", http.StripPrefix("/", http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if bs, err := Asset(req. Read more

December 17, 2014

building a currency exchange rates api

While working on umsatz I had to build a tiny currency exchange rates api in go. While the original API works fine, it clocks in at more than 400 lines of code. Let’s write a shorter version! In this post we’ll re-build the api, in three steps: download, parse & cache the EUR exchange rates history xml, provided by the ECB 1 add a tiny HTTP JSON API to request rates periodically update the cache with new data This will leave use with a tiny, HTTP currency exchange rates api. Read more

December 15, 2014

present a project: umsatz

In the last post regarding open source side projects I presented traq, a CLI time tracking application I use for my everyday work. Today I decided to present and walk you through the setup of umsatz, my open source accounting application. But let’s first introduce umsatz: umsatz was written to ensure that my book keeping informations are kept safe - that is only locally accessible, not from the internet. It’s not that my information are particularly sensitive. Read more

August 29, 2014

cleaning multiple databases with DatabaseCleaner

TL;DR; the database cleaner gem can easily be used to clean multiple databases at once. I work and maintain some rails projects which connect to multiple databases, some legacy (read: not managed by ActiveRecord), some not. In order to write proper integration tests you might need to load test data into multiple databases, which in turn leads to the need to have clean databases available for all your test runs. Read more

© Raphael Randschau 2010 - 2018 | Impressum