Tomas Tulka's Blog

Random thoughts about programming and other stuff.

Testing Serverless Systems

Designing a system architecture is always about making tradeoffs. Microservices resp. serverless architecture has a lot of benefits, but some drawbacks as well. One of them is testing. Testing serverless systems is hard. In this article I will discuss some practices which work for my project.

Secure Communication between Services in Multitenant Systems

Implementing a SaaS as a multitenant system brings a lot of benefits. As usual, there are some tradeoffs, too. For example security becomes more complex. Let's take a look at possible approaches when implementing security in a multitenant architectrure.

Multiple LDAP Servers Integration

When an administative solution (like Global Catalog) is not possible or wanted and we have to integrate more LDAP servers under one hood there is a simple way how to do it with MyVirtualDirectory.

Meaning of Queues and Topics in AWS

Queues and topics are standard communication channels in messaging systems. How to use then in AWS, for example to implement the Competing Consumers pattern?

Debugging jasmine-ts in IntelliJ IDE

TypeScript application wants tests to be written in TypeScript as well, right?

Pitfalls of Processing a Stream from an External Program

Let's image an external standalone program producing a big amount of binary data. Good example is a files converter (images, mp3s, documents, etc).
How to design such a program and what are the pitfalls of the approach?

Synchronized Methods vs Semaphore

When one-thread-access is too restrictive, and we want to allow more threads to our resource then come semaphores on the stage.

But there is one important difference in these approaches.

Managing Asynchronous Tests

It's recommended to avoid any asynchrony within the scope of test, but this is unfortunaly not possible everywhere. In some systems the caller must wait for another thread or transaction to be completed.

Testing asynchrony could be pretty tricky, not always is clear how long must a test wait for a result to be delivered - if it's too little the test fails event when the tested functionality works, if it's too long the test is just wasting time (so expensive especially in the commit stage).

So, how to deal with this problem? 

How to Effectively Protect Critical Section

Not everywhere could be immutable objects used to ensure thread-safe code.

JSON Mock Data Generator

It's easy to generate test mock JSON data for a small HTTP request or a similar use, because there is a planty of online tools providing this functionality for you.

But what if you want to generate data for a database performance test for systems like MongoDB or Elasticsearch?