My Profile Photo

Bits and pieces


Between bits and bytes and all other pieces.
A tech blog about Clojure, Software Architecture, and Distributed Systems


  1. Lazy, Chunked, and Buffered: Understanding Clojure's Lazy Sequences

    Originally posted at: https://redefine.io/blog/buffered-sequences/


  2. µ/log hidden superpower

    TL;DR: How we used μ/log to automatically generate AWS policy for Terraform.


  3. Switching between multiple Java JDK versions in Emacs

    Like many people who work with JVM languages, I do have many version of Java JDK installed on my machine. There are few utilities which help managing which version a given project should use and how to switch quickly between versions. Some of the most popular are: …


  4. Viewstamped Replication explained

    Viewstamped Replication is one of the earliest consensus algorithms for distributed systems. It is designed around the log replication concept of state machines and it can be efficiently implemented for modern systems. The revisited version of the paper offers a number of improvements to the algorithm from the original paper which both: simplifies it and makes it more suitable for high volume systems. The original paper was published in 1988 which is ten years before the Paxos algorithm 1 was published.


  5. Lambda Calculus - Boolean logic.

    In this post I will introduce some of the basic concepts of the Lambda Calculus and use them to define basic terms and operators of the boolean logic. …


  6. lumo vs planck vs clojure vs pixie.

    I was looking to use Clojure for scripting. A few years ago there was not much options. Recently the scenario changed rapidly. The options currently available are: …


  7. Microservices with API Gateway, AWS Lambda and JVM languages

    Originally posted at: https://engineering.thetrainline.com/


  8. Designing Samsara

    In this post I describe the ideas behind Samsara a real-time analytics system. It as a walk through its design principles, and the decision behind the architecture. …


  9. Learn Clojure - Clojure Basics

    I will try to introduce concepts gradually without assuming prior knowledge of Clojure (or any other LISP dialect). However I will assume that you are already an experienced developer in any other popular language such as Java, C/C++, Python or Javascript. General programming concepts such as functions, parameters, recursion, objects and common data-structures such as: linked lists, maps (or dictionaries), vectors and sets will be assumed to be already known. …


  10. Emacs Incanter Hack

    Often while exploring a new dataset in Clojure I use the excellent Incanter library. Incanter is a R-like platform for statistical analysis written in Clojure. …


  11. A "dead simple" introduction to Clojure macros.

    Macros are one of the topics which scares many new Clojure developers. Although I’ve seen many tutorials about the topic, I think that the approach used is often too complicated for someone who is new to Clojure. So I will try to explore the topic especially for developers who are new to Clojure and haven’t yet grasped the macros. …


  12. The complete guide to Clojure destructuring.

    Updated to Clojure 1.10.1 - Last update on 2019-07-23.


  13. Cascalog by examples (part 1)

    In the past 2-3 years I’ve been using a number of different technologies on top of Hadoop for querying and processing BigData. …


  14. How to calculate the reminder with bitwise operations

    In High Performance Computing everything counts. Martin Thompson (former LMAX CTO) warns us in his excellent talks and blog about the cost of the division operation in the modern CPUs. …


  15. Clojure Pills: Arithmetics and type autopromotion

    In a previous post about Integer numbers we have seen that Clojure for efficiency reasons tries to map the numbers to their Java basic types and that with the literals modifiers “N” for integers and “M” for decimals you can use BigIntegers and BigDecimals in place of the Long and Double. …


  16. Clojure Pills: Strings and Characters

    Strings and characters in Clojure they have no surprises. They map respectively to java.lang.String and java.lang.Character. Both, strings and characters they evaluate to themselves. …


  17. Clojure Pills: keywords

    The keywords concept is unknown to most of the programming languages. The closest concept to a keyword in Java is an enumeration with the difference that enumerated values are in Java grouped in a surrounding type. …


  18. Clojure Pills: rational numbers

    A rather unique and interesting feature of Clojure (and Lisp derived languages) is the first class support for rational numbers. …


  19. Clojure Pills: Decimals and floating point numbers

    Similarly to my previous post about Integer numbers, Clojure has a support for floating point numbers, by default mapped as java.lang.Double and arbitrary precise decimals mapped as java.math.BigDecimal. …


  20. Clojure Pills: Integers number

    Clojure supports integers (like any other high level language) and when possible they are mapped to java.lang.Long objects. Numbers in Clojure are evaluated to themselves. …


  21. Clojure Pills: The syntax

    LISP derived languages have a bad reputation for the excessive use of brackets. At first sight it’s bit hard to understand Clojure source code. If you try to google “LISP brackets” you will find a list of rants and discussions about this topic. …


  22. Clojure pills: Getting started

    To get started with Clojure, you need the REPL. The REPL stands for Read Evaluate Print Loop and it is a console-like application where you can enter Clojure functions/expressions and get the result directly. …


  23. Clojure pills: The journey begins

    Few months back, after reading an inspiring post about Lisp and the agility of developing new ideas, I decided to start my journey and learn Clojure. …


  24. How to convert a standalone MongoDB into a replica set

    The default installation of MongoDB is standalone, that is fine for development and testing purposes. However if you find yourself in the position of having a production-like MongoDB in standalone set up (maybe for a very small app that grew up) and you want to convert this into a Replica Set installation to benefit from the automatic replication and failover, then you are stuck!!! …


  25. Vert.x Goodness - Simple Telnet Server

    One of the coding test that I often assign to developers when I do interview is to implement a simple Telnet server in Java. Not a full-fledged Telnet server compliant to the RFC-854, but just a non-secure, small brother with just few commands implemented. …


  26. Yet, another post about Ops, DevOps, NoOps!

    In the past few days I’ve seen strong exchange of opinions about the different Ops flavours. In particular Adrian (@adrianco) from Netflix, in a series of twitter posts, defined as “NoOps” a certain number of practices adopted by Netflix development teams to push in production changes by themselves without depending on Ops teams. The twitter posts, and most probably, the presence of the “No” prefix, have been largely mis-interpreted by Ops communities. Adrian with this post, tried to clarify what the term NoOps means in NetFlix. …