VoltDB

VoltDB is an in-memory database borne out of the H-Store research project spearheaded by Michael Stonebraker. Within that project, Michael started with the premise of building a fully transactional database with the best possible performance by using insights gathered from an in-depth study on database performance that completely removed disk access — the primary limiting factor on database performance. By removing disk access completely, we end up with a completely in-memory database where we can make additional optimizations like removing write-ahead logging, buffer management, and locks and latches. This effort resulted in the research database H-Store which was commercialized as the in-memory database VoltDB. This article takes a deeper dive into VoltDB to understand how it works and where you may benefit from this approach. ...

June 3, 2020 · 6 min · Kevin Sookocheff

Understanding Spring's Environment Abstraction

When working with Spring Boot, some auto-configuration can happen seemingly by magic. For example, in a traditional Spring application with Java-based configuration, you might configure an H2 database using the following block of code to set the type of the database and run some scripts to initialize it: @Bean public DataSource dataSource() { return new EmbeddedDataSourceBuilder() .setType(H2) .addScript("taco_schema.sql") .addScripts("user_data.sql", "ingredient_data.sql") .build(); } With Spring Boot, you can remove this entire block of code and use auto-configuration. If the H2 dependency is available in the classpath, Spring Boot will automatically create the DataSource and add it as a Bean to Spring’s application context and apply SQL scripts as long as they are named schema.sql or data.sql. Spring Boot does this auth-configuration by leveraging the Spring environment that collects the set of properties available to a Java application and uses those properties to configure beans in Spring’s application context. The following figure from Spring in Action shows how the Spring environment is generated by some of the available configuration property sources available in a typical Java application. ...

May 27, 2020 · 3 min · Kevin Sookocheff

What is the OCaml toplevel?

Many OCaml guides and tutorials refer to the OCaml toplevel, but what exactly is this thing? In short, the toplevel is OCaml’s Read-Eval-Print-Loop (repl) allowing interative use of the OCaml system. You can consider the toplevel an alternative to compiling OCaml into an executable. In this mode, the OCaml system is configured to repeatedly read phrases from input, typecheck, compile, and evaluate them, then print the inferred type and result value. ...

May 22, 2020 · 3 min · Kevin Sookocheff

Building a Modern Java Web App with Spring Boot

I’m a fan of Java. If you haven’t given it a chance in a while, you may not have noticed that, Java has quietly been adopting some of the best practices that make dynamic and functional languages so appealing, without sacrificing the many hundred person-years of effort that have made Java and the JVM a world-class development environment. Java is still one the world’s most popular programming languages with roughly 9 million programmers using Java. It doesn’t make sense to ignore all of that history and development effort because of a niggling feeling that Java is a little too verbose, or that XML is so last year. ...

May 20, 2020 · 10 min · Kevin Sookocheff

Inversion of Control, Dependency Injection, and the Spring IoC Container

Inversion of Control (IoC), also known as Dependency Injection (DI), allows an object to define their dependencies as constructor arguments (strictly speaking, you can set these dependencies as properties, but the examples I will use today are constructor-based). This is the inverse of the object itself controlling the instantiation or location of its dependencies, hence the name Inversion of Control. Let’s look at an example from Stackoverflow using a text editor with a spell checking component: ...

May 14, 2020 · 5 min · Kevin Sookocheff

Starting a new OCaml project using Dune and Visual Studio Code

After recently setting up a new machine and going through the exercise of setting up a development environment for the nth time, I was frustrated by having to install and configure all of my plugins and dependencies to support auto-completion, syntax highlighting, and the other niceties I’ve come to enjoy with Vim. Looking for an alternative, I was drawn to Visual Studio Code (VS Code) with the VSCodeVim extension. Combining Vim key-bindings with Code’s excellent extension marketplace, I was able to recreate and in some cases improve the development environment I enjoyed as a Vim user in VS Code. This blog post continues that discovery by setting up a brand new OCaml project and development environment in VS Code. ...

May 12, 2020 · 5 min · Kevin Sookocheff

A Tour Through OCaml with Project Euler

This post covers some of the major features of OCaml while solving Problem 1 from Project Euler. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Let’s get started on this problem by looking at the math facilities provided by OCaml. Start a new interactive session using utop. ...

May 8, 2020 · 7 min · Kevin Sookocheff

Getting Started with opam, the OCaml Package Manager

opam — the OCaml Package Manager — is the tool for installing OCaml and any OCaml tools and libraries. This blog post shows us how to set-up opam to install the OCaml compiler and development tools to support your workflow. Working with Windows The OCaml tools are typically well supported on Linux, with macOS ports available of most binaries. If you are on a Windows, the best supported environment is the Windows Subsystem for Linux. ...

May 4, 2020 · 4 min · Kevin Sookocheff

The OCaml Compiler Pipeline

I was first introduced to ML through the Coursera Programming Languages course. After the initial learning curve, I was impressed by the power of the type system and the flexibility of pattern matching. I’ve been wanting to resume my education in functional programming, and am picking up OCaml for a personal project I’m working on. Diving into the OCaml ecoystem, I was drawn to Reason, a new syntax for OCaml, and BuckleScript a compiler that integrates OCaml with the JavaScript ecosystem. The relationship between Reason, BuckleScript, and OCaml can difficult to understand, leading to this blog post about the OCaml compiler pipeline that highlights the intersection between OCaml and BuckleScript. ...

May 1, 2020 · 4 min · Kevin Sookocheff

Above-the-line and below-the-line

Engineering, for much of the twentieth century, was mainly about artifacts and inventions. Now, it’s increasingly about complex systems. As the airplane taxis to the gate, you access the Internet and check email with your PDA, linking the communication and transportation systems. At home, you recharge your plug-in hybrid vehicle, linking transportation to the electricity grid. At work, you develop code, commit it to a repository, run test cases, deploy to production, and monitor the result. Today’s large-scale, highly complex systems converge, interact, and depend on each other in ways engineers of old could barely have imagined. As scale, scope, and complexity increase, engineers consider technical and social issues together in a highly integrated way as they design flexible, adaptable, robust systems that can be easily modified and reconfigured to satisfy changing requirements and new technological opportunities. ...

April 22, 2020 · 7 min · Kevin Sookocheff