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

AWS EventBridge Rule AND operator

In this article you’ll find an answers to these questions: Suppose you want to use two checks for a specific field. Consider the following test event: After some struggling, you may end up with a rule that looks something like this: At a glance, this rule should match events only when event field custom looks […]

READ MORE

AWS EventBridge Rule Emulator

Suppose you have to develop an AWS EventBridge Rule. Most likely, you want to test it with a bunch of edge-cases. It might be the case when actual event emission is not very easy or you really want to know your event work correctly before deploy. All you need to do is make use of […]

READ MORE

gRPC transport and channel providers

Let’s discuss some details around that how gRPC manages transport providers. Remember, that we have two closely related concepts in gRPC: If you didn’t familiar with NameResolvers, I strongly encourage you to peruse previous part of our narrative here: https://mchesnavsky.tech/name-resolution-providers. This article will be about the latter. Alright, we should elaborate, that a gRPC channel […]

READ MORE

gRPC name resolution providers

We have something special today. It all started with that I updated grpc-java version from 1.43.2 to 1.60.0. Alright, I just updated dependency and anticipated it working. However, I run into exception on ManagedChannel build at the client side: Exception I got looks like this: Another modifications: If you’re looking for the simplest & quickest […]

READ MORE