<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amit Kumar Batra on Medium]]></title>
        <description><![CDATA[Stories by Amit Kumar Batra on Medium]]></description>
        <link>https://medium.com/@amit2067?source=rss-d2bea39fd696------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mqApgmyjF2mlvLGeQS-jNA.jpeg</url>
            <title>Stories by Amit Kumar Batra on Medium</title>
            <link>https://medium.com/@amit2067?source=rss-d2bea39fd696------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:51:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amit2067/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Amazon ECS security patterns and practices]]></title>
            <link>https://medium.com/@amit2067/amazon-ecs-security-patterns-and-practices-3841deaaaea4?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/3841deaaaea4</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[ecs-fargate]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 21:49:16 GMT</pubDate>
            <atom:updated>2024-06-17T20:43:39.426Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>ECS Architecture</strong></p><p>Let’s do a quick recap on how ECS architecture looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rqObfEkxV-n9VxHf" /><figcaption>ECS Architecture</figcaption></figure><p>You have a container which packages up the application or software you need to run. These container run as part of tasks in the ECS cluster. The tasks run either standalone or as part of services in ECS. The services are logical objects in the ECS cluster.</p><p><strong>What is Container Security?</strong></p><p>As you know, container is a package which contains your application code, the dependencies required by your application, any configuration required by your application and the runtime required by your application. Hence it becomes important that you have secured everything inside the container. Let’s understand the security aspects of the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yGaH8JjJJj73E_aq" /><figcaption>Container</figcaption></figure><p>Container is packaged up using application code. It is important that your code is secure. How can you ensure that ? You can ensure this by performing a static code analysis of the application code. There are various tools and technologies available to help with static code analysis. You also need to perform security scanning of open source dependencies which are part of your application. Open source dependencies scanning ensure that your application does not bring any vulnerabilities from third party libraries. There are various tools and technologies available to help with this.</p><p>Aside this, you also need to perform scanning of container images. Container image scanning would identify whether there are any vulnerabilities in the container image e.g. vulnerabilities from base images etc.</p><p>Another best practice is to not run the container as privileged. A privileged container is a container that has all the capabilities of the host machine, which lifts all the limitations regular containers have. Practically, this means that privileged containers can do almost every action that can be performed directly on the host. So do not run privileged containers.</p><p>One other best practice is to run container with a non root user. Root user have full root permissions on the containers which can allow the user to perform over permissive actions.</p><p><strong>ECS Task security</strong></p><p>Now let’s discuss the security of ECS tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*tc-s_LQgNbklNsOj" /></figure><p>As you know ECS task does contain a container or multiple containers. Best practice is to run one business container along with any sidecar containers which are required by business container.</p><p>When you create ECS tasks, you define and attach security groups to the ECS tasks. You need to ensure that security groups attached to ECS tasks are hardened with least permissive inbound and outbound rules. In ECS task, you have two types of rules — Task role and task execution role. A task role is the role which is used by the application running inside your task. For example, let’s say you have a Java application running within the ECS task, your java application needs to read a secret from AWS secrets manager in order to connect to the database. Task role is that IAM role which will contain the permission to retrieve that secret.</p><p>On the other hand, Task execution role is the role which is used by ECS to execute the task. For example, Task execution role needs to have permissions to pull the container image from the registry. Both the task role and task execution role should have least permissions assigned for the purpose they need.</p><p>Another best practice is that all the secrets which are required by the application running within the task should be stored into a third party secret manager service. These secrets should not be referenced as environment variables in ECS tasks.</p><p>All the AWS ECS API calls must be logged in the Cloudtrail so that they can be monitored for any security misconfigurations or incidents.</p><p>One other most important security best practice is to use awsvpc mode for task networking. If you use awsvpc mode, ECS creates and manages an Elastic Network Interface (ENI) for each task and each task receives its own private IP address within the VPC. This ENI is separate from the underlying hosts ENI.</p><p><strong>ECS security — other considerations</strong></p><ul><li>Encrypt the ephemeral storage (if using Fargate)</li><li>Limit the use of ECS exec unless it is a business requirement</li><li>Runtime security of workloads using third party solutions</li><li>Monitor and log the activity</li></ul><p>Thank you for reading this through. I hope you enjoyed reading this and learnt something out of this.</p><p>You can also look at my youtube channel where I publish tech sessions.</p><p><a href="https://www.youtube.com/channel/UCediCUfarP52F_a_ZwcocHw">https://www.youtube.com/channel/UCediCUfarP52F_a_ZwcocHw</a></p><p>If you would like to connect with me on LinkedIn, here is the QR code for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x-8J9IRx431he1Mp" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3841deaaaea4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon ECS Observability — patterns and practices]]></title>
            <link>https://medium.com/@amit2067/amazon-ecs-observability-patterns-and-practices-4dc1228cc811?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dc1228cc811</guid>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[x-rays]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[ec]]></category>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 21:10:11 GMT</pubDate>
            <atom:updated>2024-04-14T21:10:11.744Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon ECS Observability — patterns and practices</h3><p><strong>What is Observability ?</strong></p><p>Let’s understand first — what is observability?</p><p>“Observability is the ability and mechanism to measure the state of an application or system by inspecting its own output. “ So if I simplify this for you, let’s assume that you are running a microservice on a platform, the observability is a mechanism to measure that state and health of that microservice.</p><p>Observability has become much more important in recent years as organisations have moved to Cloud or are moving to Cloud and these cloud-native environments are complex, and the potential root causes for a failure or anomaly is much more difficult to find out in the Cloud environments.</p><p>There are 3 key pillars of observability — Logs, Metrics and Traces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*sJ9J78jbjQmqNPPt" /></figure><p>Logs — Logs are configured by your application to be stored in a file. Applications are written in a way that they produce logs. Logs are vital for observability because they provide context and state of your application.</p><p>Metrics: Metrics are the representation of the health of your application, infrastructure or a service. For example, let’s say you are building an API, Metrics would tell you how much data your API is processing per second, per minute etc.</p><p>Traces: Traces are also referred as distributed traces. A distributed trace tracks a specific request which is coming to your application or API. For example your API might have 3 microservices communicating with each other to form a result for the end user. Now a trace tracks all this internal communication and workflow around it.</p><p><strong>ECS observability — logging (CloudWatch &amp; other options)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*7Z8iDqlRapjgeR0M" /><figcaption>ECS logging — CloudWatch and other options</figcaption></figure><p>In AWS, standard service for logging is Amazon CloudWatch. Amazon CloudWatch monitors your AWS resources and the applications you run on AWS in real time.</p><p>Let’s understand from the above diagram. We have couple of microservices running inside an ECS cluster. These microservices are implemented by services in ECS. one service in ECS can contain multiple tasks or instances of a task.</p><p>All the logs generated from these microservices or the tasks are fed to CloudWatch, by adding a simple configuration in the service.</p><p>ECS applications can also send logs to other services such as S3, OpenSearch or Kinesis Firehose by using AWS Firelens. FireLens is a container log router for Amazon ECS and AWS Fargate that gives you extensibility to use the breadth of services at AWS or partner solutions for log analytics and storage. FireLens works with Fluentd and Fluent Bit. This means you can use one of the many plugins, including <a href="https://github.com/aws/aws-for-fluent-bit">AWS for Fluent Bit</a> or bring your own Fluentd output plugin.</p><p><strong>ECS observability — metrics (CloudWatch Container Insights)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*BI8XU-aTYmqbMd26" /><figcaption>ECS Metrics — CloudWatch container insights</figcaption></figure><p>To collect metrics from Microservices running on ECS, Again AWS CloudWatch is the preferred option. It collects standard metrics from your instances running inside ECS cluster. However, CloudWatch container insights is a feature in CloudWatch which is used by many organisations and is vastly popular for collecting metrics from containers running in ECS cluster.</p><p>You can use CloudWatch Container Insights to <strong>c</strong>ollect, aggregate, and summarize metrics and logs from your containerized applications and microservices. It collects instance level metrics as well as CPU, memory, network usage etc.</p><p>Then you can visualise all this data on CloudWatch dashboards.</p><p><strong>ECS observability — metrics (other options)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/0*85VTA-My7YjC0-6a" /><figcaption>ECS metrics — other options</figcaption></figure><p>There are couple other options to monitor your application running on ECS.</p><p>First one is — Amazon managed Grafana. Amazon managed Grafana is a scalable and secure service which runs Grafana. Supports monitoring of ECS, other AWS native services and third party as well.</p><p>Second is Amazon managed service for Prometheus. Amazon managed service for Prometheus is prometheus compatible service for metrics to securely monitor container based applications.</p><p><strong>ECS observability — traces (AWS X-Ray)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*XQVy1cyTz-MC-8aK" /><figcaption>ECS Tracing using AWS X-Ray</figcaption></figure><p>AWS X-Ray is a standard service for distributed tracing in AWS. AWS X-Ray collects the traces from containerized applications on ECS. X-Ray is most suitable for distributed applications or microservices based applications. X-Ray is a great choice to analyze and debug distributed applications.</p><p>To configure X-Ray for containers running in ECS, you can run an X-Ray daemon as a sidecar container in the ECS task. So the real application container which is your business container, will send send the traces to this sidecar container and X-Ray daemon running on that sidecar container pushed the traces to AWS X-Ray service. That’s how tracing workflow can be created for your ECS based applications.</p><p><strong>Best practices for observability on ECS</strong></p><ul><li><strong>Cost-effective and clean logging: </strong>Implement the logs what your application requires. Do not add unnecessary logging into your application.</li><li><strong>CloudWatch for observability: </strong>Leverage CloudWatch for logging and metrics for your ECS applications<strong>. </strong>You can also opt for third party solutions for observability.</li><li><strong>Leverage X-Ray for tracing — </strong>It allows you to effectively debug your microservices in a distributed production environment.</li><li><strong>Alerts and Alarms: </strong>Set alerts and alarms based on the various different thresholds.</li></ul><p>Thank you for reading this through. I hope you enjoyed reading this and learnt something out of this.</p><p>If you would like to connect with me on LinkedIn, here is the QR code for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QY074DkmRvX0CjFO" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dc1228cc811" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals of SaaS Architecture]]></title>
            <link>https://medium.com/@amit2067/fundamentals-of-saas-architecture-c824f82b888b?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/c824f82b888b</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Sun, 24 Dec 2023 18:38:11 GMT</pubDate>
            <atom:updated>2023-12-24T18:38:11.654Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>About me: </strong>My name is Amit and I am a software architect. In this blog, I am going to cover fundamentals of SaaS architecture. This blog is a worth read if you are a SaaS customer or you want to purchase a SaaS subscription. This blog is also a worth read if you want to start a SaaS business and want to learn some fundamentals.</p><p><strong>What is SaaS ?</strong></p><p>Saas is a <strong>Business and Delivery Model.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FnIQgJpwEdTet_l4" /><figcaption>SaaS busines fundamentals</figcaption></figure><p>First of all, let’s clear a misconception that a lot of people have that SaaS is a technology or a tool. No, SaaS is not a technology or a tool. SaaS is a business and delivery model for a software or application. Software as a Service (SaaS) is a software distribution model that delivers applications to end-users through the Internet. A SaaS organization or SaaS business provides its software through a subscription based purchase. SaaS organization makes their service available to its users via internet and then users make recurring payments to the SaaS organisation. Some examples of SaaS companies are Salesforce, Hubspot, Zoom, Slack and many more.</p><p><strong>Classic Software Delivery Model</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wBD6OHu_XK-EpAGw" /><figcaption>Classic Software Delivery model</figcaption></figure><p>Let’s understand the classic software delivery model or a non SaaS delivery model. In Non SaaS model, customers buy software from an organisation. Organisation can make the software available via different components or container images or in some other form. Then as a customer of the company, you need to deploy all those components or container images or other types in your own infrastructure. You can use a public cloud, private cloud or data centers to deploy that infrastructure. In this model, there are challenges.</p><p>As shown in above diagram, let’s say, there are multiple customers of the company. When customer 1 purchased the software, it was on version 1.1. Now company added a new feature into their software and released the version 1.2. So customer 1 is outdated on their latest feature, however if a customer 2 now buys the software, they would get the newer version 1.2 of the software. So company would now provide customer 1 with the version 1.2 software and they again need to deploy the version 1.2 in their infrastructure. This keeps going on and on. It becomes a challenge to maintain to the latest version of the software.</p><p>So with the classic software delivery model, customer need to manage and operate the software such as deployment and version upgrades etc. and these deployment and version upgrades lead to longer release cycles.</p><p><strong>So what is SaaS Architecture ?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5SNMwui6QusAQ5DV" /><figcaption>SaaS Architecture</figcaption></figure><p>To address the challenges of this classic software dilemma, organisations turn to the SaaS model that allows them to create a single, unified experience that allows their customers to be managed and operated collectively. In the SaaS architecture, the organisation makes all their code, databases and servers available as an Application to the users via Internet.</p><p><strong>SaaS Architecture tenancy models</strong></p><p>At a high level, there are two tenancy models when building a SaaS architecture.</p><ol><li>Single tenant Saas model</li><li>Multi tenant SaaS Model</li></ol><p>P.S. Tenants are customers who pay for Saas services from a SaaS provider.</p><ol><li><strong>Single Tenant SaaS architecture</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LTT4EH_CvGVoglpd" /><figcaption>Single Tenant SaaS Architecture</figcaption></figure><p>A single-tenant architecture serves a single customer who is paying for that software service. It means, the tenant gets their dedicated software instance, a single infrastructure, server, and database. The architecture greatly benefits buyers since they don’t have to share their database resources with other customers. Moreover, buyers can even customize the software according to their business needs and scale up or down whenever they want.</p><p>For example, <strong>Oracle Cloud </strong>utilizes a single-tenant architecture to provide a private cloud SaaS environment. Oracle Cloud services hosts separate compartments with isolated resources and granular access control.</p><p>2. <strong>Multi-tenant SaaS architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JZqBtDPXx2IiuV_U" /><figcaption>Multi tenant SaaS Architecture</figcaption></figure><p>Multi-tenant architecture is one of the most preferred types of architecture while designing a SaaS application because of its core characteristics. By definition, every single instance of this SaaS model serves more than one tenant. This means, all the clients share a common database and application information — with the exception that every tenant’s data are secured.</p><p>Google Workspace, is a perfect example of a multi-tenant SaaS architecture. Several tenants have access to a single application over the internet. Tenants utilize the common database of Google Cloud to access their free 15GB of data. But while the resources are shared, all personal information of clients is secured and stored separately to maintain the highest levels of privacy and data security.</p><p><strong>SaaS customer benefits</strong></p><p>If you are customer of a SaaS organisation, then you get many benefits such as.</p><ul><li>Flexible billing option and subscription policy</li><li>Cost efficiency compared to classic delivery model</li><li>Reliable service because it is responsibility to SaaS company to provide you a reliable service</li><li>As a customer, you don’t need to maintain the infrastructure for this nor you need to upgrade software versions</li><li>You also get increased security because your data is considered secure when used on SaaS applications</li></ul><p><strong>SaaS Business benefits</strong></p><p>If you are a SaaS organisation, then you also get a lot of benefits.</p><ul><li>You have opportunity to build a global customer base with scalable services</li><li>As a SaaS business, your time to market is reduced.</li><li>As a SaaS company, generally public cloud is preferred choice for deployment, which gives you benefit of not spending time on maintenance of infrastructure etc.</li><li>You also get an improved data security of your own application.</li></ul><p><strong>SaaS Control Plane and Data Plane</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dX08JglFEDOub_mf" /><figcaption>SaaS Control Plane and Data Plane</figcaption></figure><p>If you are starting a SaaS business or want to start a SaaS business, Your SaaS application architecture needs to have two key components — Control Plane and Application/Data Plane.</p><p>This control plane is foundational to any multi-tenant SaaS model. Every SaaS solution — regardless of application deployment and isolation scheme — must include those services that give you the ability to manage and operate your tenants through a single, unified experience. Within the control plane, you can have a collection of services that are used to orchestrate the multi-tenant experience. In the diagram above, there are some of the common examples of services that are typically part of the core, acknowledging that the core services could vary some for each SaaS solution.</p><p>An important caveat is that the control plane and its services are not actually multi-tenant.</p><p>The right side of the diagram references the application/data plane of the SaaS architecture. This is where the multi-tenant functionality of the SaaS application resides. Your actual core business service is deployed inside the application/data plane. When new tenant is onboarded through the control plane, then provisioning application or data for that tenant is Application plane’s responsibility.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>That’s all from this blog.</p><p>If you would like to connect with me on LinkedIn, you can scan the following QR code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/0*iPQX-gEg7Cq5xR4g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c824f82b888b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A 3-tier serverless architecture on AWS]]></title>
            <link>https://medium.com/@amit2067/a-3-tier-serverless-architecture-on-aws-4a0b1698004a?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a0b1698004a</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 22:55:20 GMT</pubDate>
            <atom:updated>2023-12-04T22:55:20.396Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>About me: </strong>My name is Amit and I am a software architect. In this blog, I am going to cover how you can actually set up a 3 tier architecture on AWS by using only serverless technologies where you don’t need to manage or maintain any servers.</p><p><strong>What is a 3-Tier Architecture ?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYDRB2AM1mxLx8-zXIav6Q.png" /><figcaption>3-tier architecture</figcaption></figure><p>First, let’s understand what is a 3-tier architecture. A 3 tier architecture is well established software architecture that organises the application into three specific tiers consists of three tiers — <strong>Web tier</strong>, <strong>Application Tier</strong> and <strong>Data Tier.</strong></p><ul><li><strong>Web tier</strong> represents your presentation of the application. It is generally your web user interface or the communication layer where users interact with your application.</li><li><strong>Application Tier </strong>(also known ad logic tier) processes all the data which has been collected by the web tier. Application layer is typically your Backend service or APIs written in any chosen programming language such as Java, Python, Go or any others. Application Tier writes or updates the data in data tier.</li><li><strong>Data tier</strong> (also known as database tier) stores and manages the data of your application. This tier can be a relational database system or NoSQL database.</li></ul><p><strong>Web Tier on AWS Serverless</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5bfAXd48ZXx-t1_XDxU1w.png" /><figcaption>web tier on AWS serverless</figcaption></figure><p>If you want to deploy your web tier or user interface tier on AWS without managing any servers, S3 or Simple Storage Service is the recommended option. You can deploy your Web application using S3 bucket and then can use Cloudfront to front that application.</p><p>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.</p><p>Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you’re serving with CloudFront, the request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance.</p><p>With this architecture, you do not need to manage and maintain any servers.</p><p><strong>Application Tier on AWS Serverless</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgGYUdpNeitf-QkfCCFOEQ.png" /><figcaption>application tier on AWS serverless</figcaption></figure><p>To deploy the application tier on AWS serverless, you can choose a combination of Amazon API Gateway and AWS Lambda.</p><p>Amazon API Gateway is a fully managed service offered by AWS that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.</p><p>AWS Lambda is a serverless compute service offered by AWS that lets you run code without provisioning or managing servers. API Gateway integrates with Lambda and provide a full fledged API functionality to end users. Here API Gateway works as front door for your application tier and lambda performs the business logic.</p><p>In this architecture, your web tier can communicate with APIs, and these APIs will be hosted on API Gateway. Lambda function will provide the application or business logic.</p><p><strong>Data Tier on AWS Serverless</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3q_g5Ot_9W9_F03aN3_sWA.png" /><figcaption>data tier on AWS serverless</figcaption></figure><p>To deploy the data tier on AWS, you can choose a database which is serverless. That means that you do no need to manage any servers or instances yourself.</p><p>If your design or use case needs Relational database, Then your serverless database choice is Aurora Serverless.</p><p>Before going into Aurora serverless, let’s understand what Amazon Aurora is. Amazon aurora is a fully managed relational database engine which is compatible with MySQL and PostgreSQL. Aurora can deliver up to five times the throughput of MySQL and up to three times the throughput of PostgreSQL. Aurora is not serverless, hence customers demanded for serverless version of Aurora. Hence AWS launched Aurora serverless. Aurora Serverless v2 is an on-demand, autoscaling configuration for Amazon Aurora. Aurora Serverless v2 helps to automate the processes of monitoring the workload and adjusting the capacity for your databases. Capacity is adjusted automatically based on application demand.</p><p>If your design or use case needs a NoSQL database, Then your serverless database choice is DynamoDB.</p><p>Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don’t have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.</p><p><strong>Putting it All Together..</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OijVuf7v_ZRa0LcEH4Uw-g.png" /><figcaption>AWS serverless — all tiers combined together</figcaption></figure><p>Above diagram represents all of these tiers together in a single architecture.</p><ol><li>Users will access a domain name via Amazon Route53 service. Amazon Route 53 is a highly available and scalable <a href="https://aws.amazon.com/route53/what-is-dns/">Domain Name System (DNS)</a> web service offered by AWS. Route 53 connects user requests to internet applications running on AWS or on-premises.</li><li>Route53 forwards the request to Cloudfront and then Cloudfront serves the user interface from the S3 bucket.</li><li>Once user accesses the web UI, user can perform different available operations on that UI.</li><li>When user perform the operations on the UI, The application tier is invoked by the web tier and being specific, combo of API Gateway and Lambda provides the application tier capabilities in the form of APIs.</li><li>This application tier communicates with Data tier to create, read, update and delete the records or entries in the database of your choice.</li></ol><p>That’s all from this blog.</p><p>If you would like to connect with me on LinkedIn, you can scan the following QR code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*QhkPmDi9WnOkHtO4oRaXFw.png" /><figcaption>Amit’s LinkedIn QR cod</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a0b1698004a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Least talked Software Architecture Patterns, but used very often]]></title>
            <link>https://medium.com/@amit2067/least-talked-software-architecture-patterns-but-used-very-often-bd0dc20d1563?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd0dc20d1563</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[sofware-development]]></category>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Wed, 20 Sep 2023 21:12:15 GMT</pubDate>
            <atom:updated>2023-09-20T21:31:53.896Z</atom:updated>
            <content:encoded><![CDATA[<h3>Software Architecture patterns — less talked, but implemented often</h3><p><strong>What is an Architecture pattern ?</strong></p><p>An architectural pattern defines a<strong> general, reusable resolution to a commonly occurring problem in software</strong> architecture within a given context. An architecture pattern provides mechanisms to create building blocks to write a well architected software.</p><p>In today’s software architecture world, there are various architecture patterns which are talked about on regular basis and implemented very often in the software development, such as client-Server, Sharding, Strangler, pub-sub etc.</p><p>There are a few architecture patterns which are implemented quite a lot , however not discussed in the architecture and development discussions. This post would cover some of those architecture patterns and will explain the benefits and implementation details of these architecture patterns.</p><ol><li><strong>Scatter and Gather</strong></li></ol><p><strong>Scatter and Gather </strong>is a pattern where<strong> </strong>a request is routed to the a number of recipients. Each recipient is a processor and processes the request/message and then this pattern uses an Aggregator to collect the responses from all the processors and distill them into a single response message. There are various technologies available to implement this pattern, e.g. <a href="https://camel.apache.org/">Apache Camel</a>, <a href="https://aws.amazon.com/sqs/">SQS</a>, <a href="https://aws.amazon.com/sns/">SNS</a>, <a href="https://aws.amazon.com/step-functions/">Step functions</a>, <a href="https://www.mulesoft.com/">MuleSoft</a> etc. You can choose a technology which fits well for your use case. Following diagram illustrates a simple view of this pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xcs6aCO8uPhkyv8VDNdk8g.png" /></figure><p><strong>2. Eventual consistency and Strong consistency</strong></p><p>While developing distributed systems, there is always a conversation around eventual consistency and strong consistency in distributed databases. In Distributed databases, eventual consistency and strong consistency are two key patterns which are commonly used for different use cases. <br> <br>Let’s assume that you have a distributed database running on a cluster with multiple nodes which are geographically distributed.<br> <br>So What is <strong>Eventual Consistency </strong>?<br> <br>When you write data to the cluster, Eventual Consistency is a model that guarantees that updates will propagate through the system and eventually be applied to all nodes, given enough time. In other words, if no new updates are made to a particular data item, eventually, all nodes will converge on the same value for that item. Eventual consistency provides a high availability model even if other nodes are down, they will eventually be in sync at some point. It also provides a lower latency for write operations. This pattern isn’t suitable for all types of systems<strong>.</strong> For example, systems that require strict consistency, such as financial systems, may be unable to tolerate eventual consistency. <strong><br> <br></strong>So what is <strong>Strong Consistency</strong>?<br> <br>Strong consistency guarantees that each read operation would respond with the latest write operation’s result, regardless of the node on which the read operation is executed. The aim of strong consistency is to provide higher level of consistency. Strong consistency ensures that all the nodes in the cluster would see the same data without any temporary inconsistencies. Strong consistency is expensive to achieve because it comes at the cost of more communication and coordination between the nodes to maintain that consistency.</p><p>Following diagram illustrates the difference between Eventual Consistency and Strong Consistency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*iuI89IC71FsZct3CDSLKRA.png" /></figure><p><strong>3. Micro Frontends</strong></p><p>In recent times, you have seen that Microservices have gained a lot of popularity over the years, with many organisations using this architecture style to avoid the drawbacks of monolith systems. Microservices style is applied to Backend services or server side services.<br> <br> But wait, what about <strong>Front ends </strong>?<br> <br> Well, let’s say you want to develop a web application. A web application can have both frontend and backend. We also need to think about the decomposing the frontend monolith into smaller, simpler components. That’s where Micro Frontends come in.<strong><br> <br> </strong>Micro Frontend is<strong> </strong>“An architectural style where independently deliverable frontend applications are composed into a greater whole”.<em> </em>[Definition Source — <a href="https://martinfowler.com/articles/micro-frontends.html">https://martinfowler.com/articles/micro-frontends.html</a>]<br> <br>Micro frontends have many benefits similar to Microservices architecture. You can have independent people or teams who can work on smaller frontend components and take ownership of that. You also get smaller, more cohesive and maintainable codebase with Micro Frontends.</p><p>Following diagram illustrates how Micro Frontends are decomposed and implemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dmnkmnoX-AyEG4_Av4-hQA.png" /></figure><p><strong>4. Data Orchestration</strong></p><p>You probably hear terms like ‘Microservices orchestration’, ‘Container orchestration’ etc on a regular basis in technology discussions, however do you hear the term ‘Data Orchestration’ on a regular basis? Probably No.<br> <br>So What’s the <strong>Data Orchestration</strong>?<br> <br>Data Orchestration is a modern approach to Business Intelligence. It is a process of moving siloed data from multiple data sources into a centralised repository where it can be combined, cleaned and enriched and then is made available across different technology systems and also available for analytics. <br> <br>Why do Organisations need <strong>Data Orchestration</strong> ?<br> <br>Since Data Orchestration puts the refined data at a centralised place, it allows organisations to make informed decisions based on the analysis of the refined data. Organisations who do use Data orchestration and practice data driven decision making, term themselves as Data Driven Organisations. Data Orchestration allows organisations to eliminate Data silos and helps them in acquiring real time insights from the data. <br> <br> There are various tools and technologies available to achieve Data orchestration such as <a href="https://airflow.apache.org/">Apache Airflow</a>, <a href="https://metaflow.org/">Metaflow</a> etc.</p><p>Following diagram illustrates the overall architecture of a Data Orchestration platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qI6ke5xF0smAHyBMz9SRKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd0dc20d1563" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a quality and secure software?]]></title>
            <link>https://medium.com/@amit2067/how-to-build-a-quality-and-secure-software-4676bb0db72?source=rss-d2bea39fd696------2</link>
            <guid isPermaLink="false">https://medium.com/p/4676bb0db72</guid>
            <dc:creator><![CDATA[Amit Kumar Batra]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 21:17:55 GMT</pubDate>
            <atom:updated>2022-07-13T21:17:55.908Z</atom:updated>
            <content:encoded><![CDATA[<p>How you manage your software quality and security has become a vital element of a software delivery. In this post, I will talk about a bunch of best practices which would help you in building a high quality and secure software. First, let’s understand what Software Quality and Software Security mean in general terms.</p><h4>What is Software Quality?</h4><p>The quality of software is defined as the ability of the software to function as per customer requirement. To further simplify, A software must satisfy all the functionalities written down in the requirements document.</p><h4>What is Software Security?</h4><p>Software security is a concept to protect software against malicious attacks &amp; threats, misconfigurations, vulnerabilities and other hacker risks so that the software continues to operate correctly under such potential risks. Security is vital to provide integrity, authentication and availability of the software.</p><p>A Software development process goes through all phases of Software Development life cycle (SDLC). The key phases of SDLC are <strong>Requirement gathering and Analysis</strong>, <strong>Design</strong>, <strong>Development</strong>, <strong>Testing </strong>and<strong> Deployment/Delivery.</strong></p><p>A quality and secure software is delivered if both quality and security are embedded into all key phases of SDLC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fM6DIDu5GKPnqIbty7dsDw.png" /></figure><h4>How to embed Quality into the Software ?</h4><p><strong>Requirement gathering and Analysis</strong></p><p>Following are the key measures one should take in order to achieve a high quality requirement gathering and analysis.</p><ol><li>Always talk to the right stakeholders and customers involved.</li><li>Gather the business requirements and document them.</li><li>Always be sure that you understand the business requirements and don’t make assumptions about them.</li><li>Don’t focus on technologies or technical talks during this phase.</li><li>Create or align software goals matching to the business requirements.</li><li>Translate business requirements into a set of <strong>Functional and Non Functional Requirements</strong> which would help you to move into the design phase.</li></ol><p><strong>Design</strong></p><p>Once you have performed requirement gathering &amp; analysis and translated business requirements into Functional and Non Functional requirements, it’s time for you to establish a design for your software. A software design is generally categorised into two parts — <strong>High level design</strong> and <strong>Low level design</strong>.</p><p>A High-level design (HLD) explains the architecture that would be used to develop a system. The architecture diagram provides an overview of an entire system, identifying the main components that would be developed for the product and their interfaces.</p><p>To achieve a high quality HLD, following are the key measures one should take into consideration.</p><ol><li>Ensure you have clear understanding of Functional and Non functional requirements.</li><li>Start with a high level system design or flow for your software mapping to your functional requirements.</li><li>Now consider your non functional requirements (e.g. scalability, availability, performance, maintenance, security etc.) in your high level system design.</li><li>Keep your high level design at a component level. Don’t think too much about technologies at this stage.</li><li>Always ensure to create diagram/s for your high level design and document them at appropriate location.</li></ol><p>A Low Level Design (LLD) is like detailing HLD means it refers to component-level design process. It describes detailed description of each and every module means it includes actual logic for every system component and it goes deep into each modules specification. It is also known as micro level/detailed design. It is created by designers and developers. It converts the High Level Solution into Detailed solution. It is created second means after High Level Design.</p><p>To achieve a high quality LLD, following are the key measures one should take into consideration.</p><ol><li>Ensure you have clear understanding of established high level design.</li><li>Start mapping the high level design to a set of technologies, e.g. map a microservice to its implementation framework (Java Spring Boot, Python Flask, Django etc.), map a database to a technology (RDBMS Oracle, NoSQL MongoDB, NoSQL DynamoDB etc.) and more.</li><li>Ensure to demystify all the components involved in high level design.</li><li>Include all the components along with mapping to technologies.</li><li>Ensure to create diagram/s and document them at appropriate location.</li></ol><p><strong>Development</strong></p><p>Once you have established high level and low level designs of your software, it’s time to go into development process. Development turns your software’s requirements and designs into a tangible solution. A development process generally covers two key parts — coding and unit testing.</p><p>To achieve a high quality development process, following are the key measures one should take into consideration.</p><ol><li>Write high quality code and ensure proper tooling is used to assess the quality of the code. A tooling example for Python is <strong>black, isort, pydocstyle, mypy</strong> etc. and for Java is <strong>PMD, Checkstyle</strong> etc.</li><li><strong>Shift left</strong> the tooling into developer workspace to detect the quality issues early in the process.</li><li>Ensure to use the <strong>Test Driven Development</strong> approach to develop the software.</li><li>Prepare the unit tests to cover a minimum of <strong>80% code coverage</strong>.</li><li>Write <strong>integration tests and automation tests</strong> for your code.</li><li>Make use of <strong>pre commit hooks</strong> to run quality tools and detect the issues before pushing the code into source control.</li><li>Ensure to use <strong>Continuous Integration (CI)</strong> capabilities to incrementally build and package your code.</li><li>Ensure to run <strong>quality assessment tools, unit tests execution and integration tests execution</strong> in Continuous Integration pipeline.</li></ol><p><strong>Testing</strong></p><p>In Testing phase, all the pieces of code are tested to verify and validate the software product. Different types of tests are carried out to validate the real behaviour of software vs expected behaviour of the software.</p><p>To achieve a high quality Testing of the software, following are the key measures one should take into consideration.</p><ol><li>Perform S<strong>ystem Testing</strong> extensively to ensure the <strong>positive and negative scenarios</strong> are fully covered.</li><li>Perform <strong>Performance Testing </strong>of the software to ensure the software performance and behaviour in different situations.</li><li>Perform <strong>Volume Testing </strong>of the software to ensure the software can scale with a higher volume demand to match customer’s needs.</li><li>Always ensure to perform <strong>Regression Testing</strong> to validate that existing functionality is not broken after adding any features to the software.</li><li>Sometimes running a bunch of scenarios manually can be a long and overwhelming task. To overcome this issue, Perform the <strong>Automation Testing.</strong></li></ol><p><strong>Deployment/Delivery</strong></p><p>Once software is fully tested, it is ready to be deployed and delivered. To achieve a high quality deployment and delivery of the software, following are the key considerations.</p><ol><li>Use the continuous deployment principle, wherever possible.</li><li>Put a deployment tollgate to ensure all the quality checks have been executed and passed.</li><li>Use the same repeatable deployment process for all environments.</li><li>Version control every deployment instance.</li></ol><h4>How to embed Security into the Software ?</h4><p>Security is vital to the key SDLC phases i.e. <strong>Requirement gathering and Analysis,</strong> <strong>Architecture/Design</strong>, <strong>Development</strong>, <strong>Testing</strong> and <strong>Deployment.</strong></p><p><strong>Requirement gathering and Analysis</strong></p><p>To ensure security of business requirements,</p><ol><li>One must ensure the authenticated and authorised access to the requirements specification document.</li><li>Perform a risk assessment on the requirements specifications.</li></ol><p><strong>Architecture/Design</strong></p><p>To ensure the security of architecture , Perform a <strong>Threat Modeling</strong> of your architecture. Various Threat Modeling tools can be utilised for this purpose or you can start simple with just enumerating the attack vectors and the probability and impact of each one on a high/medium/low scale.</p><p>Once you have threats identified into your architecture, Build a plan to remediate the threats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P94iSFq3RYjSTzAPKPCxOQ.png" /></figure><p><strong>Development</strong></p><p>Following are the key measures one should take into consideration to ensure secure development.</p><ol><li>Always ensure to perform <strong>open source dependencies scanning</strong> for your codebase. This can be performed locally on your workspace as well as in Continuous Integration Pipeline.</li><li>Always ensure to perform <strong>static analysis/scanning (SAST) </strong>of your codebase. This can also be performed locally on your workspace as well as in Continuous Integration Pipeline.</li><li>Please ensure all other security best practices are being followed, e.g. private keys, secrets etc. are not stored in source control, no unauthorised access to the protected resources etc.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m_iN8YkTG0i7czJ1xiIeCw.png" /></figure><p><strong>Testing</strong></p><p><strong>Security testing</strong> is vital to a secure software. Security testing should always be in consideration to ensure security of the software. Most commonly used type of security testing is <strong>Penetration Testing</strong>. A penetration test, also known as a pen test, is a simulated cyber attack against your software to check for exploitable vulnerabilities.</p><p><strong>Deployment/Delivery</strong></p><p>To ensure a secure deployment and delivery of the software, following key considerations should be taken into account.</p><ol><li>A security tollgate mechanism is used in the deployment pipeline to ensure all the security checks in previous stages have been executed and passed.</li><li>Least privilege principle is adhered to, for all deployments.</li><li>All other security best practices (authentication &amp; authorization, data protection etc.)are being followed.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4676bb0db72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>