Photo by Matt Duncan on Unsplash

In May 2021, I was endorsed by Tech Nation as an Exceptional Talent and received Talent Visa from the UK government.

I want to document my year-long journey in hopes that it will help others with a similar background.

This will be a long one.

Talent Visa is intended for people with exceptional achievements in their field. It provides you with permission to stay and work in the UK, and offers a path to settlement after a number of years.

For Software Engineering, Tech Nation is the official body that evaluates your achievements.

There are two types of endorsements available…


Photo by Paola Blašković on Unsplash

At Depop we utilise PostgreSQL in most of our microservices. In addition to common data types, such as integers, floats and strings, PostgreSQL also supports array data types and has a whole set of functions that operate on them.

Here’s just one of the problems those capabilities helped us solve.

Let’s imagine that this is how we select multiple products with plain JDBC:

// productIds is a Seq[Int]
val query = sql"""SELECT product_id, likes FROM product_likes WHERE product_id IN (${productIds.mkString(",")})""";

When invoking SQL from your code, the last thing you want to do is to concatenate or interpolate SQL strings…


Photo by Scott Webb on Unsplash

So, you develop some of your services with Kotlin and Ktor.

Normally, your Ktor services will sit safely behind a reverse proxy, that will handle all the basic security concerns, including SSL, for you.

And in your test environment, you would be running without SSL at all, simply bypassing all security. That’s usually the case.

But in my case, I had a particular HTTP client that I needed to test, that would only support HTTPS.

Unfortunately, the official documentation for Ktor is very confusing about self-signed certificates. For one, it only covers the case where you’re using applcation.conf


Photo by gdtography on Unsplash

One of the main features of Go programming language is its eponymous go statement. In my opinion, though, the go statement is one of its main drawbacks too. And that’s not only me.

Unlike expressions, statements don’t bear any result. In Go, it’s super-easy to start a new goroutine. But how do you get its results? How do you know if it may have errored? How do you wait for it to complete? How do you cancel it, if you don’t need its results anymore?

Those familiar with Go will say: well, obviously, use channels. But channel in Go is…


Photo by Katya Austin on Unsplash

A few weeks ago my friend Dmitry Karlinsky wrote an article about “Demystifying functional effect systems in Scala”, which was a fascinating read. In less that fifty lines of code Dmitry has built an IO Monad, similar to what users of ZIO/Cats-Effect/Monix are familiar with.

This article prompted me to start thinking what a similar solution would look like in Kotlin. Would that be even possible, having a type system which is in many ways simpler than the one Scala language has?

As an exercise, let’s try to build a similar system in Kotlin, and see where we end up.


Photo by Louis Reed on Unsplash

On 16th of June the Go team has published an update on generics in Go. Alongside a very thorough design draft, that ditches “contracts” and adopts more conventional approach to typed parameters, came the ability to play with generics yourself online, using the new Go Playground.

Let’s see how to work with the new proposal, and what it promises for the Go language.

For the sake of the exercise we’ll implement a simple list of generics elements, that should have some basic higher order methods as well, such as Filter, Foreach and Map

We’ll start with the definition of our…


Photo by Johannes Plenio on Unsplash

A few days ago Ron Pressler published article called “State of Loom”, which was endorsed by all the greatest people of JVM community, for all the good reasons.

While an interesting read by itself (I personally liked the “taxi” metaphor a lot), I was skeptical how useful this solution could be. Ron challenged me to try it for myself.

Want to read this story later? Save it in Journal.

What we’ll need:

  • Java15 Early-Access Build that contains Project Loom
  • Our favorite command line tool, since IntelliJ doesn’t know anything about Java15 at the moment

To begin with, I decided to…


Photo by Cayetano Gil on Unsplash

Lately I’ve stumbled upon an interesting task — executing a function exactly once, while invoked from multiple coroutines.

That is, having:

fun compute() {
println("Computing")
return 1
}

Invoking:

for (i in 1..10) {
launch {
println(compute())
}
}

Should print “Computing” once only.

What are our options?

First, let’s make an observation that whether the function has been executed once is a state. So, we need an object to keep that state. We’ll name it Once and use it as follows:

val once = Once {
compute()
}
for (i in 1..10) {
launch {
println(once())
}
}

What…


Photo by Alistair MacRobert on Unsplash

There’s this concept in the industry that all successful companies use monorepos, so in order to become as successful as them, yours should too. “Google works with monorepo. Facebook works with monorepo. We should work with a monorepo, to be like them one day!”

The truth is though, that no big company chose to use monorepo. They just ended up that way, and now unable to get out of this tangle. What other choice they have then, other than sell you this idea of monorepo as a success story, and let you drink the Kool Aid?

There’s no denying that…


Photo by Tobias Adam on Unsplash

One of the main features of PostgreSQL 10 was support for declarative partitioning. And PostgreSQL 11 brought many improvements to it.

But does that solve all the issues, and what other issues you may get from using partitions in your project?

Let’s start with the table we’d like to partition:

CREATE TABLE my_table (
id bigserial not null primary key,
created_at timestamp not null,
updated_at timestamp not null,
external_id uuid not null,
status integer not null,
unique (external_id)
);

We assume that we get tens of millions of objects per day, which are uniquely identified by external_id

Due to the…

Alexey Soshin

Solutions Architect @Depop, author of “Hands-on Design Patterns with Kotlin” book and “Web Development with Kotlin” course

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