Clivern

A Software Engineer and Occasional Writer.

Leader Election with Consul and Golang

16 June 2019

Leader election is the process of designating a single node as the organizer of some task distributed among several nodes. The leader will be responsible for managing the others and coordinate the actions performed by other nodes. If for any reason the leader fails, other nodes will elect another leader and so on. This can help to ensure that nodes don't conflict with each other.

Read More

Leveraging Consul’s DNS Interface

08 May 2019

Consul DNS interface allows applications to make use of service discovery without any integration with Consul. For example, instead of making HTTP API requests to Consul, a host can use the DNS server directly via name lookups like clivern.service.us.consul.

Read More

Django Custom Month and Year Lookup

27 April 2019

Everyone want to keep Django timezone support but sometimes you need to keep your SQL queries a way from timezone conversion especially if by default your application timezone is UTC. Django will do something like this `CONVERT_TZ(`app_incident`.`datetime`, 'UTC', 'UTC'))` and it will return `Null` if the timezone table is empty. Even that conversion is not even needed.

Read More

Django Custom Lookups

23 April 2019

By default Django has a `date` lookup that support timezones. It actually will wrap your field with `CONVERT_TZ` in case `USE_TZ` is `True`. This is pretty awesome unless you have timezones table empty because this call will return `Null.`

Read More

Building a Service Mesh with Consul

16 February 2019

Load balancers aren't efficient in a dynamic environment where we scale services up or down. Consul uses a registry to keep a real-time list of services, their location, and their health. Services query the registry to discover the location of upstream services and then connect directly. This allows services to scale up/down and gracefully handle failure

Read More

Docker in a Nutshell

21 October 2017

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files.

Read More

How To Set Up MySQL Master-Master Database Replication

03 September 2017

One of the most difficult tasks for software engineers is scaling out the databases incase of large traffic applications. Today we will discuss one of the horizontal scaling techniques which is the Master-Master replication. Master-Master replication adds speed and redundancy and also distribute the writes load over many servers.

Read More