<?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 Nguyen Tran Tuan on Medium]]></title>
        <description><![CDATA[Stories by Nguyen Tran Tuan on Medium]]></description>
        <link>https://medium.com/@nguyentrantuan?source=rss-5c9aaa4577d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Nguyen Tran Tuan on Medium</title>
            <link>https://medium.com/@nguyentrantuan?source=rss-5c9aaa4577d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:07:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nguyentrantuan/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[How we save a ton of money while building large-scale Data Lake in AWS - Part 1: Data Ingestion…]]></title>
            <link>https://nguyentrantuan.medium.com/how-we-save-a-ton-of-money-while-building-large-scale-data-lake-in-aws-part-1-data-ingestion-b5850733465d?source=rss-5c9aaa4577d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5850733465d</guid>
            <category><![CDATA[data-integration]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-lake]]></category>
            <dc:creator><![CDATA[Nguyen Tran Tuan]]></dc:creator>
            <pubDate>Tue, 24 Nov 2020 14:28:20 GMT</pubDate>
            <atom:updated>2020-11-24T14:52:24.890Z</atom:updated>
            <content:encoded><![CDATA[<h3>How we save a ton of money while building large-scale Data Lake in AWS - Part 1: Data Ingestion with AWS DMS, Glue Crawler, Glue Data Catalog (Bonus: Terraform script!)</h3><h3><strong>Embarking Data Lake journey without sweating on expensive tools</strong></h3><p>TL,DR: hit to my <a href="https://github.com/nguyentrantuan/datalake-ingestion-terraform">Github</a> repo and find out the Terraform script for DMS module, which will stand-up DMS instance and ready to connect SQL or MySQL databases</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fGCRLmg0npZ4twQcq3oFuQ.png" /><figcaption>Typical AWS-focus Data Lake design</figcaption></figure><h4>DATA INGESTION SOLUTION</h4><p><strong>AWS Database Migration Service (DMS) features</strong></p><ul><li>Can replicate various traditional source database technologies: MySQL, SQL Server, PostgreSQL, SAP ASE, Oracle, IBM DB2 LUW, Amazon DocumentDB, MongoDB, S3</li><li>S3 target supports parquet columnar format out-of-the-box, Change Data Capture (CDC) near-real-time. DMS instance can scale up/down</li><li>The source database can remain fully operational during the migration and CDC</li><li>Some transformations can be configured before data land into S3 (add/remove/modify column, table filters, pre-fix, data type casting,…)</li><li>Pricing: ~ $3000–5000/year depending on your instance type and Multi AZ configurations. You can keep pricing low if near-real-time workload not a priority by reducing concurrent number of replicating tables and/or number of tasks, or scheduling instance type change via Terraform or API between peak/off-peak hours.</li></ul><h3><strong>Other Data Ingestion Options</strong></h3><p><strong>AWS Lake Formation</strong></p><ul><li>Newly added product of AWS, siting on top of Glue ETL to create data ingestion workflows</li><li>Job bookmarks can only capture newly added rows (No CDC)</li></ul><p><strong>Stitch Data (Talend)</strong></p><ul><li>SaaS — no setup, point-and-click, 100+ data sources</li><li>Automatically manage data source changes (Data types, add/remove column); Change Data Capture (CDC) capability</li><li>Free first 5 mil rows/month of free sources and $1200/year for standard plan (5 mil rows/month). Free historical data load</li></ul><p><strong>Qlik Attunity Replica</strong></p><ul><li>Run on server, user-friendly web interface</li><li>Limited data source, no SaaS.</li></ul><h3><strong>Glue Crawler and Data Catalog and QUERY S3 DATA USING ATHENA</strong></h3><p>Replicating data into Data Lake is enough? Not at all! putting all data in S3 is still far reach for your BI analysts or Data Scientists to query or to generate reports. Therefore, Glue Crawler and Catalog come into place.</p><blockquote><strong>The AWS Glue Data Catalog </strong>contains references to data (metadata of tables) including data types, file format, schema. It makes Data Lake act like you are storing data in normal database system with databases and tables instead of S3 objects.</blockquote><blockquote><strong>AWS Glue crawlers </strong>interact with S3 data stores and other elements to populate the Data Catalog.</blockquote><blockquote><strong>AWS Athena<em> </em></strong><em>is known as server-less Presto to execute SQL query in Data Lake environment. It integrates out-of-the-box with AWS Glue Data Catalog and you only pay for your query. <br>However, Athena is way more than just query client and plays key role in our ETL eco-platform. More on this in 2nd part (wink!)</em></blockquote><h3>Enter Infrastructure-as-code era with Terraform</h3><p>All of above can happen via AWS console, but who would do that nowadays ? :D</p><p>With Terraform, we can automate the creations of all above services with capability to add more database source or scale up/down. Input your database configurations and Terraform would do the magic by creating:</p><ul><li>DMS instance including all necessary roles (vpc role, cloudwatch log role), subnet group and security group</li><li>DMS Endpoints (for each schema source and S3 target)</li><li>DMS Replication tasks</li><li>Glue Database for each database source</li><li>Glue Crawler against S3 data, run daily</li><li>SNS topic and events to alert when things go wrong with DMS</li></ul><p>In Terraform variable list, you configure Data Source to look something like this</p><pre>endpoints_list = {<br>	test-databasename2 = {<br>		glue_database_name = &quot;test_databasename2&quot;<br>		parent_directory = &quot;parent_dicrectory&quot;<br>		database_name = &quot;databasename2&quot;<br>		target_subsequent_folder = &quot;/test/databasename2&quot;<br>		endpoint_type = &quot;source&quot;<br>		engine_name =&quot;sqlserver&quot;<br>		&quot;server_name&quot;: &quot;10.10.10.10\\DATA01&quot;<br>		&quot;username&quot;= &quot;#{sqlusername}#&quot;<br>		&quot;password&quot;= &quot;#{sqlpassword}#&quot;<br>		&quot;port&quot;= 1433<br>		&quot;table_mapping_rule&quot;= {<br>			&quot;rules&quot;: [<br>				{<br>					&quot;rule-type&quot;: &quot;selection&quot;,<br>					&quot;rule-id&quot;: &quot;1&quot;,<br>					&quot;rule-name&quot;: &quot;1&quot;,<br>					&quot;rule-action&quot;: &quot;include&quot;,<br>					&quot;object-locator&quot;: {<br>						&quot;schema-name&quot;:&quot;dbo&quot;,<br>						&quot;table-name&quot;: &quot;%&quot;<br>			...........</pre><h3>The Result</h3><p>After terraform run, it will create all necessary roles and tasks for the replication process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlnOHV_Kc4I9z4a9763N5Q.png" /><figcaption>List Source and Target end-points created</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlrUHdYpSNwQrA07L01ePQ.png" /><figcaption>Replication tasks created by Terraform.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*jOpSMoKbHn2wpHYf6mVDGw.png" /><figcaption>Your data already querry-able in Athena, thanks to Glue Crawler and Data Catalog</figcaption></figure><p>After full-load and having Glue Crawlers kicked-in, your data is safely located in S3 and ready to query via Athena. Voila!</p><h3><strong>Hints</strong></h3><p>After full-load, you can safely scale down DMS instance if real-time not your top priority. I recommend at least DMS.R4.2xLarge for full-load in medium database and then R4.Large for CDC process.</p><p>During full-load, if the instance does not have enough memory, you will face FATAL_ERROR. You need to scale up or reduce your number of tasks or concurrent table MaxFullLoadSubTasks and then resume the tasks.</p><p>Github: <a href="https://github.com/nguyentrantuan/datalake-ingestion-terraform">https://github.com/ministryofjustice/cloud-platform-terraform-dms</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5850733465d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>