Michał Matłoka — Senior Software Engineer

My first time with Scala Steward

This month I’ve used Scala Steward for the first time… and it’s great! How do you update dependencies in your projects? New versions appear, bugs and security issues are being fixed. So far I was using the sbt-updates plugin, which just lists what he new versions for each of the project dependencies are. Scala Steward goes one step ahead. For configured repositories it checks the dependencies updates and… automatically creates PRs for each of them (so CI can verify if everything works)! What is more it can apply even scalafix migrations!

So how to use it for private repos?

First clone the Scala Steward repository Update the repos.md file If you want to use it with private repositories, then create e.g. for GitHub a Personal Access Token. Create script which returns this token to stdout, e.g. login.sh with content echo my-key Run the build with sbt stage export STEWARD_DIR=repo_location Run the Scala Steward with the following command

./modules/core/.jvm/target/universal/stage/bin/scala-steward \

--workspace "$STEWARD_DIR/workspace" \

--repos-file "$STEWARD_DIR/repos.md" \

--git-author-email your-email@example.com \

--do-not-fork \

--vcs-api-host "https://api.github.com" \

--vcs-login your-github-login \

--git-ask-pass "$STEWARD_DIR/login.sh"

And that’s all. Expect PRs to appear on your repo shortly. Of course in next step you may want to integrate this with your CI flow, which sounds quite good.

Adam Smolarek — Senior Software Engineer

How not to lock your table when creating DB index

So let’s say that you created a few tables when the project started. After that, you added a few columns, and it was ok. But after a while, it looks like queries are slow. So what can you do?

Maybe add an index on some column? Yes, it may help. But there is an issue when you do:

create index index_name on table(column);

It will lock the table until it finishes creating the index.

That is bad for applications with strict SLA that have to be always online, or at least some instances have to be online and be able to write to DB.

So what can you do?

It turns out that in some databases like PostgreSQL, there is an easy solution for that:

create index concurrently index_name on table(column);

Yes, that’s it. This will switch the default behavior of the locking table and will create the index in parallel to standard operations that your app is doing on the DB.