Mariusz Krzanowski blog

Tag: How to

Long polling as a cure for message push mechanism

Introduction

Many times in your life, you will have the situation when your server must push information to your customer. When you are not limited to HTTP/HTTPS you can setup TCP/IP connection and problems are solved. Unfortunately we are living in a world dominated by HTTP protocols. When you ask someone how to address such a challenge you can hear from your colleagues that Webhook (https://en.wikipedia.org/wiki/Webhook) is a solution for your problem. My goal is to convince you to try to think outside the box and focus on long pooling mechanisms.

Azure Functions V3 and disappearing function.json files

Introduction

When I started migration process to Azure Function 3.0 of an existing project, I have discovered small, but painful inconvenience. The problem was that all function.json files were permanently removed from output folder just before Azure Function Tools func.exe was started. I have to confess it was very annoying. There were suggestions e.g. on StackOverflow or other sites to run PowerShell which copies files later – after emulator is started, but it was not a solution I like.

Intensive cache miss

Introduction

It is common knowledge that using cache can speed a lot our applications. In this post I would like to focus on application design using cache. The simplest scenario using cache that I frequently see follows this algorithm.

Idempotence in sending e-mail

When you build a distributed system it is difficult to design good transaction guarantee mechanism. If your communication is asynchronous, you communicate with remote services using some messaging system. I guess you already know that network is not reliable, so your message can be lost. To guarantee message delivery you have to resend it when confirmation is missing. There are solutions to guarantee idempotence for the service receiving data. What I want to share is my idea how to make sending e-mail service as close as possible to the idempotence solution.

Developing workflow without workflow engine

Disclaimer

Workflow engines are very advanced tools and I saw a lot of projects where they created great business values. They sometimes simplify development. In this article I do not argue that you should not use them. My goal is to show you that there is an alternative – transformation from workflow into set of services distributed in the future.

SQL Trick – Multiple Values Query

Sometimes system flexibility makes the solution complicated 😉 . Imagine a ‘simple’ situation that you have a system in which a client can define new attribute and assign multiple values to it. Later, the client can assign these values to the Customers. If you do not plan to develop new attributes’ set every time a client wants to make a change, you will need to prepare a ‘dynamic’ structure in the database.

Resolving AD groups membership

Big companies have huge internal structures. The problem they have is that huge structures have to be mapped into a permission model. One company I worked for had over 300k groups in Active Directory. As worldwide organization they have multiple domains in AD forest. Of course, various groups have various memberships so the structure was really complicated.

SQL – always sort by unique key to guarantee correct paging

SQL query engine is prepared to return correct results as soon as possible. But correctness means being correct from mathematical perspective. Problem that I will describe is obvious, but it is not what you sometimes expect from SQL engine.

Two-factor authentication

While making plans for my travels, I was wondering how to protect my administrator access to remotely accessible NAS. I noticed that this device offers two-factor authentication mechanism, which should increase security. This article will focus on this specific high level implementation.

Powered by WordPress & Theme by Anders Norén