KVS: Inside the Architecture of a Go Key-Value Store

Introduction KVS v1.0.0 has been released. KVS is a simple in-memory key-value store written in Go that can be used as a Go module or deployed as a standalone server. This post introduces the major features included in v1.0.0 and takes a deep dive into the core data structures: Red-Black Tree and LSM Tree implementations. Why Another Key-Value Store? Excellent key-value stores like Redis, LevelDB, and BoltDB already exist. So why build KVS? KVS started as a learning and experimentation project. The goal was to experience firsthand the design decisions and trade-offs involved in building a production-grade database. The result is a store with these characteristics: ...

2026-03-18 · 14 min · 2842 words · Sung-Kyu Yoo

Ansible Molecule with Kind - Kubernetes Automation Testing with Docker

Introduction to Ansible Molecule with KIND Learn how to set up a Kubernetes automation testing environment by combining Ansible Molecule with KIND (Kubernetes IN Docker). Overview Ansible Molecule Ansible Molecule is a framework that helps test Ansible Roles in isolated environments using virtualization technologies. It supports various drivers and can integrate with KIND using the Delegated driver for Kubernetes environments. KIND (Kubernetes IN Docker) KIND is a tool that runs Kubernetes clusters as Docker containers. It allows you to quickly and easily create Kubernetes clusters locally, making it useful for: ...

2022-05-26 · 13 min · 2723 words · Sung-Kyu Yoo

Testing Ansible Roles with Molecule

Introduction to Molecule Molecule is a testing framework for Ansible Roles maintained by the ansible-community. With Molecule, you can systematically test Ansible Roles, enabling comprehensive testing using multiple instances, operating systems, virtualization providers, test frameworks, and test scenarios. Why Do You Need Molecule? When developing Ansible Roles, you face the following challenges: Limitations of Manual Testing: Manually running and verifying Roles each time is time-consuming. Multi-Environment Support: You need to ensure Roles work correctly on various operating systems like Ubuntu, CentOS, and Debian. Continuous Integration: Tests need to run automatically in CI/CD pipelines. Code Quality: Ansible code quality must be maintained consistently. Molecule provides the following features to address these challenges: ...

2022-05-26 · 10 min · 2031 words · Sung-Kyu Yoo

Developing Ansible Modules

Ansible provides features that make it relatively easy to write automation for large-scale server installation, application deployment, and service operations. It’s one of the methods enabling DevOps, Ansible runs over SSH and requires SSH access to remote machines. No separate daemons or agents are needed. Remote machines (for default Ansible Modules) only need Python 2.6 or higher installed. (Some modules may require additional Python modules.) Ansible Modules are recommended to guarantee idempotency. For modules that exceptionally don’t guarantee idempotency, be sure to document warnings. Introduction An Ansible Module can be thought of as a set of functions with a specific purpose in one Task of an Ansible Playbook. For example, if you need to “move a file from path A to path B”, you can use the “file” module provided by default in Ansible. ...

2017-11-14 · 8 min · 1636 words · Sung-Kyu Yoo

Introduction to Ansible Callback Plugin

This article focuses only on Callback Plugin among Ansible Plugins. Callback Plugin is a module used for various purposes such as logging data when specific events occur in Ansible, or writing to external channels like Slack, Mail, etc. This content is based on Ansible 2.2.1.0. What is Callback Plugin? Introduction Ansible Callback Plugin refers to plugins that can hook into various Ansible events and execute desired logic at those points. These callback plugins support defining callback functions for events like “before execution” and “after execution” for Ansible Tasks, Playbooks, etc. ...

2017-11-14 · 9 min · 1741 words · Sung-Kyu Yoo

Introducing ACOR: Redis-backed Aho-Corasick Implementation

Introduction String searching is a common problem in software development. Finding a single keyword is straightforward, but what if you need to search for hundreds of keywords simultaneously? Iterating through the text for each keyword would be inefficient. The Aho-Corasick algorithm elegantly solves this problem. Developed by Alfred V. Aho and Margaret J. Corasick in 1975, this algorithm can efficiently search for multiple patterns at once. ACOR is a Go library that implements Aho-Corasick with Redis as the backend storage. In this post, we’ll introduce ACOR, cover the basics of the Aho-Corasick algorithm, and walk through its usage. ...

2017-06-28 · 3 min · 620 words · Sung-Kyu Yoo

Managing Python Virtual Environments with pyenv

When using Python, you’ll encounter various version environments. First, distributions like RedHat and Debian have their own system Python installed, and you can also use Python built from source on a per-account basis as needed. Python has major syntax and built-in library differences between 2.x and 3.x versions, and minor versions can have different behaviors or implementations in some features - a free but sometimes risky situation. Of course, if you only operate one project on a single system and the version will never change, you may not need to worry about this. However, generally, a single system can have various Python projects, and these may often be implemented based on different Python versions. If you reduce cohesion between projects through dependency isolation, individual projects don’t need to worry about other environments. ...

2017-04-02 · 12 min · 2421 words · Sung-Kyu Yoo

Understanding the alternatives Command

alternatives (or update-alternatives) is a GNU-licensed command-line tool that provides functionality to create, remove, manage, and query symbolic links. In other words, it allows defining default versions or paths for specific commands through symbolic links. Note that Debian-based Linux distributions only provide the update-alternatives command (the original alternatives script was reimplemented to remove perl language dependency), and there are some differences in functionality compared to RedHat-based Linux commands, but this article covers only common functionality and options. Examples are based on RedHat. ...

2017-03-17 · 9 min · 1815 words · Sung-Kyu Yoo

Ansible Galaxy - Managing Role Dependencies Using Git Repositories

Uploading Ansible Role to Git Repository First, create a Git repository for developing an Ansible Role. Then, generate the initial Ansible Role project structure using Ansible Galaxy. Clone the Git repository to your local machine. 1 $ git clone "https://github.com/xxxxx/sample-role.git" Generate Ansible Role initial directory and files. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $ ansible-galaxy init --force sample-role - sample-role was created successfully $ tree sample-role/ sample-role/ ├── README.md ├── defaults │ └── main.yml ├── files ├── handlers │ └── main.yml ├── meta │ └── main.yml ├── tasks │ └── main.yml ├── templates ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml After developing the Ansible Role, push to Git repository. 1 $ git commit * -m "Add ansible role" && git push Downloading Ansible Role from Git Repository Method 1) Download via Ansible Galaxy CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 $ ansible-galaxy install git+https://github.com/xxxx/sample-role.git,master -p roles/ $ tree roles/ roles/ └── sample-role ├── README.md ├── defaults │ └── main.yml ├── handlers │ └── main.yml ├── meta │ └── main.yml ├── tasks │ └── main.yml ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml Method 2) Specify in dependency file and download via CLI 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 $ vi requirements.yml - src: git+https://github.com/xxxx/sample-role.git version: master $ ansible-galaxy install -r requirements.yml -p roles/ - extracting sample-role to roles/sample-role - sample-role was installed successfully $ tree roles/ roles/ └── sample-role ├── README.md ├── defaults │ └── main.yml ├── handlers │ └── main.yml ├── meta │ └── main.yml ├── tasks │ └── main.yml ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml Writing ‘requirements.yml’ src username.role_name: Used to download Ansible Roles registered in the official Ansible Galaxy repository. url: Used to download from SCMs supported by Ansible Galaxy. scm Specify the SCM name to integrate. Default is ‘git’ (as of ansible-galaxy 2.2.1.0, only git and hg are supported) version Specify tag name / commit hash / branch name. Default is ‘master’ Only used when downloading from SCM. name Specify the name of the downloaded Ansible Role. By default, uses the name registered in Ansible Galaxy or the Git repository name. See the examples below: ...

2017-02-16 · 7 min · 1425 words · Sung-Kyu Yoo

Deep Dive into Java 8 Lambda Expressions

Started as ‘Project Lambda’ in 2010, it was officially released in Java 8. This article details how functional programming was incorporated into the existing Java language. Brief Overview of Functional Programming Before introducing Java’s lambda expressions, we need to briefly understand functional programming. (Functional programming based on lambda calculus is a paradigm, and lambda expressions represent it!) Functional programming is a paradigm that creates output relying only on function input, avoiding changing external state, minimizing side-effects. Functional programming must satisfy the following conditions: ...

2016-11-09 · 16 min · 3199 words · Sung-Kyu Yoo