<?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 Kamalakar Bejugama on Medium]]></title>
        <description><![CDATA[Stories by Kamalakar Bejugama on Medium]]></description>
        <link>https://medium.com/@kamalakarbsg?source=rss-092ee232dbc5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Nf88v5GCx6kkbcER</url>
            <title>Stories by Kamalakar Bejugama on Medium</title>
            <link>https://medium.com/@kamalakarbsg?source=rss-092ee232dbc5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 19:06:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kamalakarbsg/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[Unpacking Pelago Data Platform Layered Architecture]]></title>
            <link>https://medium.com/@kamalakarbsg/unpacking-pelago-data-platform-layered-architecture-b13ef7dbb628?source=rss-092ee232dbc5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b13ef7dbb628</guid>
            <category><![CDATA[nlq]]></category>
            <category><![CDATA[data-platform-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-architecture]]></category>
            <dc:creator><![CDATA[Kamalakar Bejugama]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 03:53:32 GMT</pubDate>
            <atom:updated>2025-09-17T04:11:34.849Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction :</h3><p><a href="https://www.pelago.com/"><strong>Pelago</strong></a><strong>,</strong> a rapidly growing traveler attractions &amp; experiences ticketing platform from <strong>Singapore Airlines</strong>, faced significant challenges with its initial data platform. The previous setup was not standardised, leading to issues with scaling, data refresh times, and ease of making changes. This resulted in:</p><h4>Challenges :</h4><ol><li>Cluttered tables and views with interdependent logic.</li><li>Data sets and dashboards taking several hours to refresh.</li><li>Complex data patching tasks when changes were needed.</li></ol><p>To address these challenges, We have implemented a layered data architecture using <strong>dbt</strong>, organised into<strong> Bronze, Silver, and Gold</strong> layers. This approach is inspired by popular <strong>Medallion Architecture principles,</strong> ensuring data quality, reliability, and accessibility. Ingestion tools like <strong>Airflow, Glue, and Hevo</strong> are used to bring data from the various sources &amp; system covering in both <strong>realtime &amp; batch</strong> timings.</p><p>These issues underscored the urgent need for a more <strong>structured, resilient, and scalable data platform</strong>.</p><p><strong>Modern Ingestion Pipelines:</strong></p><p>To ensure a robust foundation for our layered architecture, we established a modern ingestion pipeline utilising a combination of industry-standard tools:</p><ul><li><strong>Airflow:</strong> Orchestrates complex data workflows, ensuring timely and reliable data loading from various sources.</li><li><strong>AWS Glue:</strong> Leveraged for server-less ETL jobs, particularly for processing large volumes of data and handling diverse data formats.</li><li><strong>Hevo Data:</strong> No-Code ETL.</li></ul><p>Crucially, all ingested data undergoes a set of platform-defined standardisation rules:</p><ul><li><strong>Date Time/Format Handlings:</strong> Consistent UTC timestamps and standardised date formats across all datasets.</li><li><strong>Currency/Format Handlings:</strong> Ensuring all monetary values adhere to a single currency standard (e.g., SGD) and format.</li><li><strong>Semi-Structured Data Handlings:</strong> Parsing and flattening JSON or other semi-structured fields into usable columns.</li><li><strong>Addition of DE Tracking Columns:</strong> Including essential metadata columns like sys_process_date, sys_process_time,..etc for improved data governance and lineage tracking.</li></ul><h3>Layered Data Architecture: Bronze, Silver, Gold</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>At the heart of <a href="https://www.pelago.com/">Pelago’s</a> modernised data platform is our layered architecture, implemented using <strong>dbt (data build tool)</strong>. This framework has been instrumental in defining, transforming, and managing our data models across three distinct layers, inspired by the popular Medallion Architecture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73Gaj9Q3etzhs5dW9VZarg.png" /><figcaption>Data Architecture</figcaption></figure><h4><strong>Bronze Layer(T0 — Raw/Source of Truth):</strong></h4><p>It holds data <strong><em>AS IS</em></strong><em> </em>from its source, preserving the immutable source truth.</p><ul><li><strong>Purpose:</strong> To capture raw, untransformed data. This layer acts as a readily available historical archive, enabling re-runs and reprocessing in case of unexpected failures in downstream pipelines without needing to re-ingest from external sources.</li><li><strong>Key Characteristics:</strong> Minimal transformations applied, primarily focused on schema inference and initial data type conversion. Our platform-defined ingestion standardizations (as mentioned above) are applied here to create a consistent raw foundation.</li></ul><h4><strong>Silver Layer (T1 — Curated &amp; Conformed):</strong></h4><p>The Silver layer is where <strong>medium to complex transformations</strong> are applied to the Bronze layer tables. This layer focuses on <strong>data cleansing, enrichment, and conforming data from various sources into a unified, business-friendly structure</strong>.</p><ul><li><strong>Purpose:</strong> To build curated, highly usable, and often<strong> denormalized record-level data </strong>tailored for specific business cases. This layer integrates data from multiple Bronze tables, resolves discrepancies, and applies business rules.</li><li><strong>Key Characteristics:</strong> Data quality checks, deduplication, joining related entities, and initial feature engineering for analytical purposes. The Silver layer is designed to be highly reusable for various analytical and operational needs.</li></ul><h4>Gold Layer (T2 — Aggregated &amp; Domain-Specific) :</h4><p>The Gold layer represents the <strong>highly curated, aggregated, and business-domain-specific data</strong>. This is the layer primarily exposed to business users and tools for direct consumption.</p><ul><li><strong>Purpose:</strong> To provide readily consumable, <strong>day-level metric data and key performance indicators (KPIs) for each business domain</strong>. This layer is optimised for fast querying and easy integration into dashboards and reporting tools, leading to faster decision-making across the organization.</li><li><strong>Key Characteristics:</strong> Aggregations (e.g., <strong>daily sales, weekly bookings</strong>), pre-calculated metrics, and highly denormalised tables optimised for specific reporting requirements. Data in this layer is often <strong>structured to directly power specific dashboards or analytical applications</strong>.</li></ul><p><strong>Metadata, Data Governance, and Security</strong></p><p>Effective management of our data assets goes beyond just layering. <a href="https://www.pelago.com/">Pelago</a> places a strong emphasis on robust <strong>metadata management</strong>, <strong>data governance</strong>, and <strong>data security</strong> to ensure data quality, compliance, and controlled access:</p><ul><li><strong>Metadata Management:</strong> Comprehensive metadata, including <strong>data lineage, schema definitions</strong>, transformation logic, and <strong>business context</strong>, is meticulously captured and maintained.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*Sy5BVexdIOUNwEno4mygeA.png" /></figure><p>This allows us to understand where data comes from, how it’s transformed, and its meaning to the business, crucial for debugging, auditing, and future development. Now finally its powering <strong>NLQ(DataBot)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*bA9GnxI9Jq1sEweA0ZnAYQ.png" /></figure><ul><li><strong>Data Sensitivity Handling:</strong> Data is classified based on its sensitivity (<strong>e.g., PII, financial data</strong>). This classification drives how data is handled throughout its lifecycle, including <strong>encryption, anonymisation, or tokenisation</strong> where necessary.</li><li><strong>Robust Data Governance:</strong> We implement a clear data governance framework that defines roles, responsibilities, and policies for data ownership, quality, and usage. This ensures accountability and consistency across the data platform.</li><li><strong>Coarse-Grained Access Control:</strong> Access to our data assets is managed at a higher level, primarily through <strong>table and view-level permissions</strong>. This ensures that only authorised teams or individuals can access specific datasets relevant to their roles. <strong><em>For instance, financial data might be accessible only to the finance department.</em></strong></li><li><strong>Fine-Grained Access Control:</strong> For highly sensitive data, we implement <strong>row and column-level security</strong>. This allows us to restrict access to specific rows (e.g., only show data for a user’s own region) or columns (e.g., mask personal identifiers like email addresses) even within an accessible table or view, providing granular control and enhancing data privacy.</li></ul><p><strong>Finally</strong>, This robust architecture enables powerful downstream data-dependent applications, providing:</p><ul><li><strong>Enhanced Reporting &amp; Analytics:</strong> Rapidly generated, highly accurate dashboards and reports for business intelligence and performance monitoring.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*NguHypOU3xQsBYHTBYL-QQ.png" /></figure><ul><li><strong>Personalised Customer Experiences:</strong> Data-driven recommendations and tailored offers based on customer behaviour and preferences.</li><li><strong>Optimised Business Operations:</strong> Insights for supply chain management, pricing optimisation, and operational efficiency.</li></ul><p><strong>Powering Next-Generation AI and NLQ Use Cases</strong></p><p>A significant advantage of this <strong>layered architecture is its ability to serve new, cutting-edge AI-powered use cases, including Natural Language Query (NLQ) capabilities</strong>. By structuring data into distinct layers, <a href="https://www.pelago.com/">Pelago’s</a> data platform provides a clean, curated, and easily accessible foundation for advanced analytics and machine learning.</p><ul><li><strong>Machine Learning &amp; AI Initiatives:</strong> The Gold layer, with its highly curated and aggregated data, serves as an ideal source for training and deploying machine learning models, enabling predictive analytics and advanced insights.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*t8VqzJpAdLQI7tqa4Dc--w.png" /></figure><ul><li><strong>Natural Language Query (NLQ) (Databot) :</strong> With standardised and well-defined data in the Silver and Gold layers, business users can leverage NLQ tools to ask questions about data in plain English, eliminating the need for complex SQL queries and accelerating data-driven decision-making. This democratizes data access and empowers a wider range of users to extract valuable insights.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*UaPouOgaWnHFj6S9LIqqxA.png" /></figure><h3>Use Cases &amp; Impact</h3><p>The implementation of this layered architecture has yielded significant improvements across <a href="https://www.pelago.com/">Pelago</a>:</p><ul><li><strong>Dramatic Reduction in Data Refresh Times:</strong> We’ve seen critical dashboard refresh times <strong>reduced from several hours to minutes</strong> (e.g., from <strong>4 hours to 15 minutes (E2E) </strong>for key operational dashboards). This has led to more timely insights and responsive business operations.</li><li><strong>Increased Data Agility and Reliability:</strong> The modular nature of dbt models within each layer allows for faster development, easier maintenance, and more robust error handling. Reprocessing data due to errors is now a streamlined process, minimising downtime.</li><li><strong>Enhanced Business Insights:</strong> Our curated Silver and Gold layers provide a single source of truth for key metrics, eliminating data discrepancies and fostering greater trust in data. This has empowered our analysts, product managers, and business stakeholders to derive deeper, more reliable insights.</li></ul><h3><strong>Conclusion &amp; Advice</strong></h3><p>Building a robust, scalable, and reliable data platform is an ongoing journey. Our experience at <a href="https://www.pelago.com/">Pelago</a> demonstrates the profound impact a well-structured layered data architecture, powered by tools like dbt, can have on an organization’s ability to leverage its data effectively.</p><p>For other <strong>data engineers and architects</strong> embarking on similar transformations, our key takeaways are:</p><ul><li><strong>Embrace Layering:</strong> The Bronze-Silver-Gold approach simplifies data management, improves data quality, and accelerates consumption.</li><li><strong>Invest in Tooling:</strong> Tools like dbt are invaluable for managing complexity, ensuring data governance, and promoting collaboration.</li><li><strong>Standardise Early:</strong> Define and enforce ingestion and transformation standards from the outset to avoid technical debt.</li><li><strong>Focus on Business Value:</strong> Always align your data architecture decisions with the actual business problems you’re trying to solve, whether it’s faster reporting or enabling advanced AI.</li></ul><p>By following these principles, organisations can build data platforms that not only meet today’s analytical needs but are also<strong> future-proof for emerging AI and NLQ-powered use cases</strong>.</p><p><em>Want to connect and talk about data stuff, feel free to follow/connect with me on </em><a href="http://www.linkedin.com/in/kamalakar-b-9ab97923"><em>LinkedIn</em></a>,</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b13ef7dbb628" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event Streaming @ Pelago]]></title>
            <link>https://medium.com/@kamalakarbsg/event-streaming-pelago-3b442e7e245a?source=rss-092ee232dbc5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b442e7e245a</guid>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[realtime-data-streaming]]></category>
            <category><![CDATA[event-streaming]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kamalakar Bejugama]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 06:50:14 GMT</pubDate>
            <atom:updated>2025-03-13T06:50:14.937Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Real-Time Data Processing Pipeline with AWS Lambda, Kafka, Faust, and DynamoDB</strong></p><p><em>This blog post is the first installment in our three-part series exploring how we built and scaled a robust data platform at </em><a href="http://www.pelago.com"><strong><em>www.pelago.com</em></strong></a><em>. Throughout this series, we’ll deep dive into our design principles, data architecture </em>strategies<em>, </em>and efficient data processing pipelines that drive Pelago’s impactful Data Platform.</p><h3>Problem Statement:</h3><p>With the growing scale of traveller interactions At <strong>pelago</strong>, businesses face the challenge of <strong><em>capturing, processing, and analysing massive volumes of event data in real time</em></strong>. Traditional batch-based data pipelines struggle to keep up with dynamic user behaviours, leading to delayed insights, inconsistent user experiences, and missed opportunities for personalisation. <strong><em>A scalable, low-latency event streaming architecture is essential to ensure data integrity, power ML-driven recommendations, and optimize decision-making</em></strong> — all while keeping infrastructure costs in check.</p><h3>Introduction</h3><p>In today’s data-driven world, real-time event processing has become crucial for <strong>businesses that rely on user behaviour analytics, recommendation engines, and machine learning (ML) models</strong>. This article explores, How pelago overcome this problem by following a robust event-driven architecture using AWS Lambda, API Gateway, AWS MSK (Kafka), Faust, ECS, DynamoDB, and Redis for scalable and efficient real-time data processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQ4wyvQJZaTgOOmkv3BvxA.png" /><figcaption>Event Streaming with Realtime Data Processing</figcaption></figure><p><em>Note: As we Prefer To Pick The Tech from Native Tech service of AWS Eco System.</em></p><h3>Architecture Overview</h3><p>The architecture is designed to efficiently capture, process, and store user activity events in real time while adhering to the <strong>Kappa architecture pattern</strong>. This approach ensures flexibility in extending the pipeline while maintaining hot and cold data and a <strong>single source of truth</strong> for clickstream data.</p><h3>1. Event Collection: Lambda with API Gateway (A.k.a Producer)</h3><ul><li>The event ingestion layer consists of <strong>AWS Lambda</strong> integrated with <strong>API Gateway</strong>, responsible for collecting events from mobile and web platforms.</li><li>These events undergo basic <strong>schema validation</strong> and <strong>standardization</strong> before being published to <strong>Kafka Topics</strong>.</li><li>Ensures real-time capture of <strong>user actions</strong> that help recommendation systems <strong>adapt quickly</strong> to user preferences.</li></ul><h3><strong>2. Message Broker: AWS MSK (Kafka)</strong></h3><ul><li><strong>AWS Managed Streaming for Apache Kafka (MSK)</strong> acts as the central message broker, facilitating real-time event handling.</li><li>Events are held in <strong>Main Topics</strong>, while <strong>interim topics</strong> are used for <strong>collating related events</strong> before being considered for <strong>group processing</strong>.</li><li>This approach optimises <strong>I/O operations</strong>, enabling <strong>efficient data streaming</strong> for analytical and recommendation workflows.</li></ul><h3>3. Processing Layer: Faust Agents &amp; Workers on ECS</h3><ul><li>The <strong>Faust framework</strong> running on <strong>AWS ECS</strong> processes incoming Kafka events in real time.</li><li>Each <strong>Kafka topic</strong> is assigned a <strong>dedicated Faust agent</strong>, following a structured event processing flow as per business workflows.</li><li>Events are validated and transformed before being stored in <strong>DynamoDB</strong> for downstream ML applications.</li><li><strong>Cross-device sync management</strong> ensures user experience consistency across multiple devices.</li></ul><h3>4. Storage Layer: DynamoDB as a Real-Time Data Persistent Store</h3><ul><li><strong>DynamoDB</strong> is used to persist processed user activity data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inkROqZRlh0hbievKaGb3w.png" /></figure><ul><li>A <strong>maximum of 30 data points</strong> per user activity category are stored in a <strong>time-recency</strong> order.</li><li>Each data point is associated with a <strong>timestamp</strong>, which helps in adjusting weightage using a <strong>time decay factor</strong> for ML feature processing.</li><li>Data <strong>retention</strong> is managed with a <strong>TTL of 90 days</strong>, ensuring <strong>data sanitisation</strong> and reducing unnecessary storage costs.</li><li><strong>Optimised vertical partitioning</strong> in DynamoDB ensures that read and write costs are minimised by avoiding unnecessary data retrieval.</li></ul><h3><strong>5.</strong> <strong>Warehouse Storage (Redshift)</strong></h3><p>AWS S3 Object storage used as Staging layer before loading event data into AWS Redshift. Here Data is processed in Chunks &amp; Batches to store it S3 (Parquet data file) and with the help of Redshift Copy Utility being loaded to Redshift and made this data efficiently available to Analytic Business Dashboards, Data Science Model trainings</p><h3>6. Caching Layer: Redis for High-Frequency Data Syncing</h3><ul><li><strong>Redis</strong> serves as the <strong>caching layer</strong> for <strong>frequently changing business rules</strong> and <strong>lively tiny data exchanges</strong>.</li><li>This ensures fast access to dynamic data and minimises latency for critical workflows.</li></ul><h3>Scalability and Optimisation</h3><ul><li>The architecture is designed to <strong>scale efficiently</strong> with increasing data volume.</li><li>Ensures <strong>minimum read/write costs</strong> by optimizing data storage strategies, such as <strong>vertical partitioning in DynamoDB</strong>.</li><li>Supports <strong>analytical workflows</strong>, ensuring that data is utilised by <strong>recommendation engines</strong> and other systems to enhance user experience.</li></ul><h3>Conclusion</h3><p>This event-driven architecture efficiently handles real-time data ingestion, processing, and storage for ML applications. By leveraging <strong>AWS MSK, Faust App on ECS, and DynamoDB</strong>, businesses can build scalable, high-performance event pipelines that support advanced analytics and machine learning models.</p><p>If you’re planning to implement a similar architecture, consider optimising Kafka topic partitioning, tuning Faust worker concurrency, and using Redis for fine-grained caching.</p><p>Stay tuned for the upcoming parts of this series, where we’ll further explore the intricacies of our data platform. In <strong>Part 2</strong>, we’ll examine our <strong>data architecture</strong> in greater detail, while <strong>Part 3 </strong>will focus on <strong>Impactful Product &amp; Business Decisions</strong> while we continue to build and enhance on the data-driven culture at<strong><em> </em></strong><a href="http://www.pelago.com"><strong><em>www.pelago.com</em></strong></a></p><blockquote><em>“</em><strong><em>In the world of data, clarity turns noise into insight.</em></strong><em>”</em></blockquote><p>Follow us to learn more…. !!!.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b442e7e245a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>