2023 Achievements

| Comments
2023 Achievements

This blog has been on hold since 2020, and every year I’m thinking of restarting it. This year is no exception.

The stopping factor was that it’s the technical blog. Yet, I write a lot during journaling and when preparing YouTube videos. I don’t know if I’ll be able to transform them into blog posts, but I’ll try.

How to replace azure-storage

Continue of previous task.


from azure.storage.blob import BlockBlobService, ContentSettings, PublicAccess
BlockBlobService(
                account_name=cluster_config["config"]["AZURE_STORAGE_ACCOUNT"],
                account_key=cluster_config["config"]["AZURE_STORAGE_KEY"],
            )
storage.create_container(container_name, public_access=PublicAccess.Blob)
        storage.create_blob_from_bytes(
            container_name, blob_name, content, content_settings=ContentSettings(content_type=content_type) 
block_blob_service.create_blob_from_stream(
                folder_name, filename, content, content_settings=ContentSettings(content_type=mimetype)
            )                       

from azure.storage.blob import ContainerClient, ContentSettings, PublicAccess
account_name = cluster_config["config"]["AZURE_STORAGE_ACCOUNT"]
        account_key = cluster_config["config"]["AZURE_STORAGE_KEY"]
        account_url = f"https://{account_name}.blob.core.windows.net"
        container_clients.append(
            ContainerClient(account_url=account_url, credential=account_key, container_name=container_name)
if not container_client.exists():
            container_client.create_container(public_access=PublicAccess.Blob)  # exception, or overwrite true
        container_client.get_blob_client(blob_name).upload_blob(
            content, content_settings=ContentSettings(content_type=content_type)            , overwrite=Tru

How to use asyncio gRPC in AioHTTP microservices

| Comments
How to use asyncio gRPC in AioHTTP microservices

Usually I have a lot of microservices and they communicate using REST API. For communication with frontend I still need REST, but between microservices gRPC looks more promising.

Some benefits of it:

  • is built on HTTP2, using multiplexed streams - better connection management
  • performance benefits because of Protobuf binary format
  • code generation for a multilingual environment

Here is my first attempt to use gRPC in AioHTTP applications with some explanations.

« 2/13 »