I’ve spent time over the years playing with various hobbyist electronics platforms, such as Arduino and NodeMCU (ESP 2866). Most of the time it’s just been working on a breadboard but now I am working on a project that needs to be very minimal (low power and cost). For this I’ve decided to skip an actual Arduino and go with a plain ATmega328p. For those that don’t know, many Arduino boards are powered by the (formerly Atmel) Microchip ATmega328p....
Death to JSON!
TLDR; I don’t really want JSON to die – but we need to stop using it for APIs. Background Back in 2011 I was working at LiveProfile, a mobile messenger startup. JSON was relatively new and REST APIs (as we know them today) were still in their infancy. We were building out a SOA (Service Oriented Architecture) for our backend system. Mobile clients used the XMPP protocol and we were using an Erlang XMPP server, ejabberd. We wanted to keep the XMPP server simple, just a frontend, and all business logic (contact lists, stored messages, authentication, etc,.) would be built in a Java backend. The Erlang application needed to communicate with the backend, and so we began looking at various options for Erlang -> backend communication. ...
Zero Downtime Deployments in Kuberentes
If you don’t already know Kuberentes, its a Container Orchestration Platform originally designed by Google. I’ll assume you already have a decent understanding of containers and Kuberentes, but if not, I recommend learning about it here. If you want to get a cluster up and running quickly you can check out Minikube. Rolling Deployments Kubernetes has out-of-the-box support for rolling deployments via Deployments. A Deployment uses Replica Sets (which are essentially Replication Controllers with support for set-based selectors) to orchestrate pod deployment....
HTTP/2 HPACK Compression library in Golang
HPACK was designed to provide header compression in HTTP/2. It uses both Huffman encoding for compressing strings and index tables to reduce the amount of over-the-wire header data needed in an HTTP/2 request. I found the specification interesting and wrote a Golang library that implements it, skip here to read about it. Huffman Encoding Huffman encoding works by assigning short codes to frequently used characters. The HPACK specification defines the various codes to encode all characters, so when a peer recieves a header that is Huffman encoded it consults the list of short codes to resolve the character (aka symbol)....
decentralized network 42
Recently I’ve been interested in BGP and stumbled across a thread on reddit that pointed me to a community called decentralized network 42, or dn42. If you haven’t heard of dn42 it is essentially a private network that runs just like the real internet does, with BGP, peering, an Internet Registry (aka the registry), DNS root servers, and more. Joining the dn42 network usually means creating your own Autonomous System and peering with other users....
CoreOS with cloud-config on VMWare ESXi
CoreOS is a lightweight Linux distribution that integrates a platform for distributed environments. It makes Docker containers first class and adds some great features such as service discovery with etcd and cluster management with fleet. This post won’t go into too much detail on the benefits of CoreOS, so I recommend you head to the CoreOS site to read more. Instead we will be talking about how to get CoreOS running on VMWare ESXi....
clojure, ring, and 1990's style counters
Clojure is a Lisp-like programming language that runs on the JVM. Ring is a web application library that provides a simple framework for serving HTTP content with clojure. It is similar to Rack for Ruby or WSGI for Python. In this post we will be creating a web application that serves up a 90s style hit-counter GIF image. Skip ahead to the demo (hosted on Heroku) or check out the source....
avr-os: Multitasking on Arduino
Arduino is an open source prototyping platform for electronics. There is so much you can do with Arduino and the community is proof. In playing with Arduino I decided that it would be a great project to create a small multitasking library for use on AVR platforms, which includes Arduino. A small introduction avr-os is a library that provides a very basic rutime that enables your program to multitask. The library uses pre-emptive multitasking to switch tasks and each task has its own stack that is restored when a task is resumed....
Content Delivery Networks: A Primer
Content Delivery Networks (CDNs) cache your content around the globe to reduce latency and improve performance for end users. It is a very powerful tool and can be leveraged by any web site. Historically, CDN providers have been very expensive and were not practical for most people. Now things have changed and there are many CDN providers that cater to cloud customers who want pay-as-you-go service. Check out CloudFront, Rackspace Cloud Files, MaxCDN, SoftLayer CloudLayer, and more....
libhashring - high performance consistent hashing
In a previous post I talked about the need to shard Redis data and how I accomplished this by adding shard/hashing support to erldis, an Erlang client for Redis. This solution proved to work well, it distributed our data very well amongst many Redis servers – but there was one problem. Performance. In the change I made to erldis, the hash ring was stored in ETS (an erlang memory store) and anytime a key was hashed, the ring had to be retrieved from ETS....