Scaling Loki: From a Simple Monolith to a Distributed System In the world of observability, every tool starts with a promise of simplicity. Grafana Loki is a perfect example. It’s a logging system designed to be lean, cost-effective, and easy to run. For anyone starting out, deploying it as a single, monolithic instance is the obvious first step. It handles ingestion, storage, and querying in one…
Introduction In today’s complex IT landscape, understanding system behavior is no longer a luxury, but a necessity. Traditional monitoring often falls short, providing only snapshots of isolated metrics. This is where observability comes in – a powerful approach that goes beyond traditional monitoring by providing deep insights into how your applications and infrastructure function. At the…
Introduction : The Grafana Ecosystem Traditionally, Grafana was used primarily to visualize timeseries data. Its usability was limited to providing a dashboard on top of timeseries backend like Elasticsearch or Prometheus. But over a decade now, Grafana isn’t just a visualization tool anymore; it’s an ecosystem of tools working together to give you a crystal-clear insight of your…
Introduction In web application space, there are a few strategies that can be used to retrieve real-time data from the server. Some of the most popular ones are: Continuous polling. Web sockets. Server Sent Events (SSE). Managed Cloud services like PubNub, Firebase realtime database/function etc. Push notification services like OneSignal, Firebase push notifications etc. In this post, we will…
Introduction The context package in Go provides a mechanism to prevent the application from doing unnecessary work, hence preserving resources. The context in go it used for following purposes: Carry deadline information: e.g. cancel the current task after a given timestamp. Carry cancellation information: e.g. when a user has exited the website, stop any operations that were initiated. Carry…
Introduction This blog will explain how to create small docker images for Go applications. Small docker image sizes are desirable for several reasons. Small attack surface: Selective tool installation on the docker images to provide better control on the tools available to the container runtime. Quicker rollouts: Smaller images are quicker to pull from the container registry and deploy. Cost…
Introduction In the systems integration space, a common scenario for an application is to acts as a middleware proxy between the client and the target server. On one side, this approach can drain out the resources on the middleware during timeouts or high network latency because of heavy computations on target or middleware server. On the other extreme, this can spam the target server during high…
Introduction ReactiveX is an API for asynchronous programming with a bounded or unbounded stream of data. In this programming model, the stream of data is called an Observable . We also define an Observer that subscribes to the observable and reacts to the emitted events. Reactive programming also defines a set of Operators to create and compose Observables. Using this programming model helps us…
Introduction There are several concurrency models supported by different programming languages. For example, actor-based concurrency model in Erlang and Akka toolkit, Thread based concurrency in Java and Futures and Promise based concurrency in functional programming languages like Closure. Go advocates concurrency using a programming model called CSP (communicating sequential processes), which…
Introduction In a typical microservice landscape, a business process can trigger individual transactions across multiple microservices. Since each microservice (by definition) controls its database, transaction management in such systems could be a tricky process. To add more complexity, the business transaction could be a long-lived process, where each service participating in the business…
Introduction At Sysco AS, we are developing a serverless integration platform on GCP. Being the integration provider between third parties, a common requirement is to securely save user secrets (eg API-keys) so that we can call the third-party services on behalf of users. In order to securely save these credentials with us, we have a few requirements: Save customer secrets securely.(Encryption)…
Introduction In this post, we will learn how to configure TLS encryption in Go. We will further explore how to set mutual-TLS encryption. The code presented in this blog post is available here. In this post, we just show the relevant snippets. The interested readers can clone the repository and follow along. We will start by writing a simple Http server and a client in Go. We will then encrypt the…
Introduction Remoto is an RPC framework written in Go. You can use it to set up RPC services in Go while keeping codebase fairly simple. It is intuitive, elegant and has a gentle learning curve. Remoto lets you define your service with a Go interface, and generate everything you need to build and consume the service. Unlike other frameworks, it provides just the bare minimum to get started,…
Introduction I have been reading up over this summer on the infamous man-in-the-middle (MITM) attack. Wikipedia defines an MITM attack as: an attack where the attacker secretly relays and possibly alters the communications between two parties who believe they are directly communicating with each other. The attacker puts itself between two parties to eavesdrop and alter the traffic. In this blog,…
Introduction Fun fact: The HTTP server implementation in Go is under 4000 lines of code (including comments). If you are a Go developer in 2019, you are in luck as you no longer need to read tons of cryptic documentation. Instead, you can focus on net/http package in the standard library and understand (almost) everything about HTTP at the server side. An impressive feature of Go is the inbuilt…
Introduction Google’s firebase is a suite of tools, geared towards creating secure and scalable modern applications. In this post will focus on firebase-authentication. Firebase Authentication supports Email/Password, Federated ID provider integration (github, facebook, google), phone number authentication, anonymous logins out of the box. You can also hook in your custom authentication…
Hello, I am Prakhar Srivastav I am a software engineer based out of Norway. For my day job, I work at Cegal AS as a developer. I love programming in Go and I am fascinated by cloud technologies and managed software platforms. Outside my work, I love to learn, evaluate new technologies and share my learnings. Get to know more about me at: Github LinkedIn Thanks for stopping by. Prakhar