The infrastructure of the system must be managed using an IaC tool. Period. In our case, we prefer to use Terraform as a tool that doesn’t depend on a specific cloud provider to manage the infrastructure, and we like to version control the entire infrastructure source code.
In this post, we focus on provisioning a multi-region infrastructure with Terraform in AWS.
Read the full post here.
The infrastructure-as-code concept allows you to manage an entire cloud infrastructure in a declarative way. AWS provides the CloudFormation service to enable the modeling of the entire infrastructure and application resources using a text file or programming languages in an automated way. Even though it’s very simple to learn and use, its main downside is that it’s tied to AWS only, and if you manage a multi-cloud infrastructure that consists of applications deployed in AWS, Azure, Google Cloud, etc., then you would use Terraform to build, change, and manage infrastructure in a safe and repeatable way throughout the clouds.
When developing a web application, you may decide to serve the landing page along with every static file through a CDN for better performance. CloudFront is a CDN offered by AWS that allows you to serve your content from different sources, known as origins, like S3 or a Load Balancer. Your application’s static files or dynamic data will be served through these origins to your users.
But during the development process of the application, you would need to host on AWS. …
When your application is ready to roll out in production, monitoring every single activity related to it has a significant impact on its performance. You might need to analyze the server’s CPU utilization, network bandwidth, number of connections that it serves at the same time and so on.
AWS provides a monitoring service called CloudWatch, which would enable you to monitor different metrics for the servers your application is hosted on and store these metrics for later analysis. However, your application might be generating custom internal logs that are related to different business events: are they executing as expected, how…
A Docker Container is a lightweight executable program that includes everything from a runtime to system tools and libraries to run an application. When containerizing an application, we might often need to execute different commands inside the container — e.g., for debugging purposes or for running the application manually.
There are three ways to execute different commands inside a Docker container, and I’ll discuss each method in this article.
When building an image for an application, we need to specify a Dockerfile that’d contain instructions on how this image is going to be created and what application it’s going to…
Running multiple concurrent threads requires special attention when they access (perform read and write operations) the same memory block. The piece of code where this memory access happens is called a critical section, and thread access should be synchronized in order to avoid a race condition. In Java, synchronizing the access to critical sections can be done using different mechanisms: Monitor, Lock and Semaphore.
In this article, I will give a thorough comparison between these mechanisms, while trying to synchronize the well-known Producer-Consumer problem. The following code shows the basic Buffer data structure implementation. …
Displaying long lists of items in a client application requires strict attention, as it’s well-known that the application performance can degrade rapidly while trying to render lists with hundreds or even thousands of items.
This happens since the browser must render the entire page and all the data inside it upfront, before showing it to the end-user, and as such, rendering thousands of items in a list would lead to great frustration.
Fortunately, we can use the virtual scrolling technique to address this problem.
From a high-level perspective, virtual scrolling allows the client to render just a small portion of…
When trying to design a solution architecture where the application can generate and store private files on a storage option like S3, and allow the possibility for these files to be accessed by specific users for a certain amount of time, and still remain private, we could follow two different approaches based on a real use case scenario.
Let’s write down some use cases and see how we can approach the best solution:
AWS S3 storage offers four ways of server-side data encryption:
Suppose that we are building a web application that would store data on S3, and that data should be encrypted using a private key that would be only known to the application.
In this scenario, we would utilize
SSE-C data encryption, where the application is responsible for creating…
One common misunderstanding, especially when testing reactive streams, is treating synchronous data sources as asynchronous. In this post I will try to explore the differences between synchronous and asynchronous data sources, along with respective examples in
Every reactive library offers the possibility to create a stream from different types of data. For this example, we are going to take into consideration a simple array [2, 12, 35] that will be wrapped into an observable:
const sourceA = from([2, 12, 35]);
This example indicates that when the observable is subscribed to, the values of the…
Software Engineer | AWS Solutions Architect