<?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 Sachin Arora on Medium]]></title>
        <description><![CDATA[Stories by Sachin Arora on Medium]]></description>
        <link>https://medium.com/@sachin.arora_64247?source=rss-5996506d8c4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fyuZU46Gu3kgI8h-</url>
            <title>Stories by Sachin Arora on Medium</title>
            <link>https://medium.com/@sachin.arora_64247?source=rss-5996506d8c4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:15:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sachin.arora_64247/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[Ace Terraform Deployments with Best Practices]]></title>
            <link>https://medium.com/clairvoyantblog/ace-terraform-deployments-with-best-practices-696084304e64?source=rss-5996506d8c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/696084304e64</guid>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sachin Arora]]></dc:creator>
            <pubDate>Wed, 14 Jul 2021 15:03:11 GMT</pubDate>
            <atom:updated>2021-07-14T15:03:11.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwp7TegFJ61Jruea3W3g_Q.jpeg" /><figcaption><a href="https://www.splunk.com/content/dam/splunk-blogs/images/en_us/2020/09/splunk-terraform-head.jpg">Terraform</a></figcaption></figure><blockquote><em>Learn the Best Practices of Terraform</em></blockquote><p><a href="https://www.terraform.io/">Terraform</a> is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.</p><p>The key features of Terraform are:</p><ul><li><strong>Infrastructure as Code:</strong> Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your data center to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.</li><li><strong>Execution Plans:</strong> Terraform has a “planning” step where it generates an <em>execution plan</em>. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.</li><li><strong>Resource Graph:</strong> Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.</li><li><strong>Change Automation:</strong> Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.</li></ul><p>If you have started using Terraform, you should adopt the best practices for better production infrastructure provisioning:</p><h3><strong>1) Structuring the Project</strong></h3><p>When you are working on a large production infrastructure project using Terraform, you should follow a proper directory structure to take care of the complexities that may occur in the project. It would be best if you had separate directories for different purposes.</p><p>For example, if you are using terraform in development, staging, and production environments, have separate directories for each of them.</p><pre>terraform_project/<br>├── dev<br>│ ├── main.tf<br>│ ├── outputs.tf<br>│ └── variables.tf<br>├── modules<br>│ ├── emr<br>│ │ ├── emr.tf<br>│ │ └── main.tf<br>│ └── vpc<br>│ ├── main.tf<br>│ └── vpc.tf<br>├── prod<br>│ ├── main.tf<br>│ ├── outputs.tf<br>│ └── variables.tf<br>└── stg<br>├── main.tf<br>├── outputs.tf<br>└── variables.tf</pre><p>Even the terraform configurations should be separate because, after a period, the configurations of a growing infrastructure will become complex.</p><p>For example — you can write all your terraform codes (modules, resources, variables, outputs) inside the main.tf file itself, but having separate terraform codes for variables and outputs makes it more readable and easy to understand.</p><h3><strong>2) Good Naming Convention</strong></h3><p>Naming conventions are used in Terraform to make things easily understandable.</p><p>For example, let’s say you want to make three different workspaces for different environments in a project. So, rather than naming them as env1, env2, env3, you should call them dev, stage, prod. From the name itself, it becomes pretty clear that there are three different workspaces for each environment.</p><p>Similar conventions for resources, variables, modules, etc. also should be followed.</p><h3><strong>3) Usage of Shared Modules</strong></h3><p>It is strongly suggested to use official Terraform modules. No need to reinvent a module that already exists. It saves a lot of time and pain. The <a href="https://registry.terraform.io/">Terraform Registry</a> has plenty of modules readily available. If needed, you can modify and enhance the existing modules as per your needs.</p><p>Also, each module should concentrate on only one aspect of the infrastructure, such as creating an AWS EC2 instance, create MySQL databases, etc.</p><p>For example, if you want to use AWS VPC in your terraform code, you can use — <a href="https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/v2.48.0/examples/simple-vpc">simple VPC</a></p><pre>module &quot;vpc_example_simple-vpc&quot; {<br>    source<br>= &quot;terraform-aws-modules/vpc/aws//examples/simple-vpc&quot;<br>version = &quot;3.4&quot;<br>}</pre><h3><strong>4) Backup System State</strong></h3><p>Always backup the state files of Terraform.</p><p>These files keep track of the metadata and resources of the infrastructure. By default, these files called as terraform.tfstate are stored locally inside the workspace directory.</p><p>Without these files, Terraform will not be able to figure out which resources are deployed on the infrastructure. So, it is essential to have a backup of the state file. By default, a file with a name terraform.tfstate.backup will get created to keep a backup of the state file.</p><pre>terraform_demo/<br>├── awsec2.tf<br>├── terraform.tfstate<br>└── terraform.tfstate.backup</pre><p>If you want to store a backup state file to some other location, use -backup flag in the terraform command and give the location path.</p><p>Most of the time, there will be multiple developers working on a project. So, to give them access to the state file, it should be stored at a remote location using a terraform_remote_state data source.</p><p>The following example will take a backup to S3.</p><pre>data &quot;terraform_remote_state&quot; &quot;vpc&quot; {<br>   backend = &quot;s3&quot;<br>   config = {<br>      bucket = “s3-terraform-bucket”<br>      key = “vpc/terraform.tfstate&quot;<br>      region = “us-east-1”<br>   }<br>}</pre><h3><strong>5) Lock State File</strong></h3><p>There can be multiple scenarios where more than one developer tries to run the terraform configuration at the same time. This can lead to the corruption of the terraform state file or even data loss. The locking mechanism helps to prevent such scenarios. It makes sure that at a time, only one person is running the terraform configurations, and there is no conflict.</p><p>Here is an example of locking the state file, which is at a remote location using DynamoDB.</p><pre>resource “aws_dynamodb_table” “terraform_state_lock” {<br>    name = “terraform-locking”<br>    read_capacity = 3<br>    write_capacity = 3<br>    hash_key = “LockingID”</pre><pre>    attribute {<br>        name = “LockingID”<br>        type = “S”<br>   }<br>}</pre><pre>terraform {<br>    backend “s3” {<br>        bucket = “s3-terraform-bucket”<br>        key = “vpc/terraform.tfstate”<br>        region = “us-east-2”<br>        dynamodb_table = “terraform-locking”<br>   }<br>}</pre><h3><strong>6 ) Use var-file</strong></h3><p>In terraform, you can create a file with extension <em>.</em>tfvars and pass this file to terraform apply command using -var-file flag. This helps you in passing those variables which you don’t want to put in the terraform configuration code.</p><p>It is always suggested to pass variables for a password, secret key, etc. locally through<em> -var-file</em> rather than saving it inside terraform configurations or on a remote location version control system.</p><p>For example, if you want to want to launch an ec2 instance using terraform, you can pass access key and secret key using <em>-var-file</em></p><p>Create a file <em>terraform.tfvars </em>and put the keys in this file.</p><pre>gedit terraform.tfvars<br><br>access_key = &quot;XXXXXXXXXXXXXXX&quot;<br>secret_key = &quot;XXXXXXXXXXXXXXX&quot;</pre><pre>terraform apply -var-file=/home/clairvoyant/terraform.tfvars</pre><h3><strong>7) Use Docker</strong></h3><p>When you are running a CI/CD pipeline build job, it is suggested to use docker containers. Terraform provides official Docker containers that can be used. In case you are changing the CI/CD server, you can easily pass the infrastructure inside a container.</p><p>Before deploying infrastructure on the production environment, you can also test the infrastructure on the docker containers, which are very easy to deploy.</p><p>By combining Terraform and Docker, you get portable, reusable, repeatable infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=696084304e64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/ace-terraform-deployments-with-best-practices-696084304e64">Ace Terraform Deployments with Best Practices</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BigQuery vs. Athena]]></title>
            <link>https://medium.com/clairvoyantblog/bigquery-vs-athena-754560c21664?source=rss-5996506d8c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/754560c21664</guid>
            <category><![CDATA[athena]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Sachin Arora]]></dc:creator>
            <pubDate>Thu, 27 May 2021 20:24:47 GMT</pubDate>
            <atom:updated>2021-05-27T20:24:47.176Z</atom:updated>
            <content:encoded><![CDATA[<h4>Are you wondering whether to utilize BigQuery or AWS Athena services? Read this article to get a head start using these services.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*IuX202PDRgYLTKxopNUpuQ.jpeg" /><figcaption><a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Flogz.io%2Fblog%2Fbigquery-vs-athena%2F&amp;psig=AOvVaw3LXXHPRLkYGoJ3O07SW-cN&amp;ust=1615015403324000&amp;source=images&amp;cd=vfe&amp;ved=0CAIQjRxqFwoTCKCU8a7PmO8CFQAAAAAdAAAAABAD">Athena Vs Big query</a></figcaption></figure><p>The Cloud War is heating up. Google and AWS have two directly competing serverless querying tools: Amazon Athena and Big Query</p><p>In this blog, we will take a closer look at these two services, and compare their real-world performance executing a series of SQL queries against the same dataset.</p><h3>Amazon Athena</h3><p><a href="https://aws.amazon.com/athena/">Amazon Athena</a> is a serverless way to query your data that lives on S3 using SQL. It excels with datasets that are anywhere up to multiple petabytes in size. Queries cost $5 per terabyte of data scanned with a 10 MB minimum per query.</p><p>Data can be stored in CSV, JSON, ORC, Parquet, and even Apache Weblogs format. You can even use compressed CSV files in GZIP format to save on query costs and improve performance over regular, uncompressed CSV files.</p><p>It’s important to note that Athena is not a general-purpose database. Under the hood is <a href="https://prestodb.io/">Presto</a>, a query execution engine that runs on top of the Hadoop stack.</p><h3>Google BigQuery</h3><p><a href="https://cloud.google.com/bigquery/">Google BigQuery</a> can be used via its Web UI or <a href="https://cloud.google.com/sdk/docs/">SDK</a>.</p><p>BigQuery allows you to query tables that are <a href="https://cloud.google.com/bigquery/what-is-bigquery#storage">native</a> (in Google Cloud), <a href="https://cloud.google.com/bigquery/external-data-sources">external</a>, or in <a href="https://cloud.google.com/bigquery/querying-data#views">logical views</a>. Users can load data into BigQuery storage using batch loads or via stream and define the jobs to load, export, query, or copy data. The data formats that can be loaded into BigQuery are CSV, JSON, AVRO, and cloud datastore backups.</p><p>Let’s look below some of the cost aspects of BigQuery:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*328gEvzjnXxyYaxfV_GLXg.jpeg" /><figcaption>BigQuery Cost</figcaption></figure><h3>Athena vs BigQuery — A Pricing Comparison</h3><p>Both Athena and BigQuery bill at $5/TB queried. However, not all terabytes are created equal. Athena charges for bytes read from S3; compressing data to reduce its size thus saves costs for both queries and storage. The Athena pricing documentation (<a href="https://aws.amazon.com/athena/pricing/">https://aws.amazon.com/athena/pricing/</a>) mentions this strategy specifically: “Compressing your data allows Athena to scan less data.”</p><p>Behind the scenes, BigQuery also compresses data, but this is invisible to the user. Here’s the big difference with Athena — storage and queries are billed by <em>decompressed bytes</em> (<a href="https://cloud.google.com/bigquery/pricing#data">https://cloud.google.com/bigquery/pricing#data</a>), and the difference in calculated data size can be dramatic.</p><h3><strong>Benchmarking Athena vs BigQuery</strong></h3><p>In order to perform benchmarking between Athena and BigQuery, we will be using a very popular open-source New York taxi trips dataset.</p><p>We will be running various queries which would include various types of aggregations as well as include analytical functions which would help us to determine the performance of both services.</p><p>In order to get the data, we can use the below link to fetch data for all the Yellow taxi trip records:</p><p><a href="https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page">TLC Trip Record Data</a></p><p>Here you can find data for various years of the New York Taxi trips which can be used to benchmark Athena and BigQuery by cost and performance.</p><p>In order to download the data for multiple years together, we used the following python script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b37cca977ef06632b653b36a6b8c1f57/href">https://medium.com/media/b37cca977ef06632b653b36a6b8c1f57/href</a></iframe><p>The above script will download the data by a specific year. You need only specify the year you want to download.</p><p>Once the data is downloaded we converted the data to Parquet format using Apache Spark so that we have a fixed data format.</p><p>In order to perform the benchmarking, we would be using approximately <strong>145 GB</strong> dataset for New York Taxi data.</p><p>Below are the queries which we ran in order to benchmark Athena and BigQuery:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46ab13a74b8a4e0f7e42076f38f28a3a/href">https://medium.com/media/46ab13a74b8a4e0f7e42076f38f28a3a/href</a></iframe><h3><strong>Results</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8Svy0G8oBaRqa0FQqDs5A.png" /><figcaption>Athena Vs BigQuery</figcaption></figure><p>From the above results, we can clearly see that the time taken for BigQuery to process data is than Athena.</p><p>BigQuery is a sure-shot winner when compared with Athena but looking from the cost perspective(in $) Athena is quite cheap and is budget-friendly.</p><h3><strong>Summarising the difference between the two</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXvanstBNkdRf0a6ZKm_4g.png" /><figcaption>Athena Vs BigQuery Summary</figcaption></figure><h3>Conclusion</h3><p>After the above comparison, it’s clear that <strong>BigQuery outperforms Athena</strong> when we look into time to return results; the choice ultimately depends on the needs of your business and the cost.</p><p>BigQuery allows you to run SQL-like queries on multiple terabytes of data in a matter of seconds, and Athena allows you to quickly run queries on data from Amazon S3.</p><p>Amazon Athena is simple yet has efficient quality. No initial setup is required which makes ad hoc querying easy. It’s practical for simple and aggregated queries and is relatively cost-effective as compared to BigQuery.</p><p>Hence if you are looking to run your analysis on Petabytes of data then BigQuery is surely excellent for that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=754560c21664" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/bigquery-vs-athena-754560c21664">BigQuery vs. Athena</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Data Lake on AWS — Data Insights]]></title>
            <link>https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-insights-3c5e8e199c9c?source=rss-5996506d8c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c5e8e199c9c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[data-insights]]></category>
            <dc:creator><![CDATA[Sachin Arora]]></dc:creator>
            <pubDate>Fri, 11 Dec 2020 05:31:56 GMT</pubDate>
            <atom:updated>2020-12-17T12:37:05.899Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Data Lake on AWS — Data Insights</h3><h4>Unleash the true power of your data residing in data lakes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*K3KBN_ZliX7y26Ky" /><figcaption><a href="https://images.app.goo.gl/QJG6aWqZnkC6zm7N7">Data insights</a></figcaption></figure><p>Our second blog on <a href="https://blog.clairvoyantsoft.com/building-data-lake-on-aws-data-processing-e1545a5e25bd">Building Data Lake on AWS</a> explained the process of architecting a data lake and building a process for data processing in it.</p><p>This blog is our attempt to document how <a href="https://clairvoyantsoft.com/contact/">Clairvoyant</a> leverages AWS to solve data insights-related use cases. Read more to know how data can be used efficiently for extracting/generating insights.</p><h3>Insights Tier</h3><p>Once we have the Cleaned and Transformed data, we can use it to derive insights.</p><h3>What are Data Insights?</h3><p>Data insights are knowledge that a company gains from analyzing a set of information pertaining to a given topic or situation. Analysis of this information provides insights that help businesses make informed decisions and reduces the risk that comes with trial-and-error testing methods.</p><p>In the digital world that we live in, there are copious amounts of data at our fingertips. But though anyone can access raw data, the ability to extract valuable and actionable information from the numbers is what will determine whether you can generate a competitive advantage for your business.</p><h3><strong>What is the difference between data and insights?</strong></h3><p>Many people think of data and insights as synonymous, but there are subtle, yet important distinctions between these two terms. Data is information; generally sets of numbers or text. Insights are the knowledge gained through analyzing the data, generating conclusions from the data that can benefit your business. Data is the input, and insights are the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5kmErGg0ntKjhU8LqVQUow.png" /><figcaption>Data analytics and Data science hierarchy</figcaption></figure><p><strong>Data</strong> may show that your users had 2,000 sessions in the past 30 days.</p><p><strong>Analytics</strong> can show you how many sessions occur on iPhones in India.</p><p><strong>Insights</strong> could reveal that those sessions on iPhones were 20% less likely to be purchased.</p><h3><strong>Why do we need insights?</strong></h3><ul><li>Fast and accurate analysis of customer information</li><li>360-degree view of customer behavior</li><li>Help better understand customer needs</li><li>Deliver personalized interactions</li><li>Post go-live support</li><li>System monitoring</li><li>Reconnect with customers</li><li>Spot trends and predict outcomes</li><li>Strengthen customer relationships</li></ul><blockquote><strong>Lack of Insight = Lack of Engagement</strong></blockquote><h3>A common approach to Data Insights</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7-ggTIM5m8oKsMpCYvaUg.png" /></figure><h3>Modern Analytics with cloud platforms</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*iURcKlU_6N8ZatM_AVzqJQ.png" /><figcaption>Modern analytics flow on cloud</figcaption></figure><h3>Challenges in Data Insights</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mFHwoHj7ySgoTY_Y" /></figure><h3>Tackling challenges faced while extracting insights from data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*4O6b5aDWZFf1CNrH" /><figcaption><a href="https://blog.camelot-group.com/wp-content/uploads/2020/09/The-challenge-in-generating-value-from-the-new-oil.png">Tackling challenges while extracting insights</a></figcaption></figure><p>Despite the complexity and challenges faced while extracting insights from data, its advantages are undeniable. Data Insights provide a deeper understanding of one’s data, they provide a hawk-eye view to the company stakeholders on anomalies.</p><h3>Building Data Insights/Analytics Solutions on AWS</h3><p>AWS provides us several services to go with each step in the data analytics pipeline. We have different architecture patterns for different use cases, including Batch, Interactive, and Stream processing along with several services for extracting insights using Machine Learning.</p><p>Principally, there are four different approaches to implement the pipelines:</p><ol><li><strong>Virtualized</strong>: This is the least recommended approach, but is the easiest first step for someone migrating their data analytics pipeline into AWS. You can simply create EC2 instances that are powerful enough, and deploy your own open-source (or licensed) data analytics framework in it.</li><li><strong>Managed Services:</strong> Essentially, these are EC2 instances, managed by AWS — with the analytics framework running on them (also managed by AWS). That spares us to focus on our data alone and relieves us from a lot of unwanted work. AWS provides a range of managed services for Big Data Analytics. Most of the open-source frameworks are included in this, along with some proprietary to AWS.</li><li><strong>Containerized Services:</strong> Now we enter the exciting world. Containerized applications are the ones deployed on a Docker container. Naturally these are a lot more cost-effective than the previous two — because we do not need the underlying EC2. AWS has a range of services and ready Docker Images to help us get started with such a solution. You can of course bring in your own.</li><li><strong>Serverless</strong>: The most exciting, and the most recommended by AWS, is the chunk of serverless services. These are highly cost-effective and scalable. AWS encourages us to switch over to the native serverless architectures. The only downside to this approach is that it locks us down to AWS — if you want to plan for the possibility that your solution may outlive outside AWS cloud, you might want to be careful. Else, a serverless architecture is the best choice.</li></ol><h3>Popular tools/technologies used for Analytics and ML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r2XB4fBR9Rv6TvIW" /></figure><h3>Summing up the entire process</h3><p>The below diagram sums up the entire process of data analytics, along with the various choices available to us:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*XwFOOCeg71ozHBfG" /><figcaption><a href="https://miro.medium.com/max/4800/0*-d8J5mdfPkmezTD8.jpg">Source: AWS</a></figcaption></figure><h3>Sample Architecture for Real-time Streaming Insights/Analytics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*J8gSG8TT12uWTEgd" /><figcaption><a href="https://miro.medium.com/max/1400/0*4smXyLjJ-Aveaax6.jpg">Source: AWS</a></figcaption></figure><p>This uses a variety of services for processing and storing the data. As the data stream is gathered, it is processed by Kinesis Data Analytics for initial processing. Further, it is then fed into the data processing stream of different applications for extracting and classifying different aspects of the data. This is fed into the AI services for making any necessary real-time predictions.</p><p>Rest is stored in a variety of data storage services, based on the type of data extracted and segregated out of the input stream. This is finally used to generate notifications and insights. The purified data stream is forwarded to any other downstream application that might want to process it.</p><h3>Key Takeaways</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T_Gb5QNO2kfseVLr" /></figure><h3>Contributors</h3><p><a href="https://www.linkedin.com/in/sachin-a-248a2279/">Sachin Arora</a>, <a href="https://www.linkedin.com/in/aniruddha-more-28ba8240/">Aniruddha More</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c5e8e199c9c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-insights-3c5e8e199c9c">Building Data Lake on AWS — Data Insights</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Data Lake on AWS — Data Processing]]></title>
            <link>https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-processing-e1545a5e25bd?source=rss-5996506d8c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1545a5e25bd</guid>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[big-data-and-analytics]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Sachin Arora]]></dc:creator>
            <pubDate>Fri, 04 Dec 2020 12:01:16 GMT</pubDate>
            <atom:updated>2021-02-26T05:05:51.696Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Building Data Lake on AWS — Data Processing</strong></h3><h4>The journey from raw data to meaningful data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*SWLDoLDhbyE8y_HhZgjtig.png" /><figcaption><a href="https://miro.medium.com/max/1400/1*s7ZKCUK4t38lSLAEBfLnag.png">Data lifecycle in enterprises</a></figcaption></figure><p>Our first blog on <a href="https://blog.clairvoyantsoft.com/building-data-lake-on-aws-data-lake-architecture-and-data-ingestion-aa7a964a4cf">Building Data Lake on AWS</a> explained the process of architecting a data lake and building a process for data ingestion in it.</p><p><a href="https://clairvoyantsoft.com/contact/">Clairvoyant</a> has years of experience handling data processing challenges. Through this blog, we wish to document a few such challenges and our approach towards solving them on AWS. Read on to know how data can be processed efficiently.</p><h3>Data Processing</h3><p>Processing data to arrange it by type and information can save a lot of space taken up by unorganized and inconsistent data. Processed data can also help ensure that everyone understands it easily as it becomes readable. It becomes more useful, and when not processed, data can take up more time and end up generating a decreased output. Unorganized and inconsistent data can harm the interests of the business or organization. <br>Businesses require data to provide a good quality of service. Collecting data and its implications is a very important aspect of managing it and ensuring statistical authenticity. It is particularly essential for financial institutions where the transaction data and payment details need to be properly stored for easy access by customers and employees as and when needed.</p><p>Also, the data ingested in a data lake comes with different challenges. Some of them are:</p><ul><li>High-value data like User information</li><li>High-scale time-series data</li><li>Duplicates</li><li>Small Files</li><li>Big Files</li><li>Consistency</li></ul><p>Data Processing also helps overcome these data-related challenges.</p><h3><strong>Pillars of Data processing: Cleaning and Transformation</strong></h3><p>Data cleaning is the process that removes the data that does not belong in your dataset. Data transformation is the process of converting data from one format or structure into another.</p><p>Transformation processes can also be referred to mapping data from one “raw” data form into a meaningful format for storage and analysis.</p><p>Before starting to Clean and Transform the data,</p><ul><li>It’s better to define the business case</li><li>Data source investigation</li><li>Data profiling</li></ul><p>and understand the difference</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5urZDBrpcF56T2TkTZav4A.png" /><figcaption>Diff. between Cleaning and Transformation</figcaption></figure><h3>Benefits of data processing</h3><p><strong>Cleaning</strong></p><ul><li>Increases overall productivity</li><li>Protects applications from potential landmines, such as null values and unexpected duplicates</li><li>Gives the ability to map the different functions and what your data is intended to do</li><li>Figures out where errors are coming from, making it easier to fix incorrect or corrupt data for future applications</li></ul><p><strong>Transformation</strong></p><ul><li>Improves data organization</li><li>Protects applications from potential landmines such as incorrect indexing and incompatible formats</li><li>Facilitates compatibility between applications, systems, and types of data</li><li>Provides valuable information for your decision making</li></ul><h3>Steps involved in Data Processing</h3><p><strong>Transformation</strong></p><ul><li>Data interpretation</li><li>Data translation</li><li>Data profiling and quality checks</li></ul><p><strong>Cleaning</strong></p><ul><li>Data profiling</li><li>Remove duplicate or irrelevant observations</li><li>Fix structural errors</li><li>Filter unwanted outliers</li><li>Handle missing data</li><li>Validate and QA</li></ul><h3>Challenges while performing Data Processing</h3><ul><li>Resource intensive</li><li>Semantic Complexity</li><li>Multi-Source Problems</li><li>Single Source Problems</li><li>Need for subject matter expertise</li><li>Transformation and cleaning that doesn’t suit business needs</li></ul><h3>Comparison of tools used for Data Processing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzp3uVKpQQMK9XScsaCBzA.png" /><figcaption>Diff. between Apache Spark Vs AWS Glue Vs Talend Vs Apache Nifi</figcaption></figure><h3>Key takeaways</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YYX1zsPb9aR9kyp0" /><figcaption>Key takeaways</figcaption></figure><h3>Contributors</h3><p><a href="https://www.linkedin.com/in/sachin-a-248a2279/">Sachin Arora</a>, <a href="https://www.linkedin.com/in/aniruddha-more-28ba8240/">Aniruddha More</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1545a5e25bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-processing-e1545a5e25bd">Building Data Lake on AWS — Data Processing</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Data Lake on AWS — Data Lake Architecture and Data Ingestion]]></title>
            <link>https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-lake-architecture-and-data-ingestion-aa7a964a4cf?source=rss-5996506d8c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa7a964a4cf</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-data-lake]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sachin Arora]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 14:02:57 GMT</pubDate>
            <atom:updated>2021-09-22T06:26:41.338Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Data Lake on AWS — Data Lake Architecture and Data Ingestion</h3><h4>Compelling advantages of building data lake on the cloud with a scalable architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*VuQGJwpmkf3RziHB522bRQ.png" /><figcaption><a href="https://images.app.goo.gl/gQ2kSFWaPLxjn7HW6">Datalake</a></figcaption></figure><p>Our data footprint is constantly increasing. The world is filled with data but as the above image suggests, only 3% of it has been put to appropriate use. The need of the hour is not more data, but the capability to use it efficiently. <a href="https://www.clairvoyant.ai/">Clairvoyant</a> is an organization that is committed to helping companies uncover the true potential of their data. In the past 8+ years, Clairvoyant has helped 75+ organizations build a rational and data-driven decision-making process.</p><p>Now, through this blog, we wish to explain how data can be used efficiently. One of the first steps in this process is the ingestion of data into the data lake to gather it all in one place. As a precursor to this step, it is necessary to architect a data lake. Here, we also explain the process of architecting a data lake and building a process for data ingestion in it.</p><p>Data lakes are often used to consolidate all of an organization’s data in a single, central location, where it can be saved “as is,” without the need to impose a schema or structure on it upfront. Data in all stages of the refinement process can be stored in a data lake; raw data can be ingested and stored right alongside an organization’s structured, tabular data sources (like database tables), as well as intermediate data tables generated in the process of refining raw data. Unlike most databases, data lakes can process all data types including images, video, audio, and text.</p><p><strong>Challenges with Legacy Data Architectures:</strong></p><ol><li>It’s difficult to move the data across silos</li><li>Handling dynamic data and real-time processing becomes challenging in legacy data architectures</li><li>It’s difficult to deal with format diversity and the rate of change of data</li><li>Complex ETL processes</li><li>Difficult to find people with adequate skills to configure and manage these systems</li><li>It’s difficult to integrate with the explosion of available social and behavior tracking data</li></ol><p>We saw above, the major challenges we face while building a data lake. Now let’s try to understand data lake and its benefits over traditional data warehouses in depth.</p><p><strong>What is a Data Lake?</strong></p><ul><li><strong><em>Data:</em></strong> Non-relational and relational data from IoT devices (a single sensor data would be Non-relational, whereas multiple sensor data combined with each other to draw inference becomes relational), web sites, mobile apps, social media, and corporate applications.</li><li><strong><em>Schema:</em></strong> Defined at the time of analysis</li><li><strong><em>Performance:</em></strong> Optimized using low-cost storage and open data formats</li><li><strong><em>Data Quality:</em></strong> Any data that may or may not be curated (ie. raw data)</li><li><strong><em>Users:</em></strong> Data scientists, Data engineers, and Business analysts (using curated data)</li><li><strong><em>Analytics:</em></strong> Machine learning, predictive analytics, data discovery, and data profiling (Data quality checks and Data insights)</li></ul><p><strong>Benefits of a Data Lake:</strong></p><ul><li><strong>Data storage in native format</strong> — A data lake eliminates the need for data modeling at the time of ingestion. We can do it at the time of finding and exploring data for analytics. It offers unmatched flexibility to glean insights from a business or domain.</li><li><strong>Scalability</strong> — It offers scalability and is relatively inexpensive compared to a traditional data warehouse when we take scalability into account.</li><li><strong>Versatility</strong> — A data lake can store multi-structured data from diverse sources. In simple words, a data lake can store logs, XML, multimedia, sensor data, binary, social data, chat, and people data.</li><li><strong>Schema Flexibility</strong> — Traditionally, schema necessitates the data to be in a specific format. This is great for OLTP (Online Transactional Processing) as it validates data before entry. But for analytics, it’s an obstruction as we want to analyze the data as-is. Traditional data warehouse products are schema-based but hadoop data lake either allows you to be schema-free or lets you define multiple schemas for the same data. In short, it enables you to decouple schema from data which is excellent for analytics.</li><li><strong>Supports not only SQL but more languages</strong> — The traditional data-warehouse technology mostly supports SQL, which is suitable for simple analytics. But for advanced use cases, we need more ways to analyze the data. A data lake provides various options and language support for analysis. It has Hive/Impala which supports SQL but also has features for more advanced needs. For example, to analyze the data in a flow you can use PIG, and to do machine learning you can use Spark MLLib.</li><li><strong>Advanced Analytics</strong> — Unlike a data warehouse, a data lake excels at utilizing the availability of large quantities of coherent data along with deep learning algorithms. It helps in real-time decision analytics.</li></ul><p>We will now move onto building a data lake on the AWS cloud and the major benefits attached to it.</p><p><a href="https://s3-ap-southeast-1.amazonaws.com/mktg-apac/Big+Data+Refresh+Q4+Campaign/ESG-White-Paper-AWS-Apr-2017+(FINAL).pdf">ESG research</a> shows roughly 35–45% of organizations are actively considering cloud for functions like Hadoop, spark, databases, data warehouses, and analytics applications. It makes sense to build your data lake in the cloud for a number of reasons and some of the key benefits include:</p><blockquote>1) Runs on top of secured AWS data centre Infrastructure</blockquote><blockquote>2) Lets you build a secure Data lake in days</blockquote><blockquote>3) Offers compliance with PCI DSS, HIPAA, and FedRAMP</blockquote><blockquote>4) Lets you encrypt data at rest and in-transit</blockquote><p><strong>Logical Architecture for a Data Lake</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MwylTsiSo3hNeAl_" /><figcaption>Logical Architecture for any Data Lake</figcaption></figure><p><strong>Services used for building a Data Lake on AWS-:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DlS71tqb4DmLsY-e" /></figure><p><strong>S3 as a Data Lake Storage Platform:</strong></p><ul><li>Virtually unlimited scalability</li><li>99.999999999% durability</li><li>Integrates with a broad portfolio of AWS and third-party</li><li>Decoupling of storage from computation resources and data processing resources</li><li>Centralized data architecture</li><li>Integration with cluster-less and serverless AWS services</li><li>Standardized APIs</li></ul><p><strong>Different S3 Storage Classes for storing Hot and Cold data-:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7_48rgL82E2Va6q31a8AA.png" /><figcaption>Different S3 storage classes</figcaption></figure><p><strong>Open data formats on S3-:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEtgSxrOrM-P0xWR1I1AFA.png" /></figure><p><strong>Ingestion Tier</strong></p><p>The ingestion tier mainly consists of the below categories-:</p><ul><li><strong>Real time</strong></li><li><strong>Micro batching</strong></li><li><strong>Mega batching</strong></li></ul><p>Let’s compare some of the tools and technologies used for importing data to Data lake:</p><p><strong>Comparison of tools used for Real-time data streaming</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtW6lGW8sVPtAgdh0WVaNw.png" /><figcaption>Kinesis vs Kafka vs MSK</figcaption></figure><p><strong>Comparison of tools used for Micro and Mega Batch data ingestion:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wRMu9loFeGzZUXBIWCafA.png" /><figcaption>SQOOP vs Apache Spark vs AWS Glue vs AWS DMS vs Apache Nifi</figcaption></figure><p>One can opt for any of the above frameworks for Realtime, Micro, and Mega batch ingestion based on the different options available and specific business requirements.</p><p>Let’s see a comparison between some of the schedulers we looked into for scheduling our jobs:</p><p><strong>WorkFlow Engines Comparison</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ld_CC7vgTCvMLHtE8bbDYQ.png" /><figcaption>AWS Step Function vs AWS Data Pipeline vs AWS Glue vs Apache Airflow</figcaption></figure><p>After looking into the different options available and according to business requirements, one can opt for any of the above frameworks.</p><p><strong>Key Takeaways</strong></p><p>This marks the end of our first blog series on building a data lake on AWS (Ingestion tier).</p><p>Let’s look into a few of the key takeaways for implementing the ingestion solution-:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yYLkPaYadJ7wGJxk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y0Aswks_Tga1hFJa" /></figure><h3>Contributors</h3><p><a href="https://www.linkedin.com/in/sachin-a-248a2279/">Sachin Arora</a>, <a href="https://www.linkedin.com/in/aniruddha-more-28ba8240/">Aniruddha More</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa7a964a4cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/building-data-lake-on-aws-data-lake-architecture-and-data-ingestion-aa7a964a4cf">Building Data Lake on AWS — Data Lake Architecture and Data Ingestion</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>