“Tests are stories we tell the next generation of programmers on a project.”

Roy Osherove, The Art of Unit Testing

Image by from

An application contains small amount of components, it could be a struct, function or class, we call it unit components, and our application reliability is depends on this unit components. We should make sure the unit components don’t break our application.

So, what is unit test? Unit test is a way of testing our unit components which should be isolated from our external system. …


is a in memory data store which can we used as a database, cache, and message broker. The most apparent use cases for Redis is as cache store on the server side. Aside for caching, there are some patterns that can help use to solve our common problems.

Rate Limiting

You have a public end point, and you want to limit access to to the end point based on client IP address. Let’s say we want to limit the access by 100 requests per minute. By using built in Redis and function, we can build out…


Photo by from

On multithreaded programming environment, we use locks to limit access to shared resources. An example of a lock is a , it name stand for mutual exclusion. A mutex is used to guard shared data (array, linked list, hash map or any simple primitive type) by allowing only a single thread to access the shared data.

When it came to distributed system, it is hard to ensure our multiple instances of applications doing exactly one same piece of work at a time. For example calling some external API, writing to external storage, and perform some heavy computations. …


Photo by

In Go programming language, we can achieve concurrency by using goroutine. Goroutine is one of the most basic units Go programming language. When we create go program, it has at least one goroutine, we called it the main goroutine, it is automatically created and started when the main process begin.

By combining Go’s concurrency primitives (goroutine and channel) and built-in , we can build a pattern to help us writing maintainable concurrent Go code. There are many patterns can be implemented using Go, for example Fan-in Fan-out, Generator, Job Queue, , , Worker Pool etc.

Each pattern has it…


Since version 2.0, announced as one of the supported languages to be used on Kong API Gateway plugins development besides . Kong releases the for Go users on their official repository. In this article, we’ll try to develop and deploy custom plugins for Kong using Go.

We will use to build Kong plugins using the official , this image use Go version 1.13 for development. Our Dockerfile:

# Stage 1 - Build plugin
# Pull image from official go-plugin-tool.
FROM kong/go-plugin-tool:2.0.4-alpine-latest AS builder
# Copy current workspace to container.
RUN mkdir -p…


Traffic Roadway
Traffic Roadway (Photo by )

Implementing concurrent processes in the Go programming language is very easy. Just run your function with go prefix, and boooom, your function will not blocking your main Goroutine.

But, what if your awesome concurrent function have responsibility with the machine’s I/O? For example, your function will do 100 parallel HTTP POST request to REST API from other services. Yeah, your network I/O will be busy handling 100 requests concurrently and this can slow down your I/O performance.

Here comes the rescue Semaphore, based on ,

Semaphore is a variable or abstract data type used to control access to a common…


“Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.” — Rob Pike

Silver Pipes (Photo by )

Concurrency and Parallelism

What is the meaning of concurrency in programming?

Concurrency is the ability of a program for running multiple tasks simultaneously.

And what is parallelism ?

Parallelism is about doing multiple tasks at once.


Photo by

One Time Password (OTP) via SMS dapat mempermudah pengguna aplikasi dalam proses autentikasi. Secara garis besar, proses nya dapat dilihat dalam gambar berikut:


Photo by

merupakan salah satu yang dipakai dalam pengembangan perangkat lunak berbasis Graphical User Interface (GUI), arsitektur ini memisahkan business logic dengan GUI. Pada Android SDK sendiri, telah tersedia library dari API level 7+.

Beberapa layer pada arsitektur MVVM :

Model

Model / entity adalah representasi dari data yang digunakan pada business logic, dapat berupa Plain Old Java Object (POJO), Kotlin Data Classes, dll.

View

Representasi UI dari sebuah aplikasi, pada Android sendiri view ini dapat berupa Activity atau Fragment.

ViewModel

Layer yang berinteraksi langsung dengan Model, serta menyajikan data untuk View layer.

Syafdia Okta

A lifelong learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store