<?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 Gaja Krishna Vaidyanatha on Medium]]></title>
        <description><![CDATA[Stories by Gaja Krishna Vaidyanatha on Medium]]></description>
        <link>https://medium.com/@gvaidyanatha?source=rss-6c39cf3d26f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bi6_4jzTFbiYVNI4cWi8Kg.jpeg</url>
            <title>Stories by Gaja Krishna Vaidyanatha on Medium</title>
            <link>https://medium.com/@gvaidyanatha?source=rss-6c39cf3d26f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:50:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gvaidyanatha/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[Architecting Serverless Data Integration Hubs on AWS for Enterprise Data Delivery (2022)]]></title>
            <link>https://medium.com/@gvaidyanatha/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2022-6eba5edf93a0?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eba5edf93a0</guid>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Fri, 26 Aug 2022 23:59:20 GMT</pubDate>
            <atom:updated>2022-09-02T16:10:48.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXrZAt3LkVYJVz3NtTYwNw.png" /><figcaption>Architecting Serverless Data Integration Hubs on AWS</figcaption></figure><h4>High-quality data delivery for the modern enterprise’s analytics, machine learning and artificial intelligence programs</h4><h3>Introduction</h3><p>Greetings from your friendly neighborhood data padwan :) In the past couple of years, I have had the pleasure of designing, architecting &amp; developing serverless data integration hubs on AWS. This article is an update to the 2020 version that I wrote on the subject.</p><p>Here, I have validated prior content for relevance (a lot changes in 2 years) and modified the architecture diagrams appropriately. Also, I have augmented Transformation &amp; Analytics pillars, with some new content. Further, the advent of <em>Amazon Redshift Serverless</em> in November 2021, changed the game for me in the context of choices of Columnar Cloud Warehouses. Lastly, <em>Amazon SageMaker</em> now has support for serverless inferences.</p><p>Rhetorical question — If <em>data is the new oil</em>, why do we experience so many backfires in our systems? In a prior 2-part article series titled <strong><em>Serverless Data Integration</em></strong>, the importance of data integration, particularly in the serverless realm was discussed in good detail. We concluded that data integration was a critical business need, that had to be proactively and centrally addressed by every IT organization. To reiterate, Data Integration focuses truly on delivering value to the business, by enabling true analytics, machine learning and AI initiatives fed with clean and standardized data. Without high quality data, business insights generated via various analytics, machine learning and AI initiatives, will be questionable at best. In case you’ve missed it, here are the links to the previous article series:</p><p>1) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">Serverless Data Integration — Part I (2019)</a></p><p>2) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb">Serverless Data Integration — Part II (2019)</a></p><p>In this article, I’d like to clarify some additional points related to our topic of discussion. I also wish to share a sample reference architecture of a Data Integration Hub (henceforth referenced as <strong>The Hub</strong>) implemented on Amazon Web Services (AWS).</p><h3>Clearing the Air</h3><h4>Data Integration Hubs are not Data Lakes</h4><p>Data Lakes store data in near exact native format. That may be adequate for certain bespoke analytics initiatives, but a centralized data service that cleanses, standardizes and makes data compliant with all prevailing regulatory requirements, delivers better value to the business. The value proposition of a Hub is simple — write once read many (WORM), ensure data quality, standardization and compliance. Keep in current and don’t let the data go stale!</p><p>To achieve this, a Hub employs the concept of ELTn (Extract Load Transform) instead of the classic ETL (Extract Transform Load). ELTn implies that transformation is not a single occurrence that occurs before loading of the data. It is a continuous process and occurs multiple times in the lifetime of the data supporting a specific business function. The goal is to eventually reach a high-level of data hygiene such that all data is CLEAN. The Hub enables the paradigm of continually maintaining up-to-date ‘business objects’, matching the transformation that the business undergoes.</p><p>Once data from a given ingestion process is marked as CLEAN, all downstream applications can consume data from the Hub. It is also usual and customary to create a CURATED version of data from CLEAN, where the FACTs &amp; DIMENSIONs of a star-schema warehouse are materialized. This flow minimizes the load on back-end system-of-record systems for data extracts, not to mention repeated and wasteful efforts in data cleansing. Plus, data quality and compliance adherence can be done once, in a centralized location. This enables high-quality and business-relevant enterprise data delivery. Let’s make data clean and compliant once. This is what a Hub does.</p><p>The Hub solves the problem of rampant Data Silos that have emerged over many years of bad data management. Contrasted with a Data Lake, a Hub is a living breathing and constantly evolving centralized authorized data distributor for the enterprise. As mentioned before, Data Lakes bring together disparate data sources and store in near exact original format. A Hub does much more by providing the required quality, standardization and compliance for all data initiatives within the enterprise.</p><h4>Could we please walk before we attempt to run?</h4><p>Ask any C-level executive today, as to the top priority (s)he is on the hook for and the answer is almost always ‘<em>Need to do something with Artificial Intelligence (AI)</em>’. In some responses you may replace AI with ‘<em>Machine Learning (ML)</em>’ but that’s close enough, given ML is a prerequisite for AI. Everybody wants to do AI, but before we embark on that journey, we need to build a rock-solid data engineering framework that creates/feeds/maintains a Hub. Ask any data scientist how much time (s)he spends in cleansing and wrangling data just for their specific project. The answer to this question will bring out the apparent value of a centralized Hub. Plus, the Hub enables more output from the Data Science team, as they can focus purely on their skills — data science, not data cleansing or data wrangling. Remember WORM is good, WORO is not :)</p><p>Data Engineering thus is a fundamental requirement for all data-driven businesses. Data is one of the fundamental drivers of positive change in the business. Many IT organizations’ have modified their mindset to support Data Engineering as a core competency and this is manifesting rapidly due to the criticality of this new business need.</p><p>Monica Rogati’s excellent article on Hackernoon (<a href="https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007"><em>AI Hierarchy of Needs</em></a>) from June 2017 is still very relevant to our topic of discussion. The following graphic referenced from that article is an exposition of the core idea that, in life we need to get the basics done first before reaching for the esoteric aspects. My two customizations to Ms. Rogati’s graphic are the use of <strong>ELTn</strong> instead of <strong>ETL</strong> and outlining the Hub’s function in the pyramid.<strong> </strong>We thank Mr. Abraham Maslow for showcasing and illustrating his work using the pyramid many moons ago. Figure 1 is a picture worth a thousand words. Thank you, Ms. Rogati!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiQy8ITgxUdreN80Z0oa2w.png" /><figcaption>Figure 1: Could we please walk before we attempt to run?</figcaption></figure><h4>Structure is in the eye of the data practitioner!</h4><p>Just as beauty is in the eye of the beholder, so is the inherent structure of data — it is in the eye of the data practitioner. The demarcation of what one wants to store in a relational table versus a NoSQL datastore or BLOB storage is a relevant discussion to engage in. However, the value of delineation of data as structured, semi-structured and unstructured is up for debate.</p><p>Please allow me to explain this in Figures 2 &amp; 3 as we take a look at a sample web log and a tweet, both regularly classified as unstructured data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Or9Kkk9NQhWQC8e9O9cJQQ.png" /><figcaption>Figure 2: Data structure of a sample web log</figcaption></figure><p>Figure 2 illustrates the contents of a publicly available web log from NASA. One immediately wonders the reason why a web log is classified as unstructured, as the above contents can very easily be stored in a relational table. Now, we may not want to store this in a relational table for a variety of other reasons (such as volume of data and in-turn performance of retrievals) but that is a different discussion altogether. That still doesn’t change the fact that the above web log sample is well structured data.</p><p>Let’s now take a look at the structure of a sample tweet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uami_-x_lSPO6Y9JvAp9iw.png" /><figcaption>Figure 3: Data structure of a sample tweet</figcaption></figure><p>Figure 3 illustrates the structure of a tweet. Yes, it is in JSON format and the data is stored in a NoSQL database, but why does that necessarily make this unstructured? In the eyes of a data practitioner, this is a beautiful flexible structured business object.</p><p>For a data practitioner, all data possesses structure. Structure is present even in audio and video files. Now a video file may not possess the ‘required structure’ to store it in a ‘table’. But then again, we seem to inadvertently (and in my humble opinion incorrectly) equate the existence of structure to the existence of a table. For the above reasons and the purposes of this article, data shall be classified as relational and non-relational. If it makes sense to store it in a table, it is relational. If it does not, it is non-relational. There are many non-relational data stores that are fit-for-purpose, depending on the characteristics of data. Let’s use the one that gets the job done right.</p><h4>Relevance of Quiet Time &amp; Workload Costing</h4><p>In part II of the prior article series, I introduced the concept of Quiet Time, as a relevant yardstick that we utilize while deciding whether or not a given workload qualifies to be serverless. It is important to note that not all workloads truly qualify for serverless computing. A Hub is a posterchild for a serverless computing implementation, due to the nature of processing. Hubs are mostly unpredictable with regards to data volumes that need to be processed on a given day. In addition, the timing of ingestion and other related tasks require dynamic scaling for optimal performance. More often than not, a Hub also has pockets of idle time during a 24-hr time period. All of this makes it an ideal candidate for serverless.</p><p>The following is a simple formula to calculate Quiet Time(<strong><em>qt</em></strong>) of a workload, that assists in identifying the feasibility of serverless computing:</p><p><strong><em>qt = round (((x/86400) * 100),2)</em></strong>%<br>where, <strong>x </strong><em>= ‘</em><strong><em>workload idle time</em></strong><em>’, measured in seconds over a 24-hr period</em></p><p>In the above formula, Quiet Time (<strong><em>qt</em></strong>) is calculated as a percentage of the workload’s idle time (<strong><em>x</em></strong>) over the elapsed time in a day — 24 hours = 86,400 seconds. <strong><em>qt</em></strong> is important in determining the relevance of serverless computing in a given context. For example, if a given workload is idle on an average of 25,300 seconds on any given day, this implies that <strong><em>x=25300</em></strong>, allowing us to derive:</p><p><strong><em>qt = round (((25300/86400) * 100),2) = 28.28%</em></strong>.</p><p>In the above example, we conclude that the application is quiet for <strong>28.28%</strong> of any given day, thus making it a potential candidate for serverless computing. We will know for sure, once we complete the costing exercise. The point is this — if your application does not demonstrate pockets of idle time/quiet time and is constantly processing 24x7x365, serverless may not be the right choice.</p><p>We now calculate the cost of the relevant serverless and server-based services, to determine which one is better. The lower of the 2 costing efforts, will guide us to the preferred option:</p><p>a. <strong><em>scc</em></strong> — serverless computing cost<br>This is the cost for utilizing serverless computing services. Serverless computing costs are usually comprised of number of function execution requests, CPU &amp; RAM requested in <em>AWS Step Functions/Lambda</em>, <em>API Gateway</em> requests for such function execution requests and any other service that is specifically required to support the given workload (including database costs such as <em>Amazon DynamoDB, Amazon Aurora Serverless </em>or <em>Amazon Redshift Serverless</em>). There are no compute costs associated with <em>idle time/quiet time</em> in serverless computing. In the context of the serverless database offerings, the only permanent cost is storage.</p><p>b. <strong><em>tcc</em></strong> — traditional computing cost (server-based)<br>This is the cost for utilizing server-based computing services. These computing costs are usually comprised of compute engines for application and database servers (<em>AWS EC2, EKS, ECS as relevant</em>), programming language software licensing, database software licensing, personnel costs associated with software maintenance of the said server-based services (install, patching, upgrades of operating system, programming language software and other 3rd party software) and actual cost of software maintenance fees (paid to vendors). In this model, there are compute and other costs associated with <em>idle time/quiet time</em> for all compute platforms.</p><p>If <strong><em>scc &lt; tcc</em></strong>, it is clear that the workload qualifies for serverless even from a cost standpoint. If <strong><em>scc &gt; tcc</em></strong>, it is obvious that serverless will cost more than the server-based model. However, there may be other reasons that drive the serverless model to be the preferred option. These may include (among others), a lack of deep technical talent within the organization to support the upgrade and maintenance of the workload’s software and database stack in the relevant compute platforms.</p><p><strong>Notes:</strong></p><p><em>1.</em> <em>It may be argued that the AWS support fees should also be factored into </em><strong><em>scc </em></strong><em>and this could be done if there were a method to determine prorated AWS support fees, calculated only for the serverless services. This is easier said than done, but in the interest of simplicity, this should be considered as a common cost between both models and thus excluded.</em></p><p>2. <em>Storage costs for services such as S3, networking, data transfer (ingress and egress) can also be deemed as common to both </em><strong><em>scc</em></strong><em> and </em><strong><em>tcc</em></strong><em>. Thus, these components can also be removed from the costing. Add these costs to </em><strong><em>scc</em></strong><em> ONLY if they are relevant to it and not to </em><strong><em>tcc</em></strong><em>.</em></p><h3>Architecture of a Serverless Data Integration Hub on AWS</h3><h4>The 4 Layers</h4><p>There are 4 Layers/Pillars in the Hub and it manifests on AWS as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXrZAt3LkVYJVz3NtTYwNw.png" /><figcaption>Figure 4: Pillars of a Serverless Data Hub</figcaption></figure><p>Data flows through the 4 layers of the Hub. Each layer supports an independent function of the Data Integration Architecture. The 4 Layers/Pillars are:</p><p>1. Ingestion</p><p>2. Persistence</p><p>3. Transformation</p><p>4. Analytics/ML/AI</p><p>The architecture is purpose built utilizing independent services. This enables scaling each layer independently, supports abstraction to manage complexity, decouples services to avoid serialization, automatically provisions resources (where feasible) and facilitates an asynchronous execution model. In many ways these are fundamental tenets of cloud computing.</p><h4>Drilldown into the 4 Layers/Pillars</h4><p>Figure 5 illustrates the relevant services and details within each Layer/Pillar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRTB7m2XX3pWURoI0-5I5w.png" /><figcaption>Figure 5: Architecture details of the Serverless Data Hub</figcaption></figure><p>Now let’s dive a little deeper into each Layer/Pillar.</p><p><strong>Ingestion</strong> is the first layer (Layer #1) where data from multiple sources enters the Hub. For batch extracts, the landing zone for the data is a serverless <em>Amazon S3</em> bucket where the data is pre-processed for certain rudimentary checks with <em>Amazon Athena</em>. A microservice (<em>AWS Step Functions/Lambda</em>) processes the data, on the <em>event</em> of data successfully landing in S3. The equivalent <em>Amazon Kinesis</em> real-time data streams processing service takes care of the streams of data, that arrive into the Hub in sporadic bursts.</p><p><strong>Persistence</strong>, the second layer (Layer #2) of the architecture, plays the crucial role of storing data in the Hub. <em>Amazon DynamoDB</em> plays a huge role here, as it is the centerpiece of Data Integration. Layer #2 stores, manages and maintains business objects. When data is ingested in Layer #1, it is transported to Layer #2 and stored in a <em>near-raw-format</em> within RAWDB (set of tables for RAW data). More complex data validation routines are performed in the Transformation Layer. The persistence of Business Insights in Layer #4 is done using <em>Amazon Aurora Serverless or Amazon Redshift Serverless</em>, if certain business function’s data consumption model is table-based data, instead of JSON-based business objects. Further, <em>Amazon Redshift Serverless </em>provides the function of a Cloud Datawarehouse, with its columnar storage capability, which plays a huge part in the performance of real-time analytics.</p><p><strong>Transformation</strong> is the third layer (Layer #3) which handles the complexity of creating CLEAN business objects. The transformation layer’s complexity and heavy lifting relates to ensuring that data is conformant to data quality rules, business rules and compliance rules/policies. The arrival of data in RAWDB of Layer #2, is <em>the next event</em>, that triggers the main transformation microservice and its related sub-microservices to fire. These event-based microservices are implemented in <em>AWS Step Functions/Lambda</em>. Data that fully conforms to all predefined transformation rules is persisted in CLEANDB (another logical container with a set of relevant tables for CLEAN data) and erroneous/non-conformant data is stored in ERRORDB (the 3rd logical container for ERROR data). This completes Phase I of transformation. As mentioned in an earlier section, the creation and maintenance of CURATEDB, which is populated from CLEANDB is a necessary and relevant logical next step. The FACTs and DIMENSIONs of a data warehouse are maintained in CURATEDB, which is continuously fed with data from CLEANDB. When the persistence of data in CURATEDB is successfully completed, Phase II of transformation, is deemed as complete. Stating the obvious here, <em>Amazon Redshift Serverless </em>serves as a fit-for-purpose database service for the persistence of CURATEDB, due to its columnar storage capabilities.</p><p><strong>Analytics/Machine Learning (ML)/Artificial Intelligence (AI)</strong> is the fourth layer where Business Insights (BI) are generated. This layer is triggered by the arrival of data in CLEANDB within Layer #2 (<em>the</em> <em>next event</em>). This layer supports the calculation and storing of Key Performance Indicators (KPIs) for the business and the management of Analytics/ML/AI jobs. The results of all jobs (BI) are stored in INSIGHTSDB (the 4th logical container for INSIGHTS within <em>Amazon DynamoDB</em>, <em>Amazon Aurora Serverless or Amazon Redshift Serverless</em> as appropriate). Multiple serverless services are utilized here for generation of Business Insights (<em>Amazon S3, Amazon Athena, Amazon Fargate, Amazon SageMaker)</em> in this layer. <em>Amazon Fargate</em> is listed to facilitate the concept of serverless containers that run analytics and machine learning algorithms to generate BI and store in INSIGHTSDB.</p><p>When data passes through all 4 layers, it completes a single data integration cycle. The cycle is repeated, as and when new/modified data flows into the Hub from back-end systems or when data is either augmented, corrected and reprocessed to move from ERRORDB to CLEANDB.</p><p><strong>Note:</strong></p><p><em>In the long run, the persistence and management of historical data (RAWDB &amp; CLEANDB) needs to be addressed via standard Information Lifecycle Management (ILM) measures that utilize various tier-based-data-persistence services. AWS supports this with a multi-tiered storage provisioning model with Amazon S3 Glacier and Amazon S3 Glacier Deep Archive. This ensures data persistence costs are maintained at optimal levels while adhering to all regulatory requirements.</em></p><p><strong>Visualization</strong> also plays an important role in information delivery within the enterprise. This is where the BI Dashboards come to life and deliver value to the business. In maintaining the serverless paradigm, <em>Amazon QuickSight </em>is an option for the future, when direct access of data via RESTful endpoints in <em>API Gateway</em> is supported<em>.</em></p><h4>Consumption Pattern</h4><p>On generation of BI, applications need to be enabled to consume data from INSIGHTSDB, CURATEDB &amp; CLEANDB in real-time. This consumption is done via the Data Access Layer (DAL) as illustrated in <em>Figure 5</em>. Utilizing RESTful endpoints (<em>API Gateway</em>), consumption of BI and the underlying data for the various business objects is supported. Data retrieval from relational data stores such as <em>Amazon Aurora Serverless or Amazon Redshift Serverless</em>, is achieved by utilizing the <em>Data API for Amazon Aurora Serverless</em>. It is important to note that <em>API Gateway</em> is the single doorway for data consumption. This service virtually eliminates all unwarranted external data breaches and data leaks, as it serves data only when the data request is accompanied by the required credentials. These required credentials (<em>security credentials and data entitlements</em>) are received from an enterprise’s federated authentication systems (<em>AD, LDAP</em> etc.) in concert with the <em>AWS Identity and Access Management </em>(<em>Amazon IAM</em>) and <em>Amazon Cognito</em>.</p><p>The well-defined RESTful endpoints created with <em>API Gateway</em>, not only obviates the need for persistent database connection management to the Hub, but also eases the impact of changes to data structures. For example, an application that is receiving and processing JSON documents (business objects) from the RESTful endpoints, can continue to do so regardless of all data structure changes (adding or dropping of data elements). This ensures runtime flexibility of both the applications and the Data Hub, in an ever-changing business environment.</p><p><strong>Notes:</strong></p><p><em>1.</em> <em>Although not explicitly illustrated, all standard networking and isolation security best practices should be assumed. This is in line with the AWS Well Architected Framework.</em></p><p><em>2.</em> <em>In the interest of brevity, the architecture diagrams have not been duplicated to portray CURATEDB or the use of Amazon Redshift Serverless. It is easy enough to replace INSIGHTSDB with CURATEDB and Amazon DynamoDB/Aurora with Amazon Redshift where applicable.</em></p><h3>What does the Hub really deliver?</h3><p>The goal of the Hub is to deliver up-to-date business objects that provide a 360-degree view of any facet of the business. Figure 6 illustrates an integrated Customer Business Object that is built in a ‘Hub &amp; Spoke Model’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ek8ZD77K1peuibW5QgY9Xw.png" /><figcaption>Figure 6: Sample integrated business object — CUSTOMER</figcaption></figure><h3>Conclusion</h3><p>AWS provides a rich set of services to architect and build Serverless Data Integration Hubs. The value of high-quality and standardized data delivered to the enterprise is a critical function that needs to be proactively addressed via data engineering. To state the obvious, good data generates meaningful business insights. And that is true value added to the business. I wish you the very best in all of your data integration efforts. Take good care of yourself and stay in touch!</p><h3>References</h3><ol><li>Can we please walk before we try to run? — <a href="https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007">https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007</a></li><li>Data Structure of a Web Log — <a href="http://opensource.indeedeng.io/imhotep/docs/sample-data/">http://opensource.indeedeng.io/imhotep/docs/sample-data/</a></li><li>Data Structure of a Tweet — <a href="https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json">https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json</a></li><li>AWS Architecture Icons — <a href="https://aws.amazon.com/architecture/icons/">https://aws.amazon.com/architecture/icons/</a></li><li>Serverless Data Integration — Part I (2019), Gaja Vaidyanatha — <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a</a></li><li>Serverless Data Integration — Part II (2019), Gaja Vaidyanatha — <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb">https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb</a></li><li>Architecting Serverless Data Integration Hubs on AWS (2020), Gaja Vaidyanatha — <a href="https://towardsdatascience.com/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2020-a27b42569518">https://towardsdatascience.com/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2020-a27b42569518</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eba5edf93a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Data Integration — Jedi Master Yoda’s Ten Pearls of Wisdom (2020)]]></title>
            <link>https://medium.com/data-science/serverless-data-integration-jedi-master-yodas-ten-pearls-of-wisdom-2020-fa536cf3724a?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa536cf3724a</guid>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 21:53:13 GMT</pubDate>
            <atom:updated>2020-06-05T15:26:01.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*FraDZdo3qBPkgrTcCOemiA.jpeg" /><figcaption>Image credit — flickr.com:atomtetsuwan2002</figcaption></figure><h3>Serverless Data Integration — Jedi Master Yoda’s Ten Pearls of Wisdom (2020)</h3><h4>Important lessons learned during a serverless data integration project</h4><h3>Preamble</h3><p>Greetings of love, peace, health, and harmony! The year was 1980 and I was a young teenager watching my first <em>Star Wars</em> film — <em>The Empire Strikes Back</em> <em>(Episode V)</em>. It fascinated me beyond belief and made an indelible impression. Almost forty years later, I’m still a fan. <em>Jedi Master Yoda</em> is my all-time favorite character in the <em>Star Wars</em> trilogies.</p><p>To make this article a better read, I have utilized <em>Master Yoda’s</em> anastrophe format of speech, which makes sharing ‘<em>The Pearls of Wisdom</em>’ more fun. When you read the 10 pearls aloud, imagine it rendered in the master’s voice :)</p><p>These pearls were the lessons I learned during my first serverless data integration project. It is comparable to the first time a Jedi uses her lightsaber for a worthy cause. The experience was (still is) invaluable and I hope you will derive value from it. When it comes to serverless data integration one of Master Yoda’s famous quotes comes to mind — <em>Do…or do not. There is no try!</em> Let’s begin.</p><h3>The Pearls of Wisdom</h3><p>Data Integration creates a single version of the ‘data truth’ in an enterprise. It delivers high-quality standardized data to the enterprise, thus enabling Analytics, Machine Learning, and AI. Serverless Data Integration empowers organizations to deliver great data whilst optimizing operational costs. Here are the lessons I learned:</p><h4>#1 — Separate you must, Serverless Functions from State!</h4><p>A serverless microservice is transient and ephemeral by nature. It is triggered by an event and performs a specific action in response, and then it’s done. The memory contents of a microservice’s micro-container should never be attempted to be directly shared beyond the current invocation. Forcing serverless applications or function invocations to directly share state outside its scope, will result in a sub-optimal design. This affects scalability and introduces a multitude of unwanted side effects. When required, the microservice should write transitory state information to a database (<em>Memcached or Redis</em>). In the case of writing permanent logs, other reliable and durable data persistence mechanisms should be used. This is true even for a Data Integration Hub (Hub).</p><h4>#2 — Measure you shall, a System’s Quiet Time!</h4><p>Not all workloads truly qualify for serverless computing. A Hub is a poster-child for a serverless implementation and is characterized by bursts of activity followed by periods of quiet time. It is mostly unpredictable in its nature. Over and above the normal operations, a Hub needs to support — differing daily data volumes, ingesting and processing data with no preset timing (no scheduled jobs) and performing specialized one-off transformations, as necessary. More often than not, this unpredictable nature of a Hub’s daily processing requires dynamic and instant compute-scaling for optimal performance. And once the operations are complete, the Hub goes <em>quiet</em>. Understanding the <em>Quiet Time</em> characteristics of the Hub, enables us to accurately quantify operational costs savings. In the end, idle time should not cost us anything, implying the following — Operational cost optimization with serverless computing is a function of <em>Quiet Time</em>.</p><h4>#3 — Optimize you will for Function Elapsed Time, Distract Not with Function Resource Allocations!</h4><p>In the world of system performance optimization, the following formula is considered the holy grail:</p><p><em>Response Time (Elapsed Time) = Service Time + Wait Time</em></p><p>Response Time needs to be the optimization goal for all components of the Hub. Every microservice needs to be optimized to the shortest possible elapsed time. This concept probably holds true for all computing applications, not just Hubs.</p><p>In <em>AWS Lambda</em>, there is direct correlation between the amount of memory one allocates to a <em>Lambda</em> function and its projected cost. Cost (per second) increases proportionately to the amount of memory allocated. It is a well-established fact that larger memory allocations, result in proportionally scaled vCPU core allocations. <em>AWS Lambda</em> allocates a single vCPU core proportionate to the amount of memory (up to approximately 1.75–1.8 GB). Beyond this memory threshold, 2 vCPU cores are allocated and proportionally scaled.</p><p>With a dual-threaded microservices design, it is possible to leverage the additional provisioned resources (CPU &amp; memory) for better performance. This directly results in reduced elapsed times and lower costs. Remember that you are charged for the runtime of your program and elapsed time optimization should be your only focus. Needless to say, the <em>Law of Diminishing Returns</em> will play its part in resource allocation (memory). The goal is to allocate enough memory until the ‘inflection point’. Thus, bulky data operations in a Hub are great candidates for dual-threaded microservices, that leverage 3GB of memory and 2 vCPUs.</p><h4>#4 — Not necessarily are constraints, these Function Runtime Limits!</h4><p>The current runtime limit of an <em>AWS Lambda</em> function is <strong><em>900 seconds</em></strong>. This limitation can be easily overcome (if needed), with simple orchestration logic in an <em>AWS Step Function</em>. Using a simple timer and a data processing tracker (pointer that keeps track of processing progress), the program’s runtime execution is monitored. The <em>function</em> is relaunched at the appropriate time (say 10 seconds before timer expiry), ensuring continuous program runtime beyond <em>Lambda’s</em> 900-second limit.</p><p>Having said the above, I’d like to remind us all that a <em>microservice</em> implies a light-weight architecture and a short runtime (Stated with utter humility — What part of <em>micro</em> did we not understand :) ?). I believe that when a microservice is designed optimally, it should not require a runtime beyond 15 minutes. In the case where large data volumes need to be processed, the same microservice can be orchestrated using a <em>Step Function</em>, to launch multiple parallel executions, all individually completing within 15 minutes.</p><h4>#5 — Irrelevant are these Function Latency &amp; Cold Start Debates!</h4><p>Function Latency is the term used to quantify the elapsed time to launch an <em>AWS Lambda</em> function. It denotes the time it takes to <em>reuse</em> an already provisioned micro-container. It is a relevant discussion point when multiple independent executions occur within a short time period. When the function execution frequency is greater than 30 minutes, the micro-container needs to be <em>re-provisioned</em> from the ground-up. This is referred to as a <em>Cold Start</em>. One of the methods to solve this issue is by leveraging ‘Provisioned Concurrency’ within the <em>Lambda</em> Function configuration. But there is a flat cost associated with it, which negates <em>Quiet Time</em> and cost savings constructs. A Hub by nature, is not sensitive to function latency or even cold starts. It is not an ALWAYS ON application, processing 100s of API calls per second, every minute of every hour, 24x7x365. Thus, the issue of function latency and cold starts are not relevant to a Hub.</p><h4>#6 — Differentiate you must, between Idempotent &amp; Duplicate Processing!</h4><p><em>Idempotent</em> is a fundamental construct of computer science that defines the end state of a program’s execution. Idempotent execution requires that, with the same set of input values, the end state of the program, remains exactly the same, no matter how many times the program is run. For example, a program that modifies the address of a customer to ‘123 Main Street’ is idempotent, no matter how many times we run it. The end state of the customer’s address is ‘123 Main Street’. There are no adverse side effects of running this program multiple times. So, whether a program is idempotent or not, depends on the program’s requirement, context, design and the data manipulated.</p><p>There is question and debate on why <em>AWS Lambda</em> does not guarantee <em>Idempotent</em> execution. Due to the dynamic and asynchronous nature of how a <em>Lambda</em> function comes to life (including launching of micro-containers during a cold start), there are some edge cases when multiple containers can be launched simultaneously for a single execution request. As practitioners of Cloud Computing, we need to design with one important principle — ‘<em>everything that can break, will break</em>’. Thus, the environmental side-effect of <em>AWS Lambda</em> discussed above, needs to be proactively addressed. It is a simple case of preventing duplicate data processing.</p><p>As data practitioners, we all subscribe to designs that protect systems from any accidental duplicate processing of the same dataset. These safeguards are built within the confines of program logic. This is absolutely true and required for a Hub. The scenario of duplicate data processing is similar to consumption management of a message queue. To ensure the integrity of processing, design constructs such as <em>always once</em> processing should be preferred over <em>at least once</em> processing. One can’t blame the queue for generating duplicate data, when the consumption construct is <em>at least once</em>. Thus, <em>Lambda</em> functions not being idempotent is moot. Regardless of whether a program is idempotent or not, designing safeguards for duplicate data processing in a Hub is non-negotiable and must be incorporated.</p><h4>#7 — Refrain you shall, from hard-wiring functions to your VPC!</h4><p><em>AWS Lambda’s</em> compute resources all run within <em>Lambda’s</em> service <em>VPCs</em>. <em>Lambda</em> invocations can occur <strong>only</strong> via the <em>AWS Lambda API</em>. There is no provision for ‘network access’ to the execution environment where the functions run, thus one can’t just hack into a <em>Lambda</em> invocation and its execution micro-container. The default behavior of <em>AWS Lambda</em> (when not hard-wired to your <em>VPC</em>) is that it can access anything in the public domain, even outside <em>AWS</em>. Just because an ephemeral function can access public resources, does not automatically imply that it will. One can debate about the security angle <em>ad nauseum</em> but for an ephemeral serverless compute environment (not accessing your <em>VPC</em> resources), <em>VPC</em>-hardwiring is unnecessary.</p><p>When a <em>Lambda</em> function is hard-wired to your <em>VPC</em>, it creates an <em>Elastic Network Interface (ENI) </em>within your <em>VPC</em>, allowing access to private resources. This counts towards your account limits (IP addresses, API rates, network rates) in the region where you operate. When you attempt to ramp up and scale function invocations, you will be challenged by these account limits, as each invocation of a <em>VPC</em>-wired function requires an <em>ENI</em>. In the case of a Hub, <em>Lambda</em> functions require access to <em>VPC</em> resources (data) and therefore is recommended to be accessed via a private subnet for security and segregation purposes. Function internet access is usually not relevant for a Hub but should be controlled via a <em>VPC NAT Gateway </em>when required and applicable.</p><p>In September 2019, AWS introduced a more efficient method for functions to communicate with your <em>VPCs</em> using <em>AWS Hyperplane ENIs</em>. This new and improved <em>VPC</em> networking, eliminates the multitude of runtime <em>ENIs</em> that were previously created within your <em>VPC</em>. With the new method, <em>Lambda</em> functions connect to <em>Hyperplane ENIs</em>, which in turn manage connections to your <em>VPC</em> <em>ENIs </em>(one per security group:subnet).<em> </em>In doing so, it eliminates direct <em>ENI</em> connections, makes <em>VPC</em> networking more scalable and reduces lag-time for <em>VPC</em>-wired function invocations.</p><h4>#8 — Observe you will, the workings of Serverless Functions!</h4><p>The serverless environment has a perceived lack of <em>function observability</em>. This is due to transient nature of the compute environment. In contrast, in a server-based environment, one always has the ability to observe program execution via various tracing methods. Function observability is thus the act of observing the execution behavior and related details.</p><p>Although there is a default standard set of metrics logged in <em>CloudWatch</em> logs of AWS for function executions, applications with scores of function-calls a day, create issues in the data mining of function-specific details from <em>CloudWatch.</em> This is analogous to <em>finding a needle in a haystack</em>. Of course, there is <em>AWS X-Ray</em> for function debugging and tracing. However, I believe we need better control of what we <em>observe</em>.</p><p>Within a Hub, each microservice should be instrumented with a logging function, writing to a <em>log table</em> of our choice. We now control what we want to observe in a function’s execution. A little investment in design of the <em>log table</em> goes a long way. Here are some rudimentary attributes of logging — <em>function_name, run_date, run_time, total_elapsed_time, object_name, num_rows and call parameters</em>). These attributes give us a head-start and we can augment it according to our evolving needs. This adds significant production monitoring value for your serverless Hubs. Here are the highlights:</p><p>1) Tailor-made structure for the persistence of <em>function execution logs</em>, i.e., no <em>one-size-fits-all</em> standard</p><p>2) Flexible logging granularity based on execution criteria and logging levels, i.e., <em>higher granularity</em> during debugging/ troubleshooting vs. <em>lower granularity</em> during normal operations</p><p>3) Easy visualization for conversion of logs to actionable information (<em>AWS ElastiCache</em>), i.e., clear picture of the Hub’s health</p><p>4) Customized retention of <em>log history</em> controlled by your requirements for performance baselines with time periods that you define</p><p>Thus, function observability, a critical aspect of a Hub’s operations management, is something we need to own and not depend just on <em>CloudWatch</em>.</p><h4>#9 — Abstract you must, to avoid Cloud Vendor lock-in!</h4><p>Give a serverless discussion enough time and it will turn into a Cloud Service Provider (CSP) lock-in debate. It is true that CSP lock-in can occur, without the necessary upfront design effort. If you have hardcoded proprietary SDK API calls within your serverless functions, you are probably locked in. And this true even for server-based applications — hard-coding is a bad practice!</p><p><strong>Problem </strong>— An <em>AWS Lambda</em> function, programmed in <em>Python 3.X </em>with at least one <em>AWS Python SDK </em>call (<em>boto3 or botocore</em>), cannot be lifted and shifted ‘as-is’, to another CSP. This due to the absence of any inter-CSP SDK. However, there is a way to gain CSP independence with some ‘computational abstraction’. Consider a simple microservice that takes 2 parameters — (<em>storage_bucket_name &amp; object_name</em>) to retrieve and download an object from a CSP’s storage bucket. The main Python SDK API calls for this task (across 3 sample CSPs) is illustrated in Figure 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*k6jebAsO7ieiCf7Ql44eWQ.jpeg" /><figcaption><em>Figure 1 — Python SDK API Calls for AWS, GCP &amp; Azure to download an object from a storage bucket</em></figcaption></figure><p>It is clear from Figure 1, that the microservice will be different for each CSP, due to their proprietary SDKs. You will require 3 different programs for the 3 different CSPs and thus maintain 3 different codebases. This is painful for a large codebase.</p><p><strong>Solution</strong> — If the microservices and the base program designs are kept simple, cross-CSP microservice execution and orchestration can be a reality. This is done with a little bit of JSON juggling along with a simple code deployment configuration. The goal is to maintain only a single copy of the base program. And the encapsulation of CSP-specific calls is done with a JSON document. Figure 2 provides an abstraction method using JSON, to design a CSP-specific microservice at code deployment time with a single base program:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*-9blh8ocVjXQHXZ2YhUEUg.jpeg" /><figcaption><em>Figure 2 — Simple Python program abstraction using JSON for a microservice in AWS, GCP &amp; Azure</em></figcaption></figure><p>As noted in Figure 2, the separation of each CSP’s SDK API calls in its own list, can facilitate a single version of the base program, while maintaining code portability. Here is how:</p><p>1. Abstract the microservice with the SDK API calls across all CSPs</p><p>2. Create a JSON doc called <em>get_obj_from_bkt</em> with each CSP-specific definition encapsulated in a list (illustrated in Figure 2)</p><p>3. Store the contents of the JSON doc — <em>get_obj_from_bkt</em>, in a NoSQL document collection — <em>Let’s call this table/collection as CodeAbstract</em></p><p>4. Create a Python function — <em>CodePreProc</em>, which explicitly generates the code for all microservices. In our case we will generate code for the <em>get_object_from_bkt</em> microservice.</p><p>5. During code deployment (CI/CD pipeline), <em>CodePreProc </em>is called with a runtime argument (<em>aws/azr/gcp</em>). For example <em>— CodePreProc(‘aws’);</em></p><p>6. Based on this runtime argument, <em>CodePreProc</em> queries and retrieves from the <em>CodeAbstract </em>table, the <em>get_obj_from_bkt</em> JSON doc.</p><p>7. The AWS code array (<em>aws_get_obj_from_bkt</em>) is selected from the JSON object{}, given that ‘<em>aws’</em> was passed to <em>CodePreProc</em>.</p><p>8. <em>CodePreProc</em> then ‘concatenates’ newline escape sequences (‘\n’) between the elements of a given CSP’s code array (using the <em>join() </em>function) and creates the appropriate Python program — <em>aws_get_obj_from_bucket.py file</em>.</p><p>9. The AWS-specific <em>get-obj_from_bkt</em> microservice is now ready for testing and deployment in the next phase of the CI/CD pipeline.</p><p>Thus, by encapsulating CSP-specific SDK API calls within a list in a JSON document and dynamically generating the CSP-specific function with a simple pre-processing script, it is possible to solve the vendor-lock-in problem. Again, this method is no <em>silver bullet </em>to all code portability issues but it does provide a feasible alternative to hard-coding CSP SDK API calls. This is true only if the required abstraction and design effort is done upfront, thus providing the freedom of inter-cloud code portability. There are two advantages to the aforementioned approach:</p><p>a) Ability to leverage a single base/wrapper program, that has no CSP-specific function calls. This allows the support for multiple CSPs with the same codebase with independent CSP-specific SDK API microservices (functions).</p><p>b) Changes to an SDK (arguments/names etc.) for a given CSP, affects ONLY one specific CSP’s code array within the JSON document. There is ZERO impact for the other CSPs and the orchestrator program. If further separation is required, the structure of the JSON document can be modified to separate each CSP’s code in an independent JSON doc.</p><p>In summary, CSP-specific SDK API call abstraction requires upfront design and may not be feasible for all existing projects. However, for new projects it does provide a method to decouple microservices from CSP-specific SDK API calls. This helps in maintaining generic base programs and freeing us from vendor lock-in!</p><h4>#10 — Test you shall…locally, these Functions of the Cloud!</h4><p>A good Integrated Development Environment (IDE) is a programmer’s workbench. Well-designed IDEs enable efficient program development and testing. The need to test Cloud Functions ‘locally’ is a requirement you will encounter very quickly in your project. Without a Cloud-aware IDE, testing becomes very time-consuming, as we will spend more time pushing code through the CSP’s code management plumbing than the actual testing. Local testing thus significantly increases productivity. Mercifully, there are Cloud-friendly IDEs that come to a programmer’s rescue. A good example of such an IDE is <a href="https://www.stackery.io/">Stackery</a>.</p><h3>Conclusion</h3><p>Serverless Data Integration Hubs deliver the single version of an enterprise’s data truth at the lowest possible operational cost. The importance of continuous learning, adaptation, and growth, needs to be a perennial habit in all aspects of our lives. Serverless Data Integration is no exception. I’ll take your leave with one of Master Yoda’s famous pearl of wisdom, which keeps me humble and grounded — <em>Much to learn, you still have!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa536cf3724a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/serverless-data-integration-jedi-master-yodas-ten-pearls-of-wisdom-2020-fa536cf3724a">Serverless Data Integration — Jedi Master Yoda’s Ten Pearls of Wisdom (2020)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazing cost savings with AWS Lambda for Data Integration — (2020)]]></title>
            <link>https://medium.com/data-science/amazing-cost-savings-with-aws-lambda-for-data-integration-2020-b048021175e3?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b048021175e3</guid>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 22:39:18 GMT</pubDate>
            <atom:updated>2022-12-29T15:36:02.703Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbCrgxCF2BCzTg3cQblihg.jpeg" /></figure><h3>Amazing cost savings with AWS Lambda for Data Integration — (2022)</h3><h4>A cost comparison exercise between a server-based and serverless Data Integration Hub on AWS</h4><h3>Introduction</h3><p>Data Integration is a critical IT function that focuses on delivering high-quality standardized data to the enterprise, and thus enables Analytics, Machine Learning and AI initiatives to add business value. Here is some suggested reading (in case you need it):</p><p>1) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">Serverless Data Integration — Part I (2019)</a></p><p>2) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb">Serverless Data Integration — Part II (2019)</a></p><p>3) <a href="https://medium.com/@gvaidyanatha/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2022-6eba5edf93a0">Architecting Serverless Data Integration Hubs on AWS for Enterprise Data Delivery (2022)</a></p><p>One of Cloud Computing’s primary value propositions is to minimize capital costs and replace it with operational costs. While that is a good starting point for an organization early in its Cloud journey, the need to control operational costs in the long run is very important. And that is where serverless computing plays a huge role in the appropriate workloads, especially for running Data Integration Hubs.</p><p>There are multiple aspects which contribute to the cost of a computing system in the Cloud. The salient ones are CPU, memory, storage, networking, data transfers (both ingress and egress) and API calls. In this article, I will focus on the <strong>computing</strong> aspects (CPU &amp; memory). This enables good comparisons between AWS <em>EC2</em> (server-based) and AWS <em>Lambda</em> (serverless) for a given workload. The other cost components are assumed to be equal on both models. The one exception — <em>EC2 Administration Costs </em>(Operational Costs). This is not relevant for <em>Lambda</em> and creates huge cost optimization opportunities for workloads that can be run on the serverless model.</p><h3>Equivalent Daily Cost (EDC)</h3><p>In the world of finance, the term <em>Equivalent Annual Cost (EAC)</em>, is used to determine the annual cost of owning, operating and maintaining an asset over its lifetime, whilst comparing assets bearing different cost characteristics. I have simplified this concept and introduced the term <strong><em>Equivalent Daily Cost</em></strong><em> (</em><strong><em>EDC</em></strong><em>)</em>, to compare daily costs of <em>EC2</em> and <em>Lambda</em>. Here is my definition –</p><p><em>Equivalent Daily Cost (EDC)</em> <em>is the derived daily cost for a given EC2 instance equated to the cost of ’n’ Lambda invocations during a 24-hour time interval.</em></p><h3>The Modus Operandi</h3><h4>Choosing an EC2 Instance Family</h4><p>AWS <em>EC2</em> Instances come in a variety of shapes and sizes. For our costing effort, I chose the ‘<em>General Purpose M5-class</em>’ instance family and picked 4 configurations as potential candidates to run a Hub (Figure 1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*Q9X_r8JrezeugN7ZXlRdUg.jpeg" /><figcaption>Figure 1: m-class instance family configuration details</figcaption></figure><h4>Choosing an AWS Pricing Model</h4><p>To ensure equitable and varied spread in <em>EC2</em> price points, 3 different pricing models were chosen. They are — 3 Year All Upfront Reserved (<strong>3YAUR</strong>), 1 Year All Upfront Convertible (<strong>1YAUC</strong>) and On-Demand (<strong>ON-DEMAND</strong>). A brief blurb about each pricing model:</p><p><strong>3YAUR</strong> is the least expensive pricing model but with an upfront 3-year commitment. One has to reserve these instances and pay for the service ‘all up front’, in return for the highest discount. This pricing model has no flexibility.</p><p><strong>1YAUC</strong> has a smaller percentage discount than 3YAUR but lends greater operational flexibility. It allows changes to the machine’s configuration within a 1-year time-frame. A year’s worth of service costs is paid upfront. The required price adjustments are done when the configuration is modified.</p><p><strong>ON-DEMAND</strong> is the most expensive and the most flexible pricing model. It truly allows one to provision and de-provision <em>EC2</em> instances at will. Although there is no predetermined time period or up-front costs, the total cost (over a defined period) for this pricing model, is the highest when compared to 3YAUR &amp; 1YAUC. This pricing model’s costing and flexibility options is comparable to <em>Lambda</em>.</p><h3>Defining the Workload &amp; Lambda Profile</h3><p>The workload in question was a <strong>dual-threaded CPU-intensive Python program</strong>, that processes inbound data for the Hub. It had a runtime of <strong>5 minutes (300 seconds)</strong>. In the serverless model deployment, <em>Lambda</em> was configured with <strong><em>3 GB of memory</em></strong>, thus resulting in an allocation of <strong><em>2 vCPUs</em></strong> for the micro-container provisioned during the invocation.</p><h4>Calculating EC2’s Daily Compute Maximum</h4><p>Before we calculate the EDC for an EC2 instance and compare it to <em>Lambda</em>, we first need to calculate <em>EC2’s</em> maximum daily compute capacity. For example, a <strong><em>m5.4xlarge</em></strong> Linux <em>EC2</em> instance, configured with <strong><em>16 vCPUs</em></strong> and <strong><em>64 GiB</em></strong> of memory, running our previously defined workload, has the following computing <strong>maximums</strong>:</p><ol><li>Concurrent executions = <strong>8 (16 <em>vCPUS</em>/2)</strong></li><li>Executions/hour = <strong>96</strong> ((<strong>60 mins/5 mins</strong>)<strong> x 8</strong>)</li><li>Executions/day = <strong>2,304</strong> (<strong>96 x 24</strong>)</li></ol><p>The daily computing maximums for all 4 instances (using the #vCPUs column in Figure 1) are calculated and listed in Table1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*CWQN_wyCHeGO2NDsVeSNGw.jpeg" /><figcaption>Table 1: Calculated daily compute maximums by m-class family configuration</figcaption></figure><p>Each calculated<em> compute maximum</em> in Table 1, allows us to compare daily cost across 4 different pricing models (including <em>Lambda’s</em>), for each <em>EC2</em> configuration.</p><p>In the coming sections, we will use the <strong><em>m5.4xlarge</em></strong>, for our example equivalence costing effort. With a <strong>2,304</strong> possible daily compute maximum on a <strong><em>m5.4xlarge</em></strong>, we now calculate the <em>compute equivalence</em> for <em>Lambda</em>.</p><h4>Calculating Lambda’s Cost (Invocations Costing)</h4><p>The <a href="https://calculator.aws/#/">AWS Pricing Calculator</a>, displays <strong>$34.56</strong>, for <strong>2,304</strong> <em>Lambda</em> invocations against the <em>m5.4xlarge </em>configuration. The per invocation cost is thus <strong>$0.015</strong>. For your reference, the ‘Free Tier’ for our workload, is calculated at <strong>444</strong> invocations per month, valued at <strong>$6.66</strong>.</p><p>All calculations performed in this costing exercise are ‘Without Free Tier’. This is to maintain accurate (up-to-the-cent) equivalence calculations. Figure 2 illustrates the details about how we arrived at <strong>$34.56</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38avuM6omclzWt8GDJ8KcA.jpeg" /><figcaption>Figure 2: AWS Pricing Calculator — Lambda Invocations Costing</figcaption></figure><p>The <em>EC2</em> Yearly Costing was done using the <a href="https://calculator.s3.amazonaws.com/index.html">AWS Simple Monthly Calculator</a>. <em>EC2 Daily Cost</em> = <em>EC Yearly Cost/365</em>. For an <em>m5.4xlarge</em> instance, Table 2 has the daily costing for all 3 <em>EC2</em> pricing models and its <em>Lambda</em> cost equivalent (LAMBDA-E) at <strong>2,304</strong> invocations (from Figure 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*bfyYqLcLopIZoe1r_JtHZQ.jpeg" /><figcaption>Table 2: Lambda-equivalence by pricing models — m5.4xlarge</figcaption></figure><h3>Comparing EC2 vs Lambda — Cost &amp; Invocations (I)</h3><h4>Equivalent Daily Cost — EC2 vs. Lambda (I)</h4><p>With a computed <em>EDC</em>, we visualize the data for all 4 chosen instances and 4 different pricing models, equated with their respective daily maximums in Figure 3. <em>Lambda</em> stands up as the most expensive across all chosen configurations and pricing models. Hang in there, there is more to this story :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*pdkSbJgJwTaXoIqTDVCx5w.jpeg" /><figcaption>Figure 3: Equivalent Daily Cost by pricing model — EC2 vs. Lambda — m5-class instance family (I)</figcaption></figure><h4>LAMBDA Invocations Possible (LIP)</h4><p>Armed with the daily cost for all 3 EC2 pricing models, we calculate <em>Lambda</em> Invocations Possible (<strong>LIP</strong>) for a <em>m5.4xlarge</em> using all 3 prices. <strong>LIP</strong> is an important measure, as it provides accurate numbers on how much compute is possible for a given cost-basis. This is listed in Table3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*nOxGBko5jz7ZWlF4n2JGZg.jpeg" /><figcaption>Table 3: Lambda Invocations Possible by pricing models — m5.4xlarge</figcaption></figure><p>Table 3 shows the corresponding LIP numbers and their respective costs. Our Python workload and <em>Lambda</em> profile allows us <strong>471</strong> <em>Lambda</em> invocations at <strong>$7.07</strong>. This is an important concept to keep in focus in our costing exercise.</p><h4>Equivalent Daily Invocations — EC2 vs. Lambda (I)</h4><p>The LIP numbers derived in Table 3 allows us to start comparing costs using invocations. Figure 4 visualizes this across all 4 chosen <em>EC2</em> instances and 4 different pricing models. An interesting insight starts to emerge in Figure 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*WcfB0pNvSLO1oNYtXlIEgw.jpeg" /><figcaption>Figure 4: Daily Invocations Possible by pricing model — m5-class instance family (I)</figcaption></figure><p>Consider the case of the <em>m5.4xlarge with ON-DEMAND</em> pricing — the Python workload needs to be invoked at least <em>1,232</em> times during a day (cost — <em>$18.48/day</em>) to be cost-effective.</p><p>If <em>1,232</em> program executions do not occur in a 24-hour time period, we can safely conclude — <em>System Idle Time</em>. Recall, the nature of a Data Integration Hub — bursts of processing activity followed by pockets of ‘Idle/Quiet Time’. Paying for <em>1,232</em> possible invocations and not utilizing ALL of the compute capacity, results in wasteful spending. This creates an opportunity for operational cost optimization.</p><p>With <em>Lambda</em>, one ONLY pays for the exact number of invocations. There is no cost for Idle time. This is <em>Lambda’s</em> inherent feature and provides a great segue into our next topic of discussion — <em>Operational Costs</em>.</p><p><em>Note: The example LIP value of 2,304, is the daily maximum Lambda Invocations Possible (LIP), for the m5.4xlarge’s compute capacity. It is not the actual number of invocations on Lambda but is a yardstick utilized to equate costs.</em></p><h4>Tender Loving Care (TLC) for EC2</h4><p><em>EC2</em> instances require regular administration for its care and upkeep. This needs to be factored in as operational costs for these server-based systems. These costs are not relevant in the serverless realm (purely from a compute standpoint). The following is a list of customary operational costs for <em>EC2</em> within the context of a Data Integration Hub:</p><p>1) Additional <em>EC2</em> instances required for high-availability and disaster recovery configurations (a minimum of <em>3 EC2 </em>instances per High-Availability (HA) &amp; Disaster Recovery (DR) configuration)</p><p>2) <em>Elastic Load Balancer (ELB)</em> to cater to autoscaling and failover scenarios</p><p>3) Administrative tasks — Install, Patch and Upgrade of OS, Route53, Certificate Manager for SSL/TLS, CloudWatch, Backups, Resource Tags and more</p><p>4) Personnel costs (salary, taxes, benefits) associated with <em>EC2</em> administration</p><p>With <em>Lambda</em>, 1–4 does not incur ‘additional cost’. Some of 1–4 it is even not relevant for <em>Lambda</em>, as its costs are purely compute-related. It inherently supports HA &amp; DR, does not require autoscaling or the need for any OS install/patch/upgrade. Table 4 is a sample summary of daily <em>EC2</em> operational costs for the <em>m5.4xlarge</em> across 3 pricing models, with personnel costs factored at <strong><em>$90.42/hour</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*gL0uPN0JUs4FmSJWYuGxGg.jpeg" /><figcaption>Table 4: Daily operational costs by pricing models</figcaption></figure><p><em>Note: The AWS Simple Calculator was utilized for EC2 &amp; ELB pricing. The hourly personnel cost of $90.42 was arrived by starting with an average market salary for an AWS Solution Architect ($140,000), to which payroll taxes (TX) and benefits costs were added. Payroll tax calculations were performed at </em><strong><em>tsheets.com</em></strong><em> and benefits costs were procured from the </em><strong><em>2018 Bureau of Labor Statistics</em></strong><em>.</em></p><h3>Comparing EC2 vs Lambda — Cost &amp; Invocations (II)</h3><h4>Equivalent Daily Cost/Daily Invocations — EC2 vs. Lambda (II)</h4><p>Factoring the additional operational cost of <strong>$77.69/day</strong>, the Daily Costs and Daily Invocations graphs tell a different story. Using the <em>Lambda</em> costing tool, we arrive at an additional LIP of <strong>5,179</strong> invocations for <strong>$77.69</strong>. The modified graphs are illustrated below in Figures 5 and 6:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*xCXORjH2ClwmwIUbN44QsQ.jpeg" /><figcaption>Figure 5: Equivalent Daily Cost by pricing models — EC2 vs. Lambda — m5-class instance family (II)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLciMpdKn0wfmSpiJAdJiw.jpeg" /><figcaption>Figure 6: Daily Invocations Possible by pricing models — m-class instance family (II)</figcaption></figure><h3>Cost Savings with AWS Lambda (Serverless Computing)</h3><p>After adding operational costs, the following insights emerge about <em>Lambda’s</em> cost-effectiveness:</p><ol><li><em>Lambda</em> wins by a significant margin across ALL chosen pricing models against the <em>m5.4xlarge</em> and <em>m5.8xlarge </em>configurations. Table 5 has Lambda’s winning margins (% cheaper) against the <em>m5.4xlarge</em>:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*qX1xmUa1z5o-2LPmVmupLw.jpeg" /><figcaption>Table 5: Daily cost victory margins for m5.4xlarge</figcaption></figure><p>2. In Figure 6, the LIP difference between compute equivalence (2,304, dashed line) and actuals for the <em>m5.4xlarge</em>, is marked as ‘Cost Optimization Opportunity’. This is the additional operational cost that doesn’t change computing capacity. Similar differences are present for other configurations too.</p><p>3. <em>Lambda</em> wins across ALL 4 EC2 configurations when compared against ON-DEMAND. From a cost and flexibility standpoint, <em>EC2’s</em> ON-DEMAND pricing is the closest comparable option to <em>Lambda</em>.</p><p>4. <em>Lambda’s</em> winning margins are much greater at smaller configurations, when compared against the ON-DEMAND. Table 6 provides the winning numbers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*CqIIGF4GmDM-WIRLv4_CeA.jpeg" /><figcaption>Table 6: Daily cost victory margins for ON-DEMAND — m5-class instance family</figcaption></figure><p>5. For the <em>m5.12xlarge</em> configuration, <em>Lambda </em>loses narrowly ONLY against the 3YAUR by a margin of <strong>$5.77/day</strong>.</p><p>6. For the <em>m5.16xlarge (</em>our largest<em> </em>configuration), <em>Lambda</em> loses to both 3YAUR &amp; 1YAUC by a margin of <strong>$32.25</strong> and <strong>$9.99</strong> respectively. Said in another way, <em>EC2</em> categorically wins ONLY in the largest configuration with the 3YAUR pricing model by <strong>130%</strong> and with 1YAUC by <strong>108% </strong>respectively.</p><h3>Conclusion</h3><p>In our costing exercise, it took a <em>64-vCPU</em> machine configuration, with a <strong><em>3-Year All Upfront Reserved (3YAUR)</em></strong> or <strong><em>1-Year All Upfront Convertible (1YAUC)</em></strong> pricing option, to convincingly beat <em>Lambda</em>. Now that is truly amazing, given that <em>Lambda’s</em> closest equivalent in <em>EC2,</em> is the <strong>ON-DEMAND</strong> pricing model. <em>Lambda</em> was the clear winner against all configurations with <strong>ON-DEMAND</strong> pricing. Thus, this equivalent daily costing exercise has provided the necessary contextual and numerical details, on how <em>AWS Lambda</em> enables minimization of operational costs for Data Integration. <em>Go serverless baby</em>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b048021175e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/amazing-cost-savings-with-aws-lambda-for-data-integration-2020-b048021175e3">Amazing cost savings with AWS Lambda for Data Integration — (2020)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Does AI Fail to Deliver?]]></title>
            <link>https://medium.com/swlh/why-does-ai-fail-to-deliver-c5d2894d7b95?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5d2894d7b95</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[data-management]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Wed, 12 Feb 2020 19:28:34 GMT</pubDate>
            <atom:updated>2020-04-14T16:37:23.364Z</atom:updated>
            <content:encoded><![CDATA[<h4>High-quality standardized data is a fundamental requirement for AI’s sustained success and value!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gb-Hmt31VrJX4ncD5-lpTg.jpeg" /><figcaption>Image via <a href="http://www.vpnsrus.com/">www.vpnsrus.com</a></figcaption></figure><h3>Preamble</h3><p>The promise of Artificial Intelligence (AI) to solve real problems through automation, amplification and simplification is definitely achievable. Today, AI presents a technologist quite possibly one of the most glamorous projects to work on. We are tempted to jump on the bandwagon. But everything is not so great in AI Land. The truth is that — <em>AI projects are failing</em>.</p><p>Why is that so? It is a case of <em>putting the cart in front of the horse</em>. And it is time for us to change that by engaging in a more methodical approach. We need to work on AI’s prerequisites first so that we derive the true value of AI in the future. Yes, I am building a case for delayed gratification with the necessary justification. When we do this right, there will be no debate about AI’s value or its ability to succeed.</p><p>Purely from a business standpoint, any investment of resources needs to be done in a meaningful manner to create value. AI is important for our future and we need to get it right. Logic mandates that we take this time to focus on the foundational requirements of AI. The need of the hour is to solve the rampant data problem. We first need to address the need to deliver high-quality, integrated and standardized data to the enterprise. When that’s done, each enterprise’s AI will have all the relevant data, exactly the way it needs it.</p><h3>AI’s Biggest Problem</h3><p>AI &amp; Machine Learning (ML) failures don’t occur due to some perceived lack in data science. The single biggest contributor is <em>bad quality training data</em>. Here are some <a href="https://tinyurl.com/twmkqzr">top-notch examples</a> that speak to that.</p><p>Build a world-class model, develop a fabulous algorithm, feed bad training data (simulated, synthetic, real or otherwise) and you will be staring down the barrel of AI failure. Incorrect predictions, high error rates, biases, skews and slew of other issues come to the fore. AI’s data problem usually boils down to:</p><p>1) Bad quality of data</p><p>2) Lack of the right data</p><p>3) Combination of #1 &amp; #2</p><p>Consider this recent <a href="https://tinyurl.com/v8fe6me">Forbes article</a> regarding AI and the COVID-19 (<em>corona virus)</em>. It clearly brings the issue on hand into focus. The said AI model and algorithm was incorrect in forecasting and predicting the spread of the virus. A relevant question comes to mind — <em>How could the predictions for Day#45 possibly be erroneous in excess of 5 orders of magnitude? </em>On examining the details, it is easy to conclude that the predictions were made with inadequate data (#2) and the model’s failure to account for a set of continuously changing environmental factors and conditions.</p><p>Now imagine a similar scenario back at your workplace, where business insights generated by AI, are erroneous by over 5 orders of magnitude. What impact will that have on your organization’s AI projects, the data science team and the business? Acting upon erroneous insights, could potentially trigger irrecoverable long-term consequences for the business. We need to take responsibility for the relevance and quality of data, we feed AI.</p><p>Bottom line — <em>Every enterprise needs to feed AI the required data, with high levels of quality and consistent standards</em>. Without high-quality, integrated and standardized data, we will be unable to practice ‘Responsible AI’. We all have a moral responsibility to create good behaviors and great outcomes from AI.</p><h3>Run a 5K before an Ultra-Marathon!</h3><p>Using a running analogy, AI is comparable to running the Ultra-Marathon (distances exceeding 42 km). It is unwise to start an ultra-marathon without any prior running experience. It is also irresponsible to start an AI initiative without data management maturity.</p><p>A novice runner needs to attain an optimum level of fitness and meticulously focus on her diet, training regimen, rest, healthy lifestyle habits and more. That significantly increases the probability of a successful 5K run. Once that is achieved, s/he works towards repeating that success for a 10K run, and then the half-marathon and so on. As the runner gradually (methodically) progresses towards the ultra-marathon, s/he gets fitter, stronger and gains the required experience and maturity to run the longest race.</p><p>We need to adhere to a similar approach in data management to get an enterprise — ‘AI Ready’ — <em>Its Ultra Marathon</em>. We need to take a phased approach and progressively work on gaining data management maturity (data quality, business rules, compliance requirements and more).</p><h3>Data Management Maturity — The Path to Successful AI</h3><p>Here is a simplified progression to data management maturity:</p><p>1) Cleanse, Comply &amp; Integrate business data from all relevant relational ‘system of record’ data sources to deliver high-quality Key Performance Indicators (KPIs) <em>— 5K</em></p><p>2) Incorporate Customer Relationship Management (CRM) data for Analytics-I, where meaningful data journeys generate customer, product and other relevant insights <em>— 10K</em></p><p>3) Integrate first set of non-relational data sources (documents, images) for Analytics-II <em>— Half-Marathon</em></p><p>4) Integrate a second set of non-relational data sources (web logs, social media, chatbot conversations, telemetry) for ML-I <em>— Full-Marathon (Phase I)</em></p><p>5) Integrate the third set of non-relational data sources (sound clips, videos) for ML-II <em>— Full-Marathon (Phase II)</em></p><p>6) Your data is now ready for AI <em>— Ultra-Marathon</em></p><p>Most data scientists will tell you that at least 50% of their time is spent cleansing and wrangling with data. This puts a huge burden on the Data Science team, who should primarily focus on models and algorithms. Without a centralized high-quality data source that feeds AI, each data science project engages in one-off data cleansing. And that is not good data management, any way you look at it.</p><h3>Conclusion</h3><p>Data integration is a critical Information Technology (IT) function, that needs to be centrally addressed by every organization. A Data Integration Hub delivers value to the business, by enabling Analytics, ML and AI initiatives with high-quality, integrated and standardized data. The infamous and much-coveted 360-degree view of the customer can be achieved only when data from all customer touchpoints are brought to bear. Engaging in AI without high-quality standardized data is akin to Forrest Gump’s famous quote — “<em>Mama always said life was like a box of chocolates. You never know what you’re gonna get</em>”. All the very best in achieving enterprise data management maturity. Enjoy your Ultra-Marathon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5d2894d7b95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/why-does-ai-fail-to-deliver-c5d2894d7b95">Why Does AI Fail to Deliver?</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Serverless Data Integration Hubs on AWS for Enterprise Data Delivery (2020)]]></title>
            <link>https://medium.com/data-science/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2020-a27b42569518?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a27b42569518</guid>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Thu, 16 Jan 2020 16:14:22 GMT</pubDate>
            <atom:updated>2022-09-02T15:05:50.897Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*rqwmrnuQmL2MiR0ND9j6Hw.jpeg" /></figure><h4>Updated 2022 version now available at — <a href="https://medium.com/@gvaidyanatha/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2022-6eba5edf93a0">https://medium.com/@gvaidyanatha/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2022-6eba5edf93a0</a>!</h4><h3><strong>Introduction</strong></h3><p>Happy New Year! If <em>data is the new oil</em>, why do we experience so many backfires in our systems? In a prior 2-part article series titled <strong><em>Serverless Data Integration</em></strong>, the importance of data integration, particularly in the serverless realm was discussed in good detail. We concluded that data integration was a critical business need, that had to be proactively and centrally addressed by every IT organization. To reiterate, Data Integration focuses truly on delivering value to the business, by enabling true analytics, machine learning and AI initiatives fed with clean and standardized data. Without high quality data, business insights generated via various analytics, machine learning and AI initiatives, will be questionable at best. In case you’ve missed it, here are the links to the previous article series:</p><p>1) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">Serverless Data Integration — Part I (2019)</a><br>2) <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb">Serverless Data Integration — Part II (2019)</a></p><p>In this article, I’d like to clarify some additional points related to our topic of discussion. I also wish to share a sample reference architecture of a Data Integration Hub (henceforth referenced as <strong>The Hub</strong>) implemented on Amazon Web Services (AWS).</p><h3>Clearing the Air</h3><p><strong>Data Integration Hubs are not Data Lakes <br></strong>Data Lakes store data in near exact native format. That may be adequate for certain bespoke analytics initiatives, but a centralized data service that cleanses, standardizes and makes data compliant with all prevailing regulatory requirements, delivers better value to the business. The value proposition of a Hub is simple — write once read many (<strong>WORM</strong>), ensure data quality, standardization and compliance. Keep in current and don’t let the data go stale!</p><p>To achieve this, a Hub employs the concept of <strong>ELTn</strong> (Extract Load Transform(<strong>n</strong>)) instead of the classic <strong>ETL</strong> (Extract Transform Load). <strong>ELTn</strong> implies that transformation is not a single occurrence that occurs before loading of the data. It is a continuous process and occurs multiple times in the lifetime of the data supporting a specific business function. The goal is to eventually reach a high-level of data hygiene such that all data is CLEAN. The Hub enables the paradigm of continually maintaining up-to-date ‘business objects’, matching the transformation that the business undergoes.</p><p>Once data from a given ingestion process is marked as CLEAN, all downstream applications can consume data from the Hub. This minimizes the load on back-end system-of-record systems for data extracts, not to mention repeated and wasteful efforts in data cleansing. Plus, data quality and compliance adherence can be done once, in a centralized location. This enables high-quality and relevant enterprise data delivery. Let’s make data clean and compliant once. This is what a Hub does.</p><p>The Hub solves the problem of rampant Data Silos that have emerged over many years of bad data management. Contrasted with a Data Lake, a Hub is a living breathing and constantly evolving centralized authorized data distributor for the enterprise. As mentioned before, Data Lakes bring together disparate data sources and store in near exact original format. A Hub does much more by providing the required quality, standardization and compliance for all data initiatives within the enterprise.</p><p><strong>Can we please walk before we try to run?<br></strong> Ask any C-level executive today, as to the top priority (s)he is on the hook for and the answer is almost always ‘<em>Need to do something with Artificial Intelligence (AI)</em>’. In some responses you may replace AI with ‘<em>Machine Learning (ML)</em>’ but that’s close enough, given ML is a prerequisite for AI. Everybody wants to do AI, but before we embark on that journey, we need to build a rock-solid data pipeline that creates/feeds/maintains a Hub. Ask any data scientist how much time (s)he spends in cleansing and wrangling data just for their specific project. The answer to this question will bring out the apparent value of a centralized Hub. Plus, the Hub enables more output from the Data Science team, as they can focus purely on their skills — data science, not data cleansing or data wrangling. Remember WORM is good, WORO is not :)</p><p>Data Engineering thus is a fundamental requirement for all data-driven businesses. Data is one of the fundamental drivers of positive change in the business. Many IT organizations’ have modified their mindset to support Data Engineering as a core competency and this is manifesting rapidly due to the criticality of this new business need.</p><p>Monica Rogati’s excellent article on Hackernoon (<a href="https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007"><em>AI Hierarchy of Needs</em></a>) from June 2017 is still very relevant to our topic of discussion. The following graphic referenced from that article is an exposition of the core idea that, in life we need to get the basics done first before reaching for the esoteric aspects. My two customizations to Ms. Rogati’s graphic are the use of <strong>ELTn</strong> instead of <strong>ETL</strong> and outlining the Hub’s function in the pyramid.<strong> </strong>We thank Mr. Abraham Maslow for showcasing and illustrating his work using the pyramid many moons ago. Figure 1 is a picture worth a thousand words. Thank you, Ms. Rogati!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*YFRXPGzZAufIUdnnVLWoJQ.jpeg" /><figcaption><strong><em>Figure 1: Can we please walk before we try to run?</em></strong></figcaption></figure><p><strong>Structure is in the eye of the data practitioner!<br></strong>Just as beauty is in the eye of the beholder, so is the inherent structure of data — it is in the eye of the data practitioner. The demarcation of what one wants to store in a relational table versus a NoSQL datastore or BLOB storage is a relevant discussion to engage in. However, the value of delineation of data as structured, semi-structured and unstructured is up for debate. Please allow me to explain this in <strong><em>Figures 2 &amp; 3</em></strong> as we take a look at a sample web log and a tweet, both regularly classified as unstructured data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*kzAR8jwTF_dgGcQs6ubbpA.jpeg" /><figcaption><strong><em>Figure 2: Data Structure of a sample Web Log</em></strong></figcaption></figure><p>Figure 2 illustrates the contents of a publicly available web log from NASA. One immediately wonders the reason why a web log is classified as unstructured, as the above contents can very easily be stored in a relational table. Now, we may not want to store this in a relational table for a variety of other reasons (such as volume of data and in-turn performance of retrievals) but that is a different discussion altogether. That still doesn’t change the fact that the above web log sample is well structured data.</p><p>Let’s now take a look at the structure of a sample tweet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*P7F6s6EwAIHX9oB4Oyjlkw.jpeg" /><figcaption><strong><em>Figure 3: Data Structure of a Tweet</em></strong></figcaption></figure><p>Figure 3 illustrates the structure of a tweet. Yes, it is in JSON format and the data is stored in a NoSQL database, but why does that necessarily make this unstructured? In the eyes of a data practitioner, this is a beautiful flexible structured business object.</p><p>For a data practitioner, all data possesses structure. Structure is present even in audio and video files. Now a video file may not possess the ‘required structure’ to store it in a ‘table’. But then again, we seem to inadvertently (and in my humble opinion incorrectly) equate the existence of structure to the existence of a table. For the above reasons and the purposes of this article, data shall be classified as relational and non-relational. If it makes sense to store it in a table, it is relational. If it does not, it is non-relational. There are many non-relational data stores that are fit-for-purpose, depending on the data’s characteristics. Let’s use the one that gets the job done right.</p><p><strong>Relevance of Quiet Time &amp; Workload Costing<br></strong>In part II of the prior article series, I introduced the concept of Quiet Time, as a relevant yardstick that we utilize while deciding whether or not a given workload qualifies to be serverless. It is important to note that not all workloads truly qualify for serverless computing. A Hub is a poster-child for a serverless computing implementation, due to the nature of processing. Hubs are mostly unpredictable with regards to data volumes that need to be processed on a given day. In addition, the timing of ingestion and other related tasks require dynamic scaling for optimal performance. More often than not, a Hub also has pockets of idle time during a 24-hr time period. All of this makes it an ideal candidate for serverless.</p><p>The following is a simple formula to calculate Quiet Time(<strong><em>qt</em></strong>) of a workload, that assists in identifying the feasibility of serverless computing:</p><p><strong><em>qt = round (((x/86400) * 100),2) </em></strong>%<br>where, <strong>x </strong><em>= ‘</em><strong><em>workload idle time</em></strong><em>’, measured in seconds over a 24-hr period</em></p><p>In the above formula, Quiet Time (<strong><em>qt</em></strong>) is calculated as a percentage of the workload’s idle time (<strong><em>x</em></strong>) over the elapsed time in a day — 24 hours = 86,400 seconds. <strong><em>qt</em></strong> is important in determining the relevance of serverless computing in a given context. For example, if a given workload is idle on an average of 25,300 seconds on any given day, this implies that <strong><em>x=25300</em></strong>, allowing us to derive:<br><strong><em>qt = round (((25300/86400) * 100),2) = 28.28%</em></strong>.</p><p>In the above example, we conclude that the application is quiet for <strong>28.28%</strong> of any given day, thus making it a potential candidate for serverless computing. We will know for sure, once we complete the costing exercise. The point is this — if your application does not demonstrate pockets of idle time/quiet time and is constantly processing 24x7x365, serverless may not be the right choice.</p><p>We now calculate the cost of the relevant serverless and server-based services, to determine which one is better. The lower of the 2 costing efforts, will guide us to the preferred option:</p><p>a. <strong><em>scc</em></strong> — serverless computing cost<br> This is the cost for utilizing serverless computing services. Serverless computing costs are usually comprised of number of function execution requests, CPU &amp; RAM requested in <em>AWS Step Functions/Lambda</em>, <em>API Gateway</em> requests for such function execution requests and any other service that is specifically required to support the given workload (including database costs such as <em>Amazon DynamoDB or Amazon Aurora Serverless</em>). There are no compute costs associated with <em>idle time/quiet time</em> in serverless computing.</p><p>b. <strong><em>tcc</em></strong> — traditional computing cost (server-based)<br> This is the cost for utilizing server-based computing services. These computing costs are usually comprised of compute engines for application and database servers, programming language software licensing, database software licensing, personnel costs associated with software maintenance of the said server-based services (install, patching, upgrades of operating system, programming language software and other 3rd party software) and actual cost of software maintenance fees (paid to vendors). In this model, there are compute and other costs associated with <em>idle time/quiet time</em> for all compute platforms.</p><p>If <strong><em>scc &lt; tcc</em></strong>, it is clear that the workload qualifies for serverless even from a cost standpoint. If <strong><em>scc &gt; tcc</em></strong>, it is obvious that serverless will cost more than the server-based model. However, there may be other reasons that drive the serverless model to be the preferred option. These may include (among others), a lack of deep technical talent within the organization to support the upgrade and maintenance of the workload’s software and database stack in the relevant compute platforms.</p><p><strong>Notes:<br></strong>1. <em>It may be argued that the AWS support fees should also be factored into </em><strong><em>scc </em></strong><em>and this could be done if there were a method to determine prorated AWS support fees, calculated only for the serverless services. This is easier said than done, but in the interest of simplicity, this should be considered as a common cost between both models and thus excluded.<br></em>2. <em>Storage costs for services such as S3, networking, data transfer (ingress and egress) can also be deemed as common to both </em><strong><em>scc</em></strong><em> and </em><strong><em>tcc</em></strong><em>. Thus, these components can also be removed from the costing. Add these costs to </em><strong><em>scc</em></strong><em> ONLY if they are relevant to it and not to </em><strong><em>tcc</em></strong><em>.</em></p><h3>Architecture of a Serverless Data Integration Hub on AWS</h3><p><strong>The 4 Layers<br></strong>There are 4 Layers/Pillars in the Hub and it manifests on AWS as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*YwMzKXBlti6p5O9eDzNu4w.jpeg" /><figcaption><strong><em>Figure 4: Data Integration Hub on AWS — 4 Layers/Pillars</em></strong></figcaption></figure><p>Data flows through the 4 layers of the Hub. Each layer supports an independent function of the Data Integration Architecture. The 4 Layers/Pillars are:</p><p>1. Ingestion<br>2. Persistence<br>3. Transformation<br>4. Analytics/ML/AI</p><p>The architecture is purpose built utilizing independent services. This enables scaling each layer independently, supports abstraction to manage complexity, decouples services to avoid serialization, automatically provisions resources (where feasible) and facilitates an asynchronous execution model. In many ways these are fundamental tenets of cloud computing.</p><p><strong>Drilldown into the 4 Layers/Pillars<br></strong>Figure 5 illustrates the relevant services and details within each Layer/Pillar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBnVlIRbwjHGpWLu62Ymig.png" /><figcaption>Serverless Data Integration Hub on AWS — Detailed Architecture (All Layers)</figcaption></figure><p>Now let’s dive a little deeper into each Layer/Pillar.</p><p><strong>Ingestion</strong> is the first layer (Layer #1) where data from multiple sources enters the Hub. For batch extracts, the landing zone for the data is a serverless <em>Amazon S3</em> bucket where the data is pre-processed for certain rudimentary checks with <em>Amazon Athena</em>. A microservice (<em>AWS Step Functions/Lambda</em>) processes the data, on the <em>event</em> of data successfully landing in S3. The equivalent <em>Amazon Kinesis</em> real-time data streams processing service takes care of the streams of data, that arrive into the Hub in sporadic bursts.</p><p><strong>Persistence</strong>, the second layer (Layer #2) of the architecture, plays the crucial role of storing data in the Hub. <em>Amazon DynamoDB</em> plays a huge role here, as it is the centerpiece of Data Integration. Layer #2 stores, manages and maintains business objects. When data is ingested in Layer #1, it is transported to Layer #2 and stored in a <em>near-raw-format</em> within RAWDB (set of tables for RAW data). More complex data validation routines are performed in the Transformation Layer. The persistence of Business Insights in Layer #4 is done using <em>Amazon Aurora Serverless</em>, if certain business function’s data consumption model is table-based data, instead of JSON-based business objects.</p><p><strong>Transformation</strong> is the third layer (Layer #3) which handles the complexity of creating CLEAN business objects. The transformation layer’s complexity and heavy lifting relates to ensuring that data is conformant to data quality rules, business rules and compliance rules/policies. The arrival of data in RAWDB of Layer #2, is <em>the next event</em>, that triggers the main transformation microservice and its related sub-microservices to fire. These event-based microservices are implemented in <em>AWS Step Functions/Lambda</em>. Data that fully conforms to all predefined transformation rules is persisted in CLEANDB (another logical container with a set of relevant tables for CLEAN data) and erroneous/non-conformant data is stored in ERRORDB (the 3rd logical container for ERROR data).</p><p><strong>Analytics/Machine Learning (ML)/Artificial Intelligence (AI)</strong> is the fourth layer where Business Insights (BI) are generated. This layer is triggered by the arrival of data in CLEANDB within Layer #2 (<em>the</em> <em>next event</em>). This layer supports the calculation and storing of Key Performance Indicators (KPIs) for the business and the management of Analytics/ML/AI jobs. The results of all jobs (BI) are stored in INSIGHTSDB (the 4th logical container for INSIGHTS within <em>Amazon DynamoDB</em> and <em>Amazon Aurora Serverless</em> as appropriate). Multiple serverless services are utilized here for generation of Business Insights (<em>Amazon S3, Amazon Athena, Amazon Fargate, Amazon SageMaker)</em> in this layer. Please note that <em>Amazon SageMaker</em> is not serverless and listed here for completeness for machine learning projects. <em>Amazon Fargate</em> is listed to facilitate the concept of serverless containers that run analytics and machine learning algorithms to generate BI and store in INSIGHTSDB.</p><p>When data passes through all 4 layers, it completes a single data integration cycle. The cycle is repeated, as and when new/modified data flows into the Hub from back-end systems or when data is either augmented, corrected and reprocessed to move from ERRORDB to CLEANDB.</p><p><strong>Note:</strong><em><br>In the long run, the persistence and management of historical data (RAWDB &amp; CLEANDB) needs to be addressed via standard Information Lifecycle Management (ILM) measures that utilize various tier-based-data-persistence services. AWS supports this with a multi-tiered storage provisioning model with Amazon S3 Glacier and Amazon S3 Glacier Deep Archive. This ensures data persistence costs are maintained at optimal levels while adhering to all regulatory requirements.</em></p><p><strong>Visualization</strong> also plays an important role in information delivery within the enterprise. This is where the BI Dashboards come to life and deliver value to the business. In maintaining the serverless paradigm, <em>Amazon QuickSight </em>is an option for the future, when direct access of data via RESTful endpoints in <em>API Gateway</em> is supported<em>.</em></p><p><strong>Consumption Pattern<br></strong>On generation of BI, applications need to be enabled to consume data from INSIGHTSDB &amp; CLEANDB in real-time. This consumption is done via the Data Access Layer (DAL) as illustrated in <em>Figure 5</em>. Utilizing RESTful endpoints (<em>API Gateway</em>), consumption of BI and the underlying data for the various business objects is supported. Data retrieval from relational data stores such as <em>Amazon Aurora Serverless</em>, is achieved by utilizing the <em>Data API for Amazon Aurora Serverless</em>. It is important to note that <em>API Gateway</em> is the single doorway for data consumption. This service virtually eliminates all unwarranted external data breaches and data leaks, as it serves data only when the data request is accompanied by the required credentials. These required credentials (<em>security credentials and data entitlements</em>) are received from an enterprise’s federated authentication systems (<em>AD, LDAP</em> etc.) in concert with the <em>AWS Identity and Access Management </em>(<em>Amazon IAM</em>) and <em>Amazon Cognito</em>.</p><p>The well-defined RESTful endpoints created with <em>API Gateway</em>, not only obviates the need for persistent database connection management to the Hub, but also eases the impact of changes to data structures. For example, an application that is receiving and processing JSON documents (business objects) from the RESTful endpoints, can continue to do so regardless of all data structure changes (adding or dropping of data elements). This ensures runtime flexibility of both the applications and the Data Hub, in an ever-changing business environment.</p><p><strong>Note:</strong><em><br>Although not explicitly illustrated, all standard networking and isolation security best practices should be assumed. This is in line with the AWS Well Architected Framework.</em></p><h3>What does the Hub really deliver?</h3><p>The goal of the Hub is to deliver up-to-date business objects that provide a 360-degree view of any facet of the business. Figure 6 illustrates an integrated Customer Business Object that is built in a ‘Hub &amp; Spoke Model’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*F0jNywKawkWnCIvtdiQZPg.jpeg" /><figcaption><strong><em>Figure 6: Sample Integrated Business Object — Customer</em></strong></figcaption></figure><h3>Conclusion</h3><p>AWS provides a rich set of services to architect and build Serverless Data Integration Hubs. The value of high-quality and standardized data delivered to the enterprise is a critical function that needs to be proactively addressed via data engineering. To state the obvious, good data generates meaningful business insights. And that is true value added to the business. I wish you the very best in 2020 and beyond for all of your data integration efforts. Take good care of yourself and stay in touch!</p><h3>References</h3><ol><li>Can we please walk before we try to run? — <a href="https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007">https://hackernoon.com/the-ai-hierarchy-of-needs-18f111fcc007</a></li><li>Data Structure of a Web Log — <a href="http://opensource.indeedeng.io/imhotep/docs/sample-data/">http://opensource.indeedeng.io/imhotep/docs/sample-data/</a></li><li>Data Structure of a Tweet — <a href="https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json">https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json</a></li><li>AWS Architecture Icons — <a href="https://aws.amazon.com/architecture/icons/">https://aws.amazon.com/architecture/icons/</a></li><li>Serverless Data Integration — Part I (2019), Gaja Vaidyanatha — <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a</a></li><li>Serverless Data Integration — Part II (2019), Gaja Vaidyanatha — <a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb">https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb</a></li></ol><p>Originally published on LinkedIn —<a href="https://www.linkedin.com/pulse/architecting-serverless-data-integration-hubs-aws-2020-vaidyanatha">https://www.linkedin.com/pulse/architecting-serverless-data-integration-hubs-aws-2020-vaidyanatha</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a27b42569518" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/architecting-serverless-data-integration-hubs-on-aws-for-enterprise-data-delivery-2020-a27b42569518">Architecting Serverless Data Integration Hubs on AWS for Enterprise Data Delivery (2020)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Data Integration — Part II (2019)]]></title>
            <link>https://medium.com/@gvaidyanatha/serverless-data-integration-part-ii-2019-fb55d180feb?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb55d180feb</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[data-integration]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Wed, 12 Jun 2019 02:00:08 GMT</pubDate>
            <atom:updated>2020-01-17T02:05:34.376Z</atom:updated>
            <content:encoded><![CDATA[<h3>Serverless Data Integration — Part II (2019)</h3><h4>A single version of the data truth - Part II</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Xz2EJwXeDz0j-PES3JA2g.jpeg" /></figure><h3>Recap</h3><p>In Part I of this 2-part article series (<a href="https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a">Serverless Data Integration — Part I (2019</a>), we discussed the importance of data integration and why every enterprise needs to proactively engage in it. We also discussed the core value proposition of serverless computing. In Part II, we will discuss details related to the architecture, required components and relevant guidelines for deploying serverless data integration platforms.</p><h3>Architecture of a Cloud-Native Serverless Data Integration Hub</h3><h4>The 4 Layers</h4><p>There is a common English saying — ‘ <em>Well begun is half done</em>’. Blame it on my craft’s occupational hazard, I say ‘ <em>Well architected is half done</em> ‘. The importance of a solid and scalable architecture enabling a Data Integration initiative, cannot be understated. Figure 4 provides a high-level view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*8ACt6YbxfquamHQ0INnDjQ.jpeg" /></figure><p><em>Figure 1 — High-level Architecture of a Cloud-Native Serverless Data Integration Hub</em></p><p>We start our data journey with the various data sources in the <em>orange bucket</em> of Figure 1. Data flows through the 4 layers in the Hub, with each layer supporting an independent function of the Data Integration Architecture. Let’s take a closer look at the layers, they are:</p><ol><li>Ingestion</li><li>Persistence</li><li>Transformation</li><li>Analytics/ML/AI</li></ol><p><strong>Ingestion</strong> is the first layer (Layer #1) where data from multiple sources enters into the Data Integration Hub. Most enterprises will probably start their data integration journey by ingesting nightly batch extracts first. For batch extracts, the landing zone for the data can be a simple storage bucket service. A microservice processes the data, on the <em>event</em> of data successfully landing in the storage bucket. In due course of time, these batch extracts need to be converted to real-time data-streams, to garner immediate business value instead of ‘ <em>end-of-day</em> ‘ value. In the long run, real-time ingestion is the preferred and recommended mode. Thus, Layer #1 in Figure 1, illustrates the use of a serverless real-time data streams processing service.</p><p><strong>Persistence</strong>, the second layer (Layer #2) of the architecture, plays the crucial role of storing data in the Data Integration Hub. This is the layer where a serverless NoSQL database service comes into focus. Persistence plays the centerpiece of Data Integration, as it stores, manages and maintains data. When data is ingested in Layer #1, it is transported to Layer #2 and stored in a <em>near-raw-format</em> within RawDB (a logical container with a set of tables/collections for raw data). The idea is to bring in data, perform some basic datatype validations and store it. Additional and more complex data validation routines will be performed in Transformation.</p><p><strong>Transformation</strong> is the third layer (Layer #3) which handles the complexity of converting raw data into clean data. The transformation layer’s complexity and heavy-lifting, relates to ensuring that data is conformant to data quality rules, business rules and compliance rules/policies. The arrival of data in RawDB of Layer #2, is <em>the next event</em>, that triggers the main transformation microservice and its related sub-microservices to fire. These event-based microservices can be deployed utilizing the relevant serverless Function as a Service (FaaS) of a Cloud Service Provider (CSP) — <em>AWS Lambda/Azure Functions/GCP Cloud Functions</em>. Data that fully conforms to all predefined transformation rules is persisted in CleanDB (another logical container with a set of relevant tables/collections for clean data) and erroneous/non-conformant data is stored in ErrorDB (the 3rd logical container).</p><p><strong>Analytics/Machine Learning (ML)/Artificial Intelligence (AI)</strong> is the fourth layer where Business Insights (BI) are generated. This layer is triggered by the arrival of data in CleanDB within Layer #2 ( <em>the</em> <em>next event</em>). This layer supports the calculation and storing of Key Performance Indicators (KPIs) for the business and the management of Analytics/ML/AI jobs. The results of all jobs (BI) are stored in InsightsDB (the 4th logical container). Serverless services can also be utilized for the implementation of this layer.</p><p>When data passes through the 4 layers, it completes its data integration cycle. The cycle is repeated, as and when new/modified data flows into the Data Integration Hub from back-end systems.</p><p><em>Notes:<br>a. Analytics is defined as a journey through data that generates questions (BI). When you embark on an analytics journey, you really don’t know what you are looking for. The BI generated by an analytics job, creates additional data mining opportunities. Analytics should not be confused with KPI calculations.</em></p><p><em>b. In many regulated industries, it is a requirement to maintain detailed accounting of all data transformation functions. This ensures the upholding of the integrity of the data and prevents covert data modification that profits vested interests. This drives the rationale behind temporarily maintaining 2 copies of the Core Data (RawDB and CleanDB).</em></p><p><em>c. The additional copy of Core Data also ensures that if Transformation goes bad for some unforeseen reason on a given day, there is a fallback option to re-run Transformation from RawDB, once the relevant issues have been resolved. Thus, the temporary cost associated with doubling the data footprint (of Core Data) is justified for operational flexibility, data integrity and regulatory compliance.</em></p><p><em>d. In the long run, the persistence and management of historical data (RAW &amp; CLEAN) needs to be addressed via standard Information Lifecycle Management (ILM) measures that utilize various tier-based-data-persistence services. All 3 CSP vendors namely AWS, Azure &amp; GCP support ILM. This ensures data persistence costs are maintained at optimal levels while adhering to all regulatory requirements.</em></p><p><em>e. The rationale behind separating ErrorDB into its own logical container, is to enable the office of the Chief Data Officer (CDO) to manage data quality issues. This visibility enables the process of engaging the relevant data stewards to fix data quality issues ‘at source’. A simple visual dashboard on ErrorDB can highlight the relevant data issues and assist in the proactive data quality management.</em></p><p><strong>Visualization</strong> also plays an important role in information delivery within the enterprise. Although not listed as a layer of the Data Integration Hub Architecture, it still needs to be given its due. In maintaining the serverless paradigm, Cloud-native visualizations services such as <em>AWS QuickSight, Azure Power BI (SaaS) &amp; GCP’s Data Studio</em> should be leveraged for the delivery of BI to the business. <em>Breaking news — Google acquisition of Looker, makes its BI and Analytics visualization offering much stronger. The integration of Looker into Data Studio should make things interesting</em>.</p><h4>ETL vs. ELT</h4><p>The ingestion and processing of data outlined in this section conforms to <strong>E</strong>xtract <strong>L</strong>oad <strong>T</strong>ransform ( <strong>ELT</strong>) instead of the classical method of <strong>E</strong>xtract <strong>T</strong>ransform <strong>L</strong>oad ( <strong>ETL</strong>). The accurate representation of <strong>ELT</strong> in a Data Integration Hub is <strong>ELTn</strong>. Why is it so? The rationale behind <strong>ELTn</strong> is grounded on the real-life-business-need, which requires transformation not to be a one-time process. Business transformation can (and will) occur many times in the life of a business and often does without any forewarning. Data Integration Hubs thus, need to support a business’s requirement to embrace change in a seamless fashion, by supporting data architectures that facilitate flexible persistence mechanisms.</p><p>In the traditional ETL model, data that does not conform to the ‘rules’, are left out of the database. Non-conforming data thus found its way to some dark substrata of an enterprise’s data landscape, rarely to be seen after that. I subscribe to the point that ALL data should be brought into the hub and then classified into CLEAN and ERROR in the Transformation phase. Over a period of time, the percentage of data in ERROR will reduce as the quality of data improves (issues fixed at source). Thus, <strong>ELTn</strong> is a fundamental paradigm shift in data management and data processing, as it departs from the classic <strong>ETL</strong> method which we’ve adhered to for more than 2 decades.</p><p>One more thing while we are on this subject — If you’ve ever attempted to architect Data Integration Hubs using relational databases and ETL, you will be familiar how every new business requirement that warrants a column modification (change), causes cascading failures — From applications that access the <em>changed object</em>, to ETL jobs that ingest data into (or from) the <em>changed object</em> and to finally replication of the <em>changed object</em> to other databases. A change to a single column in a table, can cause multiple failures. Support for frequent changes in a dynamic business environment is one of the fundamental areas where IT/data practitioners have historically struggled. With a document-based approach to data integration using NoSQL databases, and applications processing JSON from REST ( <em>Representational State Transfer</em>) endpoints, that problem is now solved.</p><h4>Consumption Pattern</h4><p>On generation of BI, applications need to be enabled to consume data from InsightsDB &amp; CleanDB in real-time. This consumption is done via the Data Access Layer (DAL) as illustrated in <em>Figure 1</em>. Utilizing REST endpoints, consumption of BI and the underlying data for the various business objects can be supported. It is important to note that DAL is the single-doorway for data consumption. This Data API layer virtually eliminates all unwarranted external data breaches and data leaks, by serving data only when the data request is accompanied by the required credentials. These required credentials ( <em>security credentials and data entitlements</em>) are received from an enterprise’s federated authentication systems ( <em>AD, LDAP</em> etc.) in concert with the Identity Access Management ( <em>IAM</em>) service of a given CSP.</p><p>The well-defined REST endpoints created as part of the DAL, not only obviates the need for persistent connection management to the Data Hub, but also eases the impact of changes to data structures. For example, an application that is receiving and processing JSON documents from the RESTful endpoints, can continue to do so regardless of any data structure change (adding or dropping of data elements). This ensures runtime flexibility of both the applications and the Data Hub, in an ever-changing business environment.</p><p><em>Note:<br>It is prudent to run DAL on a Cloud service similar to AWS’s API Gateway, Azure’s API Management or GCP’s Cloud Endpoints. This ensures performance and scalability of the data consumption layer. Equally important is the seamless integration of the microservices and orchestration layers with the DAL. In the case of AWS &amp; Azure, that is well and truly in place with their respective FaaS’s integration across all relevant services.</em></p><h3>Important Lessons Learnt — Serverless Computing Guidelines</h3><p>By this time, I hope you are appreciating the complete paradigm shift in how one has to approach serverless computing, at least as it relates to data management. In this section, I will summarize what I believe are some of the important guidelines to consider while running serverless workloads. These are lessons learnt and experience gathered. Please use them as appropriate.</p><h4>Get to Know Your System’s Quiet Time</h4><p>I have already addressed this topic in an earlier section of Part I of this series. Just to reiterate, the more you understand about when and how much <em>quiet time</em> your application has, the better success you will reap with the design and deployment of your serverless architecture. Running a serverless system with zero <em>quiet time</em> may not generate the desired outcomes of serverless computing.</p><h4>Optimize for Elapsed Time</h4><p>In the world of performance optimization, the following mantra is gospel:</p><p><em>Response Time = Service Time + Wait Time</em></p><p>Response Time is another name for Elapsed Time. The optimization goal for serverless computing should be no different. Our goal is to ensure that each microservice runs in the shortest possible elapsed time.</p><p>In the serverless realm (using the example of AWS), there is direct correlation between the amount of memory one allocates for a function to its projected cost. Cost (per minute) increases proportionately to the amount of memory allocated. However, it is also a well-known fact that larger memory allocations, also result in faster/more CPU and networking capacity to be provisioned to the function. This is the case with <em>AWS Lambda</em>, as the modification of the amount of memory for a function, has a proportional impact on CPU and networking.</p><p>At the time of the writing of this article, <em>AWS Lambda</em> allocates a single core of CPU proportionate to the amount of memory (up to 1.8 GB). Beyond 1.8 GB of memory, 2 cores are allocated and proportionally scaled. Multi-threaded microservices can and will leverage the additional provisioned resources for better performance, reduced elapsed times and even lower costs. Net-net, you are charged for the runtime of your program, so please take the time to optimize your resource allocation for your microservices, to ensure that all function runtimes are optimal. Needless to say, there is always the <em>Law of Diminishing Returns</em> to consider when it comes to resource allocation. This depends on the design and inclination of your function’s program (CPU-intensive vs. Memory-intensive vs. I/O-intensive).</p><h4>Function Runtime Limits</h4><p>When <em>AWS Lambda</em> was released in 2014, it had a runtime limit of <strong><em>300 seconds</em></strong>. At face value, this meant that a single execution of a function could not exceed 5 minutes. However, it is very easy to overcome this limitation via orchestration using <em>AWS Step Functions</em>. It is as simple as, keeping track of the runtime from the start of the program’s execution and re-launching the <em>function</em> from the <em>step function</em>, before the 300-second timer runs out. This, for all practical purposes removes the 5-minute limitation.</p><p>Further, in October 2018, AWS increased the runtime execution to <strong><em>900 seconds</em></strong> (15 minutes). This new ceiling gives more than adequate time for microservices to complete. In the end, the following salient points need to be considered: -</p><ol><li>Microservices are intended as small simple programs, thus 15 mins is plenty</li><li>Orchestration of parallel microservice execution with multiple threads, further allows for runtime reduction</li><li>When required, orchestration can support longer runtimes</li></ol><h4>Latency/Cold Start</h4><p>There are many design decisions that need to be made, to ensure optimal functioning of serverless architectures. That aside, one of the most frequently-discussed issues in the serverless realm, is the topic of elapsed time to launch an <em>AWS Lambda</em> function. This is called <em>function latency</em> and it relates to the time it takes to <em>reuse</em> an already provisioned micro-container. It is a relevant discussion point when multiple independent executions occur within a short period of time. However, when function executions occur with a frequency greater than 30 minutes, the latency times are even higher, as the micro-container needs to be <em>re-provisioned</em>. This is referred to as a <em>cold start</em>. There is a lot that needs to be learned in understanding how <em>AWS Lambda</em> truly works. To get a complete idea of the ‘anatomy and physiology’ of <em>AWS Lambda</em>, please check out AWS’s documentation in addition to — <a href="https://www.slideshare.net/AmazonWebServices/the-best-practices-and-hard-lessons-learned-of-serverless-applications-aws-startup-day-boston-2018pdf-106324321">Best practices and hard lessons learned of serverless applications</a> by Chris Munns (Principal Developer Advocate — Serverless@AWS).</p><p>Further, for those serverless implementations where such latencies are completely unacceptable, there is also an open source ‘ <a href="https://github.com/jeremydaly/lambda-warmer">Lambda warmer project on GitHub</a>’ that could help. Your mileage may vary depending on your prior design decisions. Philosophically, there is definitely a need to review and rethink the rationale and value proposition of deploying on serverless systems, if your application’s sensitivity to latency is that high and if you are trying to ‘maintain state’. Lastly, if your programming language is Python or Node.js, you may also evaluate <a href="https://dev.binaris.com/">Binaris</a>, a Function As a Service (FaaS) that helps applications proactively deal with latency/cold-start issues. For the record, I do not have any vested interest in Binaris.</p><h4>CSP Vendor Lock-In</h4><p>Could we lock ourselves with a specific CSP, just because we deployed a serverless application? I don’t think so. Could we lock ourselves with a specific CSP due to hard-coded proprietary SDK API calls in our serverless functions? Oh, most certainly yes! To the best of my knowledge, there is currently no ‘standard’ inter-Cloud SDK that we can leverage for CSP-independent API calls. Although <strong>PyPI</strong> ( <em>Python Package Index</em>) is a great initiative and a repository developed by the Python community, there is work that needs to be done in the area of a Standard Python Cloud SDK, that is seamless across multiple CSPs. What does this mean to you? An <em>AWS Lambda</em> function, programmed in <em>Python 3.6 </em>with at least one <em>AWS Python SDK </em>call ( <em>boto3 or botocore</em>), cannot be lifted and shifted to another CSP ‘as-is’. Thus, the inevitable has to be confronted — maintenance of multiple codebases (for each CSP). Let’s discuss this further and see whether we can design around this issue.</p><p>Consider a simple microservice that takes 2 simple parameters -( <em>storage_bucket_name &amp; object_name</em>) to retrieve and download an object from a CSP’s bucket. The main Python SDK API calls for this task (across 3 CSPs) is illustrated in Figure 2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*k6jebAsO7ieiCf7Ql44eWQ.jpeg" /></figure><p><em>Figure 2 — Python SDK API Calls for AWS, GCP &amp; Azure to download an object from a storage bucket</em></p><p>It is clear from Figure 2 that the microservice to perform this simple task, will be different in each of CSPs, due to their proprietary SDKs. You may require 3 orchestration programs for the 3 different CSPs and thus need to maintain 3 different codebases. This seems both painful and inevitable.</p><p>Could we handle this in the design of the orchestration and microservices programs? If the microservices and the orchestration designs are kept simple, cross-CSP microservice execution and orchestration could become a reality. This is done with a little bit of JSON juggling along with a simple code deployment configuration. Let’s now find a way to get around the hard-coding a CSP’s SDK API calls in the orchestration program, such that we maintain only 1 copy of the program. Figure 3 provides an abstraction method using JSON, to design a CSP-specific microservice at code deployment time with a single orchestrator:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*-9blh8ocVjXQHXZ2YhUEUg.jpeg" /></figure><p><em>Figure 3 — Simple Python program abstraction using JSON for a microservice in AWS, GCP &amp; Azure</em></p><p>As noted in Figure 3, the separation of the CSP’s SDK API calls into a microservice, will facilitate a single orchestration program. Here are the steps that do the trick:</p><ol><li>Abstract the microservice with the SDK API calls across all CSPs</li><li>Create a JSON doc called <em>get_obj_from_bkt</em> with the definition illustrated in Figure 3</li><li>Store <em>get_obj_from_bkt</em> in a NoSQL document collection — <em>Let’s call this table/collection as CodeAbstract</em></li><li>During code deployment (within your CI/CD pipeline), run a pre-processing program that generates the correct/relevant microservices for the chosen CSP. The CI/CD pipeline should be well aware where it is deploying the code, but explicitly handing the target CSP is important — <em>Let’s call this Python function — CodePreProc</em></li><li>Pass a runtime argument (<em>aws, azr, gcp etc.</em>) to <em>CodePreProc</em></li><li>Based on this runtime argument, <em>CodePreProc</em> queries <em>CodeAbstract</em> (in the above case specifically, the <em>get_obj_from_bkt </em>JSON doc) to generate the CSP-specific microservice.</li><li>Based on the runtime argument passed in Step#5, the code array for the CSP is selected from the JSON object{}. If <em>aws</em> is passed to <em>CodePreProc</em> at runtime, the code array for <em>aws_get_obj_from_bkt</em> is selected from the JSON document.</li><li><em>CodePreProc</em> then ‘concatenates’ newline escape sequences (‘\n’) between the elements of a given CSP’s code array (using the <em>join() </em>function) and creates the appropriate Python program for AWS — <em>aws_get_obj_from_bucket.py file</em>.</li><li>This AWS-specific microservice is now ready for testing and deployment in the next stage of the CI/CD pipeline.</li><li>So basically, we have encapsulated CSP-specific SDK API calls within the confines of a single function. It is conceivable that creating one JSON doc per SDK API call, for CSP-specific functionality, will do the trick. Again, this method is no <em>silver bullet</em>, but is a feasible alternative to hard-coding CSP SDK API calls in all programs.</li></ol><p>There are multiple advantages to the aforementioned approach:</p><p>a) First and foremost, it enables us to leverage a single orchestration/wrapper program, that has no CSP-specific function calls. This allows the support for multiple CSPs with the same codebase with independent CSP-specific SDK API microservices (functions).</p><p>b) Any change in the SDK (arguments/names etc.) for a given CSP, affects ONLY one specific CSP’s code array within the JSON document. As long as correct syntax of the JSON document is maintained, there is ZERO impact for the other CSPs and the orchestrator program.</p><p>c) For those applications that are not latency-sensitive, program abstraction for CSP-specific SDK API calls, can also be done dynamically at runtime. Now that is a pure case of <em>Cloud Microservices Deployment Nirvana </em>:)</p><p>In summary, CSP-specific SDK API call abstraction requires upfront design and may not be feasible for all existing projects. However, for new projects it does provide a method to decouple microservices with CSP-specific SDK API calls. This helps in maintaining generic base/orchestration programs while keeping us free from vendor lock-in!</p><h4>Serverless Functions — Idempotent vs. Duplicate Processing</h4><p><em>Idempotent</em> is a fundamental construct of computer science that defines the end state of a program’s execution. Idempotent execution requires that, with the same set of input values, the end state of the program, remains exactly the same, no matter how many times the program is run. For example, if we run a program to modify the address of a customer to ‘123 Main Street’, no matter how many times we run it, the end state of the customer’s address is ‘123 Main Street’. This is an example of an idempotent program/function. Said another way, there are no adverse side effects of running this function multiple times. So, whether a function is idempotent or not, depends on the design and programming of the said function.</p><p>There is confusion in some circles regarding this term as it relates to <em>AWS Lambda</em>. Due to the dynamic and asynchronous nature of how a <em>Lambda</em> function comes to life (including launching of micro-containers during a cold start), there are some edge cases when multiple containers can be launched simultaneously for a single execution request. As practitioners of Cloud Computing, we need to design with one important principle — ‘ <em>everything that can break, will break</em>’. Thus, the environmental side-effect of <em>AWS Lambda</em> discussed above, needs to be addressed. It is a simple case of preventing duplicate data processing.</p><p>Regardless of serverless computing, I’m philosophically inclined to designs that protect the system from any accidental duplicate processing of the same data. These safeguards are usually factored within the confines of the logic of the program. The scenario of duplicate data processing is similar to consumption management of a message queue. To ensure the integrity of processing, one needs to design one’s programs correctly, such that <em>always once</em> processing is preferred over <em>at least once</em> processing. Thus, the subject of being idempotent is irrelevant here unless of course the processing is similar to the address change that was discussed earlier. Thus idempotent should not be confused with design patterns that prevent duplicate data processing. They are two different aspects of a system and need to be dealt as such.</p><h4>Hard-wiring functions to a VPC</h4><p>The basic recommendation for function and VPC association goes like this — Using the <em>AWS Lambda</em> use case, if your function does not access resources within a VPC, do not force it to run within the VPC. As of the authoring of this article, there is a network configuration overhead on the micro-container (related to <em>Elastic Network Interfaces — ENIs</em>) and hard-wiring a function to a VPC comes at a cost. If the function requires access to other resources within the VPC, it is recommended to place it in a private subnet for security and segregation.</p><h4>Function Testing — Local vs. On the Cloud</h4><p>Every programmer has his/her favorite Integrated Development Environment (IDE). There is no doubt about the value an IDE brings to program testing. Cloud Functions need to be tested ‘locally’ first, before they are pushed into the Cloud. Let’s face it, testing functions on the Cloud without a Cloud-aware IDE can be very time-consuming. You end up spending the bulk of the time pushing code through the CSP’s code management plumbing versus performing the actual testing.</p><p>It is understandable that it is faster to generate the events locally, ensure the validity of an entire execution flow, of a string of microservices, before attempting the push the code and run it on the Cloud and deal with a slew of errors. Mercifully, there is a solution that should make our coding/testing/deployment life much easier. It is developed by <a href="https://www.stackery.io/">Stackery</a>. While you are at Stackery’s website, be sure to check out the video of a serverless function testing/deployment. Again, for the record, I do not have any vested interest in Stackery.</p><h4>Function Observability — Pain-free Production Monitoring &amp; Troubleshooting</h4><p>One of the pet peeves of IT professionals who’ve transitioned from a server-based environment to the serverless realm, is the lack of <em>function observability</em>. This is ability to observe the details associated with a function’s execution. In a server-based environment, one always had the ability to observe program execution via various tracing methods. Although there is a default standard set of metrics logged in <em>CloudWatch</em> logs of AWS, for those applications that have many function-calls a day, data mining function-specific details from <em>CloudWatch</em> (or any other monitoring service for that matter) can pose some challenges.</p><p>Sifting through CloudWatch logs to find a function’s execution details at a specific hour, minute, second on a given day, especially when there are many other services/metrics logged in <em>CloudWatch</em>, is analogous to <em>finding a needle in a haystack</em>. In my experience, this problem within the context of data integration hubs, can be very easily solved by instrumenting each microservice with a logging function, that writes to a <em>log table</em> of our choice. Yes, there is <em>AWS X-Ray</em> for function debugging and tracing. However, I believe we need better control of our <em>logging destiny</em>.</p><p>Basically, we need to take the responsibility to define what we want to observe in a function’s execution. A little investment in design of the <em>log table</em> and its key data elements ( <em>function_name, run_date, run_time, total_elapsed_time, call parameters</em> <em>etc.</em>) goes a long way in solving this problem. Start with a simple <em>log table</em> design and augment it according to your evolving needs. This adds significant production monitoring value for your serverless deployments. Here is how: -</p><ol><li>You define the structure of the <em>function execution logs</em> relevant to your application, i.e., you don’t have to live with some default <em>one-size-fits-all</em> imposed standard</li><li>You control the amount of logging based on execution criteria and logging levels by defining <em>higher granularity</em> during debugging/ troubleshooting vs. <em>lower granularity</em> during normal times</li><li>You utilize visualization services (similar to <em>AWS ElastiCache</em>) to convert logs into relevant production information, that provides clear working health of your application — in our case the health of the Data Integration Hub</li><li>You control the amount of <em>log history</em> to what is appropriate in your environment (helps with establishing performance baselines)</li></ol><p>Function Observability thus is a critical aspect of production management of serverless applications and the return on investment of a self-sufficient logging model is very high.</p><h4>Separation of Serverless &amp; State</h4><p>The topic of serverless applications supporting state seems to also generate a lot of heated debate. Is there a real need for serverless to better support ‘stateful’ applications? That is the burning question for most. I believe that serverless applications, true to their runtime environment, should not have to worry about maintaining state (normally defined as the entire contents of an application’s memory).</p><p>Given the ephemeral nature of micro-containers in the serverless realm, I personally believe that it is not a good idea, to force serverless computing environments to save state. There could be multiple unwanted side effects of this, in the long run. If there is a need for an application to maintain temporal state, then the onus is on the application’s programming logic to persist <em>state data</em> in a relevant datastore ( <em>Memcached</em> or <em>Redis</em> as applicable).</p><h3>Conclusion — Is Serverless Dead?</h3><p>Now that’s a controversial question! With all the hype that revolves around serverless — <em>what it is, what it isn’t, why it has failed, why it has succeeded</em>, it is useful to revisit its humble beginnings and understand the original rationale behind its creation. Find out here whether — <a href="https://www.slideshare.net/ChrisMunns/serverless-is-dead-132954772/70">Serverless is Dead</a>. Well, in my humble opinion it isn’t, not by a long shot. But there is no harm in getting a few good laughs as you go through this presentation.</p><p>I hope this 2-part article series has provided some <em>food for thought</em> on the relevant topics associated with serverless computing, specifically as it relates to data management. I wish you the very best in your data integration journey on the Cloud. As we part ways, I have these final words for you — <em>Be happy, live long and prosper (à la Spock)</em> :)</p><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/serverless-data-integration-part-ii-2019-gaja-vaidyanatha/"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb55d180feb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Data Integration - Part I (2019)]]></title>
            <link>https://medium.com/@gvaidyanatha/serverless-data-integration-part-i-2019-b3b3b3bc332a?source=rss-6c39cf3d26f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3b3b3bc332a</guid>
            <category><![CDATA[360-degree-view]]></category>
            <category><![CDATA[business-insight]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[data-integration]]></category>
            <dc:creator><![CDATA[Gaja Krishna Vaidyanatha]]></dc:creator>
            <pubDate>Wed, 05 Jun 2019 08:27:47 GMT</pubDate>
            <atom:updated>2020-01-17T02:04:19.705Z</atom:updated>
            <content:encoded><![CDATA[<h4>A single version of the data truth — Part I</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*syADMBdlo7LV9VLDsRoUJQ.jpeg" /></figure><h3>Setting the Stage</h3><p>In the summer of 2017, I wrote a 4-part article series on LinkedIn that documented my then 25-year journey from Oracle to NoSQL. Here it is, in case you missed it:</p><p>1) <a href="https://www.linkedin.com/pulse/confessions-relational-bigot-my-journey-from-oracle-vaidyanatha?published=t">Confessions of a Relational Bigot — My Journey from Oracle to NoSQL : Part I — Prelude &amp; Early Days (1992–1997)</a></p><p>2) <a href="https://www.linkedin.com/pulse/confessions-relational-bigot-my-journey-from-oracle-part-vaidyanatha?published=t">Confessions of a Relational Bigot — My Journey from Oracle to NoSQL : Part II — The Growth Years (1998–2003)</a></p><p>3) <a href="https://www.linkedin.com/pulse/confessions-relational-bigot-my-journey-from-oracle-part-vaidyanatha-1?published=t">Confessions of a Relational Bigot — My Journey from Oracle to NoSQL : Part III — Flying Solo (2004–2016)</a></p><p>4) <a href="https://www.linkedin.com/pulse/confessions-relational-bigot-my-journey-from-oracle-part-vaidyanatha-2/">Confessions of a Relational Bigot — My Journey from Oracle to NoSQL : Part IV — Evolution, Learning &amp; Transformation — ELT (2017)</a></p><p>The final scene in Part IV had me switching to NoSQL after living and breathing relational databases for over 2.5 decades. At the time, I had just embarked on very complex data integration project. The data problem that I was responsible for did not give me much of a choice. Without an Enterprise Data Model (EDM) at the physical level, I did not have a fighting chance to integrate multiple sources of data and make it into ONE, on a relational platform.</p><p>A NoSQL database is the centerpiece of any data integration effort. With its flexible, document-based persistence model, a NoSQL database can support different data <em>elements</em> (columns) for different <em>objects</em> (rows) within the same <em>collection</em> (table). And that is exactly what real-life data integration initiatives require — The flexibility of adapting to ever-changing business needs and storing data without the constraint of a static schema. Also, NoSQL supports harmonization and canonicalization of data really well, when compared to relational. The ability to create a single source of the data truth without a physical EDM and yet provide a unified, standardized and high-quality view of an enterprise’s data, is now possible.</p><p>The serverless NoSQL offerings in the Cloud (i.e., <em>AWS DynamoDB, Azure CosmosDB &amp; GCP FireStore</em>), take data integration to a whole new level. A fully managed Cloud-native, serverless offering of NoSQL, has the power to integrate multiple sources of an enterprise’s data assets at scale without a predefined static schema. If we could run our NoSQL databases in the Cloud as a fully managed services without servers, why would we attempt do it any other way? After all, isn’t our core competency — data management? It is time we got out of the business of infrastructure and software management and solely focus on getting our data story right.</p><h3>What is Data Integration?</h3><p>Let’s start with a little bit of American History. In 1776, a Swiss national named Pierre Eugene du Simitiere, served as an artistic consultant in the committee that created the Great Seal of the United States. He suggested a thirteen-letter Latin motto: <em>E Pluribus Unum — </em>translated as<em> Out of Many, One</em>. Mr. Simitiere who later became an American citizen, wanted the motto to conceptualize the meaning of the emergence of a new single nation with the union of the original 13 colonies (New Hampshire, Massachusetts Bay, Rhode Island &amp; Providence Plantations, Connecticut, New York, New Jersey, Pennsylvania, Delaware, Maryland, Dominion of Virginia, North Carolina, South Carolina &amp; Georgia). More on this subject can be found at — <a href="https://en.wikipedia.org/wiki/E_pluribus_unum">https://en.wikipedia.org/wiki/E_pluribus_unum</a>.</p><p>Data Integration has a striking resemblance to the motto of the United States — we create a unified data view from a variety of data colonies present within the enterprise. This unified data view is conceptually illustrated below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*xTb3PlcaU8VKEu046o_TkQ.jpeg" /><figcaption>Figure 1 — Data Integration: Unified view from multiple disparate sources</figcaption></figure><p>Figure 1 elucidates the true value behind data integration — bring multiple sources of data together, cleanse the data, provide a high-quality unified data view, enable digital transformation.</p><h3>Why is Data Integration Important?</h3><p>Data Integration strives to solve the pandemic problem of data quality and inconsistency caused by multiple data silos created within an organization, over many years of IT supporting an enterprise’s business needs. Without consistency, high-quality and standardization of data, an enterprise can be perceived as ‘<em>flying blind</em>’. This is so, due to a lack of consistency in the information that is served on the most important facets of the business. Figure 2 illustrates the core functions of a Data Integration Hub:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*eN21seX2W3D8xjtjug1KIw.jpeg" /><figcaption><em>Figure 2 — Functions of a Data Integration Hub</em></figcaption></figure><p>In Figure 2, the core functions of a Data Integration Hub are outlined as follows:</p><p>1. Integration of all relevant data streams (Relational, Non-relational including Big Data &amp; Logs, Social Media)</p><p>2. Transformation, continuous standardization of data with data quality checks</p><p>3. Object versioning along with dependency tracking</p><p>4. Cataloging and maintaining the various data assets (including its metadata) to ensure lineage is established, changes are tracked, and consistency is introduced.</p><p>The primary goal of any data integration effort is to provide a single and accurate data view for the business. Without this unified view of the data, the value proposition of all initiatives that deliver information/insights to the business, i.e., Analytics, Machine Learning, Deep Learning &amp; Artificial Intelligence is questionable.</p><p>The rationale is pretty simple → If the quality and standardization of data is questionable, how could the generated business insights be trustworthy? And, if you subscribe to <em>Responsible AI</em>, then it is imperative that we all collectively do what is required to feed our AI algorithms clean and consistent data.</p><h3>What does Data Integration Deliver?</h3><p>Data Integration initiatives need to primarily focus on delivering the Enterprise Business Intelligence Crown Jewels (EBICJ). These are actionable business insights that the business can leverage. These critical and important business insights can be unearthed at the confluence of the <em>4 main data streams</em>. These <em>4 data streams</em> serve as foundation blocks, upon which every Data Integration initiative needs to be built. They are Core Data, Customer Relationship Management (CRM) Data, Non-relational Data &amp; Social Media Data, as shown below in Figure 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*X_6RNpyxQTMhaXsncNN4-w.jpeg" /><figcaption><em>Figure 3 — Unearthing the Enterprise BI Crown Jewels</em></figcaption></figure><p>Figure 3 illustrates the act of bringing together the <em>4 main data streams</em>. Data Integration is the process of bringing these disparate sources of data together, to present an integrated, standardized and single-view of the relevant aspects of an enterprise’s business. We embark on the journey of unearthing EBICJ, in a phased manner with the following steps:</p><p>1. First and foremost, we need to harmonize and canonicalize Core Data. This important step paves the path in gaining a good understanding of the most important aspects of the business — CUSTOMER, PRODUCT/SERVICES, TRANSACTIONS and related entities. This is the step where the golden copy of all core data assets is created.</p><p><em>Use Case — Customer interacts using regular communication channels with the business and the relevant actors need to have a complete and accurate picture of all customer details. This is the obvious use case of having a single version of the data truth — a single unified customer record.</em></p><p>2. The second step is to integrate CRM Data with Core Data, as this assists in understanding how customers/prospects interact with the enterprise using established CRM channels. This provides another facet of understanding the customer and becoming ‘<em>customer-centric</em>’ from the get-go.</p><p><em>Use case — It is important to know how many times a customer/prospect has interacted with the business on a specific issue via CRM channels. What is the conversion rate of prospects to customers?</em></p><p>3. Thirdly, the Non-relational Data needs to be integrated with Core &amp; CRM Data. This includes but not limited to establishing relationships with data that is sourced from messages, images, documents, audio and video. These non-relational data sources are pertinent to the various aspects of the business defined in Core &amp; CRM Data. This part may also include data from Edge Computing devices — IoT data (i.e., logistics and remote asset management if relevant) — <em>Non-relational Part I</em></p><p><em>Use case — it is also useful to know that a customer has texted, spoken to (with or without video) or sent images/documents to the business for a specific task/issue. Data from Edge computing devices (where relevant) needs to be brought into the fold.</em></p><p>4. Next, the logs that are generated within the various components of the technology stack (machine logs, web logs, activity logs etc.) needs to be integrated with Core, CRM &amp; Non-relational Part I. This provides yet another critical facet of understanding on how all concerned parties interact with the business, via the existing IT solution stack — <em>Non-relational Part II</em></p><p><em>Use Case — Why do customers, when using our system navigate from Screen #1 from Screen #3 without looking at Screen #2? Is Screen #2 relevant and important? Does it require a redesign</em>?</p><p>5. The final step is to integrate Social Media Data to Core, CRM &amp; Non-relational Data (Parts I &amp; II), as this, in addition to all above, enables us to ascertain the ‘digital pulse’ of all parties relevant to the business.</p><p><em>Use Case — Customer airing his/her concern regarding a service/product on social media. Is this a case where regular &amp; CRM channels have failed to generate the optimal resolution? Time for customer service to engage in high-gear and take care of the customer.</em></p><p>The following is a sample <strong>integrated</strong> customer record in JSON format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Mcjp3ni9ub64PXCqsSuqIQ.jpeg" /></figure><p><em>Notes:<br>1. In an effort to control the size of each JSON document, it is recommended that reasonable abbreviations be utilized for field names. The full/standard name of a given data field (per business standard) can be maintained in a separate Metadata table/collection with abbreviated pointers as Keys (i.e., ADDR_PC = ADDRESS_POSTAL_CODE). Alternatively, numeric identifiers could be also used to replace abbreviated pointers, for further size reduction.</em></p><p><em>2. The URLs for the various storage buckets (i.e., S3 in AWS) provide the base locations where a given type of non-relational data is stored. Within each bucket, separate folders for each unique customer and unique dates of interaction can be maintained. There is room for flexibility of design and abstraction of these storage buckets, but at least the basic design concept is established here.</em></p><p>Figure 4 illustrates the customer record of <em>Jane Roe,</em> as a result of the <em>4-data streams</em> brought together in <em>5 phases</em>. This integrated record establishes a single point from which all of <em>Jane’s</em> interactions can be determined. Depending on the enterprise’s type of business, the ordering Steps 4 &amp; 5 can be switched.</p><p>This integrated view of <em>Jane Roe</em> facilitates very high levels of customer service and understanding how <em>Jane</em> relates to the business. This also begins the enterprise’s journey of becoming <em>customer-driven</em> and even possibly <em>customer-obsessed</em>. This is also when the infamous ‘<em>360-degree view of the business</em>’ comes into focus. An enterprise and all its actors truly begin to understand the customer and how the business interacts with <em>Jane</em> (and vice versa). This is not possible without an integrated customer record for <em>Jane Roe</em>.</p><p><em>Note:<br> As a data practitioner, I believe that all data inherently possesses structure. This may not be always apparent. On closer observation, a tweet, a LinkedIn post or a Facebook update, all have a well-defined structure. As does an Apache web log entry. For me, ‘Structure is in the Eye of the Beholder’. I have thus refrained from using the terms </em><strong><em>structured</em></strong><em>/</em><strong><em>unstructured</em></strong><em> data. Instead I have used the classification of </em><strong><em>relational data</em></strong><em> (optimally stored in columns and rows) and </em><strong><em>non-relational data</em></strong><em> (cannot be optimally stored in columns and rows).</em></p><h3>The Lure of Serverless…Why Quiet Time is Important?</h3><p>Serverless Computing is no longer the shiny object that programmers are trying to covet to look cool. It has become mainstream with offerings from the various Cloud Service Providers and has transformed way past the original ‘hype’ stage (although a different type of hype is emerging, we shall discuss this later in Part II). In an attempt to not be repetitive, I will not go into a discourse describing the various features and aspects of serverless computing. Instead I will discuss the quintessential facets of this new computing platform as it relates to the subject on hand. As of the authoring of this article, a simple Google search of ‘serverless’ returns over 6.13 million results. You are advised to invest the required time in studying, based on your level of understanding of the subject. Nevertheless, to set a baseline understanding, here is my working definition:</p><p><em>Serverless computing is a layer of abstraction that enables IT practitioners to solely focus on the event-driven execution aspects of an application (built as microservices in one’s favorite programming language), without any concern for hardware capacity planning, physical infrastructure provisioning, operating system installation, patching and management</em>.</p><p>Thus, if you are looking at a computing environment that is agile, is flexible, carries little overhead, is focused on the programming language of your choice, is super scalable and you pay only for your actual runtime of your program, then you probably are in the serverless realm.</p><p>Serverless does not mean there are no servers in computing, it just means that there are no servers when the application is not running (well almost!). Which means that, if you want your Python 3.7 program to run in a compute environment with 2 GB of memory and if it does so for 140 seconds, then that is exactly the compute environment you receive and the duration that you pay for. This is important.</p><p>Although not directly stated, the true value proposition of serverless computing is fundamentally anchored on the premise of <strong><em>runtime execution with significant periods of quiet time</em></strong>. For example, if you need to run a data integration hub and the sum total of all activity in a 24-hour period averages to 10 hours of computing time per day, then serverless is the way to. You will reap all the marketed benefits of serverless, and you will ‘pay for actual usage’ (10 hours) and not pay for the remaining 14 hours of the day.</p><p>In this scenario, the operational cost of running this data hub in the serverless computing model, will be much lower than server-based model. Plus, the runtime computing environment for your application, will continually leverage the most current, secure and stable machine image, without the hassle and overhead of any installs, patching or OS management on your part. Also, the more contiguous the chunk(s) of <em>quiet time</em>, the bigger the benefit will be with a serverless computing platform.</p><p>Contrast that with an application that generates 100 API calls per second, which in turn calls microservices (i.e., <em>AWS Lambda functions</em>) 100 times/second, 24x7 every week of the year, the value proposition of serverless here is much diminished. In this scenario, it is unfair to blame serverless as more expensive than a server-based configuration. I hope you can clearly discern the emerging anti-pattern here.</p><p>If you absolutely have no <em>quiet time</em> in your system, then serverless may not be the right choice for you. In that case, it may be better to launch the required compute machines, install the required software on these machines, patch and fix issues in the environment as they arise and do what we have done all these years (just a lot easier with virtual machines, golden machine images, auto scaling etc. in the Cloud). In this scenario, the reduced operational costs may justify the increased operational overhead. However, if you are running your shop with a skeletal staff (i.e., a startup), the more you lean on managed services and automation, the better are your chances of staying afloat and relevant for longer periods of time.</p><p>In summary, for those systems that demonstrate <em>quiet time</em>, serverless computing eliminates many operational issues, providing a low-cost computing platform and lets us focus on — ‘<em>Building event-driven microservices that deliver business value</em>’.</p><h3>The Power of Simple</h3><p>In my years of designing systems, I have subscribed to the following construct:-</p><p><em>Simplicity → High-Availability + Performance + Scalability + Consistency</em></p><p>A simple design facilitates easier and more accurate implementation of a (simple) system, with the fewest decoupled moving parts. In my experience, the following observations have held true:</p><p>1. Simple systems break on rare occasions, thus requiring simple error handling. These simple systems are also easier to self-monitor. With low frequency of breakages, they inherently become highly available. Stated in another way, the propensity for failures in a system is directly proportional to the degree of complexity in the system’s design.</p><p>2. Simple systems achieve higher levels of high availability compared to their complex counterparts.</p><p>3. Simple systems (when implemented optimally) possess fewer serialization points, resulting in fewer bottlenecks and longer periods of optimal performance.</p><p>4. All else remaining constant, an optimally performing system normally demonstrates scalability when compute-resources-scaling is commensurate to application-scaling.</p><p>5. As a result of observations 1–4, simple systems demonstrate consistency over long periods of time.</p><p>Notwithstanding what I have already mentioned in the previous section, serverless computing facilitates simplicity in design and simplicity in deployment. For applications with <em>quiet time</em>, serverless computing is definitely a viable option. Data Integration is one such application where serverless computing is a perfect fit.</p><h3>Event-Driven vs. Orchestration</h3><p>Microservices are small and simple programs that perform simple tasks. These form an integral part of the event-driven architecture of a serverless ecosystem. However, microservice orchestration is an equally important in serverless computing.</p><p>Stating the obvious, in a dynamic environment when responding to disparate events occur, event-driven architectures are predominant, with the required orchestration when relevant. Orchestration is required when sequencing, conditional execution and parallelization of microservice execution is required. Consider the following pseudo-code that demonstrates a workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*JvuTbKjB-bnePQpesSOvQQ.jpeg" /><figcaption><em>Figure 5 — Pseudo-code for sample workflow</em></figcaption></figure><p>In the above scenario, when X occurs, <em>microservice-x</em> needs to run and with the additional condition of 8 parallel execution threads, when the <em>data_volume</em> is over 1 million. <em>Microservice-y</em> (a dependent task) needs to follow the execution of <em>microservice-x</em>. I think you get my point — Orchestration is usually an inevitable and an integral component of event-driven architectures.</p><p><em>Note:<br>The AWS serverless platform supports seamless integration between microservices (AWS Lambda) and orchestration (AWS Step Functions). When combined with the API Gateway, it provides the required foundation services, for event-driven program execution and orchestration. The Azure serverless platform also supports a similar paradigm with microservices (Azure Functions) and orchestration (Azure Logic Apps). Azure API Management is the comparable equivalent of AWS’s API Gateway.</em></p><p>To be continued…</p><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/serverless-data-integration-part-i-2019-gaja-vaidyanatha/"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3b3b3bc332a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>