For Windows, Linux, MacOS and Docker

Original Gopher image created by Renee French, used Gopher image created by Maria Letta
  1. part: improving the service
  2. part: upgrade for web
  3. part: adding SSE
  4. part: simple javascript frontend functionality
  5. part: frontend — backend communication
  6. part: server-side logging
  7. part: run it all in docker
  8. part: adding database container
  9. part: database — service communication

Addition 1: functions, methods, pointers and interfaces
Addition 2: websocket communication
Addition 3: socket communication

Why would you want to create a service?

With Go programming language you can use the final executable the same way on Windows, Linux and MacOS (by generating proper executable). But you cannot install this executable as a service using standard system tools like sc.exe, systemd or…


With a real world like example

Original Gopher image created by Renee French, used Gopher image created by Maria Letta

This article can be treated as a second part for a previous article about web-socket communication, written by Petr Jahoda.

Because there was an interesting discussion at reddit, suggesting using SSE, GRPC, Message queues (and there are plenty of others), I thought about making an article on (comparing) those communication protocols.

But in the end, I decided otherwise.

I see all those protocols as something that is adding more code to your project. I mean, you have to import something. You have to use an additional library.

And I wanted something, that have less code below. Make it simpler. But…


With a tip, when running Go programs in Docker

Original Gopher image created by Renee French, used Gopher image created by Maria Letta

This article was written with one idea in mind: to show you, how to make a communication between two Go programs, using WebSockets. The simplest possible way.

This article is a standalone addition to series of articles by Petr Jahoda and it would be wise to incorporate this type of communication to proper service behaviour (part 2 of the series).

When using WebSockets, one program has to act as a server.

But there can be numerous other programs as clients. In this article we will create one server and one client. Goland will be our IDE of choice.

WebSocket Server

The code…


In one simple example

Original Gopher image created by Renee French, used Gopher image created by Maria Letta

This article was created especially for my son, who had hard times understanding using pointers and interfaces.

To make the explanation complete, I added (with his help) two things: functions and methods. I see those two as a complement to pointers and/or interfaces. Or vice versa.

This explanation is divided into six parts, each part adding onto previous part. I tried to make it all as simple as possible. If you find an error, please don’t hesitate to make a comment.

1. The basics

We will start with something very simple. We are creating two structs: Car and Truck. …


Prepare your tea or coffee, this will take some time

Photo by Lee Hull on Unsplash

Chapter I.

Where to begin?

So many thougts. Never-ending stream.

Why? When? What to do? What’s the purpose of it all?

I honestly don’t know, how to deal with it all. I even don’t know, why I am writing this. But I read once, that it helps. You can get rid of those dark thoughts, when you write down, what you have in your head. And I have a lot of those dark thoughts. Oh yes, I do.

We have a son. Fourteen years old. Once he came to me, frightened. Scared. Something warm popped inside his head and he didn’t know, what’s going on.


Few months ago, I did two benchmarks. The first one tested three database engines and the second one only PostgreSQL.

You can find those benchmarks in those two links below. Both articles are written by Petr Jahoda.

Because there were some ideas about this benchmark, I decided to make another one on PostgreSQL only. You can find that article in the link below.

While reading through responses to this latest PostgreSQL-only article (and on Reddit), there were numerous request to do the same with MySQL based database. …


Using Jetbrains Rider

This will be a short and quick tutorial on “how to use Jetbrains Rider to upgrade application from .NET Core 2 and/or .NET Core 3 to .NET 5”.

There are numerous ways, how to do this exact thing. In this article, we will make a new .NET 5 project and use everything from an old project. In the end, we will have two projects: the old, working project (in case something goes wrong) and a brand new .NET 5 project.

There will be only a few steps and the upgrade (depending on the size of your project) is easily understandable…


Few months ago, I did two benchmarks. The first one tested three database engines and the second one only PostgreSQL.

You can find those benchmarks in those two links below. Both articles are written by Petr Jahoda.

Because there were some ideas about this benchmark, I decided to make another one. This time, we will be testing PostgreSQL 13 only, on linux machine, using AWS, and the test will be using the same code as before.

We will have four tests:

  • database running in Docker, program running natively
  • database running in Docker, program running…


After some years of making programs for all kind of tasks, I would like to share some performance tips, regarding to databases.
Because all those programs have one in common. They all communicate with different databases. Different programs, different programming languages, different kind of tasks, different databases.

But those tips are not “database based”, so this article is not about tuning your database, creating tables and setting up indexes.

Those tips are for those of you, who are making programs, that have to communicate with different kind of databases.

In this article, when I am writing “you”, sometimes I mean…


Using Go as a programming language

Photo by M. B. M. on Unsplash

If you are trading Forex (or trading something at all), chances are, you heard about something named Monte Carlo Simulation.

In short, Monte Carlo Simulation is a program, that gives you some pseudorandom output (amount of pips, in this case) for given input (number of winning/losing trades, number of pips, …) .

But… you know…. an example would be better.

Example

Let’s say you paper traded 100 trades. You did it really well and you were absolutely honest with yourself.

You know, for sure, that if you traded those 100 trades in reality, the result will be exactly, what your paper…

Petr Jahoda

Love programming, math, running and piano

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