Auth 101: Your Guide to AuthN, AuthZ, and Friends

I had a serious conversation with my dad the other day. He poured me a glass of whiskey, and said gravely: it’s time. You should overcome your fears and sort Auth stuff out. In this article we will be answering questions as following: Services and concepts that we will be exploring include:(1) AuthN, (2) AuthZ, […]

READ MORE

AWS Nodejs14.x is no longer supported

Suppose you run into this exception while deploying your infrastructure using CDK v1 code to AWS: And you think: wait, I don’t have any lambdas, why do I keep receiving this? The thing is that CDK v1 implicitly creates lambda functions to support some functionality. For example, when you create S3 bucket this way: CDK […]

READ MORE

Reading AWS Kinesis Data Stream messages from the console

Suppose we want to read AWS Kinesis Data Stream messages from the console. We can make it happen, as long as we have AWS CLI installed and configured. Get main stream information: Get stream shard list: For intance, we want to read shardId-000000000000. We should get shard iterator for the beginning of the stream for […]

READ MORE

Solving Django N+1 problem

In this article, you will find answers to the following questions: Optimizing Django model relation queries with select_related and prefetch_related When working with Django models, you may run into inefficient queries. This can have a significant impact on performance, especially when dealing with large datasets. Django’s select_related and prefetch_related methods are powerful tools to improve […]

READ MORE

Python build object from json and back

Suppose you need to have bilateral conversion from json to object and vice versa. So, in this article you’ll find out how to: Build object from json Convert object to json If you need to rename some of the properties in the target json, you can make it this way: Here you go!

READ MORE

Safe database migrations in Django

The simple process of renaming a DB column becomes more complex when DB migrations in specific scenarios are applied before code updates by pipeline. It means that there may be a timeframe, when the “old” code will be running against the “new” database. Therefore, using the built-in Django rename functionality will lead to errors. “Old“ […]

READ MORE

gRPC cannot assign requested address

Suppose you just run into this exception, saying that gRPC cannot assign requested address: TL;DR: most likely you opened too many connections, and you run out of ephemeral ports. Consider channel/stub reuse: https://mchesnavsky.tech/grpc-channel-stub-reuse. Details: first, we should distinguish between fixed ports, and ephemeral ports. Ephemeral ports are typically used by client devices initiating communication with […]

READ MORE

gRPC channel / stub reuse

Creating new gRPC channels and stubs involves establishing connections and negotiating capabilities with the server. Reusing them eliminates this overhead for subsequent calls. By keeping connections alive, you avoid the initial handshake delay for each RPC, leading to faster communication. However, you should ensure that reusing the channel doesn’t create a bottleneck in your application. […]

READ MORE

Datadog APM monitor trace count discrepancy

You may run into a case when your Datadog APM monitor, configured for trace counting, shows weird, usually low number of traces, compared to Trace Overview section. Look at this monitor: It shows 4 spans: However, Trace Overview shows 28 spans/traces for the same time range: The main question here: why? There is a tool […]

READ MORE

Datadog + Spring Boot QuickStart

First things first, we can generate the starter project using https://start.spring.io/. Select these dependencies: Then, using documentation here we should set API Key, Application Key and Datadog URI in application.properties file: You can get your API Key and Datadog URI from startup Datadog screen: By the way, Datadog has a trial period. Application Key can […]

READ MORE