<?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 Marco Andrade Nogueira on Medium]]></title>
        <description><![CDATA[Stories by Marco Andrade Nogueira on Medium]]></description>
        <link>https://medium.com/@marcaoandradenogueira?source=rss-e70a755800a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6UvztWU_UwD5t3LNK0sQ6A.png</url>
            <title>Stories by Marco Andrade Nogueira on Medium</title>
            <link>https://medium.com/@marcaoandradenogueira?source=rss-e70a755800a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 03:28:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcaoandradenogueira/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[Serverless Lakehouse with DuckDB, Polars, and Delta-rs on AWS]]></title>
            <link>https://medium.com/@marcaoandradenogueira/serverless-lakehouse-with-duckdb-polars-and-delta-rs-on-aws-a38d0864fbef?source=rss-e70a755800a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a38d0864fbef</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[dev]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Marco Andrade Nogueira]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 17:55:26 GMT</pubDate>
            <atom:updated>2024-11-22T01:11:04.609Z</atom:updated>
            <content:encoded><![CDATA[<h4>Simplify Your Lakehouse: Achieve a Fast, Managed, and Cost-effective Environment Without Needing Spark</h4><p>Throughout my career, I’ve seen many data projects that start with the promise of delivering fast and deep insights but end up becoming heavy, costly, and complex. Tools like Spark are great, but they require a robust and complex infrastructure, along with high operational costs (setting up a cluster to run Spark is not a fun task, haha), especially if you are only processing small to medium amounts of data (up to 10GB). As a result, many data professionals find themselves trapped in complex and expensive architectures that require constant maintenance.</p><h3><strong>No more sledgehammer to crack a nut</strong></h3><p>You’ve probably found yourself in this situation: setting up clusters, scaling servers, and struggling to maintain a solution that was supposed to be “simple.” By the end of the day, you realize you’ve spent more time managing infrastructure than actually extracting value from your data. The pressure for agility and results is constant, and you feel like you’re using a sledgehammer to crack a nut.</p><h3>An Efficient Approach: Implementing a Cost-effective, Fast, and Managed Lakehouse</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*3IEKklRqYCJNMHRe" /><figcaption>Image I created with ChatGPT to serve as the project logo, meant to be a fusion of the main engines of the project: DuckDB, Polars, and Delta-rs (Rust).</figcaption></figure><p>With this in mind, I propose this architecture for those who seek more agility, less bureaucracy, and more control over their data. The serverless lakehouse architecture with DuckDB, Polars, and Delta-rs puts the power of an efficient lakehouse in your hands, allowing you to:</p><ul><li><strong>Focus on Data, Not Infrastructure:</strong> With no clusters to manage, you can concentrate on what truly matters — turning data into value.</li><li><strong>Access Quick Results:</strong> By leveraging modern technologies like DuckDB and Polars, we can achieve the same efficiency and speed as Spark, enabling complex analyses to be conducted at a better cost-benefit ratio.</li><li><strong>Reduce Costs and Gain Scalability:</strong> The best part is that you only pay for what you use, without the need for Spark cluster warm-ups.</li></ul><h3><strong>Under the Hood</strong></h3><p>So, what’s under the hood? What are we using to make all this happen? We’re utilizing DuckDB, Polars, and Delta-rs — modern technologies that use Rust and C++ to be fast and lightweight. Here’s a summary:</p><ul><li><strong>DuckDB</strong> is a lightweight, embedded analytical database, ideal for processing large volumes of data locally without the need for complex clusters.</li><li><strong>Polars</strong> is an extremely fast data processing library written in Rust, designed to work efficiently with large in-memory datasets.</li><li><strong>Delta-rs</strong> is a storage layer for data lakes that allows for ACID operations and data versioning, ensuring consistency and integrity in large volumes of data.</li><li><strong>Briefer</strong> is a collaborative data platform that allows users to create interactive notebooks, query databases using SQL and Python, and build dashboards. It facilitates task automation and the creation of dynamic reports.</li></ul><h3>Architecture and Implementation</h3><p>Now that you understand the benefits of this architecture, how does it work?</p><p>We’ll use a medallion architecture, as it is a well-established and widely adopted approach, separating the layers into bronze, silver, and gold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6MDRXMqD0knZMea_ST2JA.png" /></figure><p>Implementing it is easy. First, you need to define your tables and their primary keys for upserts in the artifacts/tables.yaml file. If the primary key is not provided, the transformation steps will occur in append-only mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*K4vCioOJ9P6rzIIm" /></figure><p>Once this configuration is set, we’re ready to deploy our architecture to the cloud. We will use CDK as our infrastructure-as-code library. You can find the step-by-step instructions for installing, configuring, and deploying CDK in the <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/README.md">README of the project</a>.</p><p>After deploying all these artifacts to the cloud, two endpoints will be generated: one for data ingestion and another for querying. Let’s start with the ingestion.</p><p>These endpoints are protected by IAM (here&#39;s a post on how to authenticate and make requests using Postman, available <a href="https://medium.com/@dimuthuarangala/securing-lambda-function-url-using-iam-authentication-5ccbc7c839ab">here</a> and <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-invocation-basics">here</a>).</p><p>At this endpoint, we can insert data into the tables defined in the YAML. We first check if the table is defined in the YAML and whether the declared primary keys are present in the body. If everything is correct, the data is sent, and a Firehose is created for each table, acting as a buffer to process multiple records at once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h2WFP2TnvkvbXSqt2n_-PA.png" /><figcaption>O código da etapa de ingestão pode ser encontrado <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_ingestion/main.py">aqui</a>.</figcaption></figure><p>After accumulating 128MB or 15 minutes, the data is sent to the bronze layer of our lakehouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PYxLVMbgkjYx3xHr" /></figure><p>When the object arrives at the lakehouse, an event is triggered for the Lambda responsible for creating the delta tables, schema evolution, and the append/upsert of the data using Polars and Delta-rs. The flow is as follows:</p><p>Check if the table exists and whether any columns need to be added to the schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*-VARsD3hX7NeRpchZTWXsQ.png" /></figure><p>Determine whether to perform an upsert based on the primary keys and the data ingestion timestamp, or if records should be added in append-only mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*0GZjyH94yZTAZvVNK1H9Iw.png" /></figure><p>At the end of this stage, the data is already consumable in the silver layer in Delta format. To process a 1.5GB dataset of New York taxis in JSON format, the average processing time was between 18 and 21 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*30lZ0HpWHkiQdRjQ" /><figcaption>You can find the transformation code <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_processing/main.py">here</a>.</figcaption></figure><p>For the Gold layer, the idea is that we shouldn’t have to manage any servers so that it doesn’t become prohibitive for small and medium-sized companies. Therefore, we will set aside Airflow or another orchestrator and use AWS EventBridge instead. However, you can and should adapt your architecture with an orchestrator if you have that possibility.</p><p>So, in the Gold layer, you just need to place your queries with the business rules along with a cron, and behind the scenes, a query will be executed with DuckDB and Delta-rs on the data, which will be saved according to the defined period in the Gold layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z6GfmikDB3UAlcFc5ojVFQ.png" /></figure><p>Finally, we need to consume this data. Here, you can use the other endpoint that was generated; the idea is that you can query your data across all layers using DuckDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFtJ0WJm27DORMsP_oePiA.png" /><figcaption>O código da camada de consumo está <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_consumption/main.py">aqui</a></figcaption></figure><p>But it’s pointless to have all this if we can’t build that beautiful dashboard to show to your stakeholders, right?! For the visualization part, I decided to use Briefer, which already has an integration with DuckDB.</p><p>To run Briefer, I ran it locally using this command, and it’s necessary to create a volume for the AWS credentials (I couldn’t configure it with Briefer’s native environment variables).</p><blockquote>docker run -d \ -p 3000:3000 \ <br>-v ~/.aws:/root/.aws \<br>-v briefer_psql_data:/var/lib/postgresql/data \<br>-v briefer_jupyter_data:/home/jupyteruser \<br>-v briefer_briefer_data:/home/briefer \<br>briefercloud/briefer</blockquote><p>So, you just need to create a DuckDB secret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGBXAhqJvL2fJjc4gAU3Vw.png" /></figure><p>And you can already create your visualizations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sd7sAy8Tze7-dm-H8NUy7g.png" /></figure><h3>Next Steps and Drawbacks (Not Everything is Perfect 😕)</h3><p>For the next steps, I thought of some improvements:</p><ul><li>For the Gold layer, I would like to use <a href="https://medium.com/r?url=https%3A%2F%2Fgithub.com%2Fduckdb%2Fdbt-duckdb">dbt-duckdb</a>.</li><li>Deploy Briefer on ECS to prepare the entire architecture for production.</li><li>The created endpoints are public, random, and secured by IAM roles. In the future, I will create custom and private endpoints using API Gateway or CloudFront along with Route 53.</li><li>Perhaps integrate some AI layer since everything seems to require AI these days haha.</li></ul><p>Speaking a bit about the downsides and challenges I encountered in this project, I was unable to integrate Delta with Athena and the Glue Catalog.</p><p>With Glue, I received a generic error and couldn’t proceed: ‘Crawler Error: Internal Service Exception,’ and for Athena, I got the error that the Delta version is incompatible: ‘Delta protocol version is too new for Athena DDL engine,’ even though the version described in the metadata is compatible with Athena according to the <a href="https://docs.aws.amazon.com/athena/latest/ug/delta-lake-tables.html">documentation</a> ¯_(ツ)_/¯.</p><p>I am trying to get in touch with someone from AWS to resolve this, and as soon as I have updates, I will improve this article.</p><h3>Conclusion: Transforming Your Architecture</h3><p>This Serverless Lakehouse architecture has numerous benefits; it is efficient, fast, and during development, I also noticed that it is cost-effective (I couldn’t even reach the Free Tier limit; the total development cost was $0.23).</p><p>For me, this architecture is not just a modern solution; it represents a mindset shift that puts you in control, empowering you to achieve results without compromising your time, budget, or sanity.</p><p>So, I invite you to say goodbye to complex and heavy solutions and welcome a lightweight, efficient, and future-ready lakehouse.<strong>References:</strong></p><ul><li>DuckDB: <a href="https://github.com/duckdb/duckdb">https://github.com/duckdb/duckdb</a></li><li>Polars: <a href="https://github.com/pola-rs/polars">https://github.com/pola-rs/polars</a></li><li>Delta-rs: <a href="https://github.com/delta-io/delta-rs">https://github.com/delta-io/delta-rs</a></li><li>DuckDB on Lambda: <a href="https://medium.com/@kkyon/profile-a-data-lake-built-with-aws-lambda-and-duckdb-2fc810ff9f4d">https://medium.com/@kkyon/profile-a-data-lake-built-with-aws-lambda-and-duckdb-2fc810ff9f4d</a></li><li>Delta Rs on Lambda: <a href="https://delta.io/blog/2023-04-06-deltalake-aws-lambda-wrangler-pandas/">https://delta.io/blog/2023-04-06-deltalake-aws-lambda-wrangler-pandas/</a></li><li>Briefer: <a href="https://briefer.cloud/">https://briefer.cloud/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a38d0864fbef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless lakehouse com DuckDB, Polars e Delta-rs na AWS]]></title>
            <link>https://medium.com/@marcaoandradenogueira/serverless-lakehouse-com-duckdb-polars-e-delta-rs-na-aws-26e54c37c061?source=rss-e70a755800a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/26e54c37c061</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Marco Andrade Nogueira]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 17:54:43 GMT</pubDate>
            <atom:updated>2024-10-10T18:22:47.001Z</atom:updated>
            <content:encoded><![CDATA[<h4>Descomplique seu Lakehouse: Tenha um ambiente rápido, gerenciado e econômico sem precisar do Spark</h4><p>Durante a minha carreira eu tenho visto muitos projetos de dados que começam com a promessa de fornecer insights rápidos e profundos, mas acabam se tornando pesados, caros e complexos. Ferramentas como o Spark são ótimas, mas exigem uma infraestrutura complexa e robusta, além de um alto custo operacional (Configurar um cluster para rodar Spark não é uma tarefa divertida hahaha), especialmente se você está apenas processando quantidades pequenas/médias de dados. Como resultado, muitos profissionais de dados se veem presos em arquiteturas complexas e caras, que exigem manutenção constante.</p><h3>Chega de bazucas para caçar formiga</h3><p>Você provavelmente já esteve nessa situação: configurando clusters, escalando servidores e lutando para manter uma solução que deveria ser “simples”. E ao final do dia, você percebe que gastou mais tempo gerenciando infraestrutura do que realmente extraindo valor dos dados. A pressão por agilidade e resultados é constante, e você se sente como se estivesse usando uma bazuca para matar uma mosca.</p><h3>Uma abordagem eficiente: Implementando um Lakehouse barato, rápido e gerenciado</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*3IEKklRqYCJNMHRe" /><figcaption>imagem que fiz com o ChatGPT para ser o logo do projeto, a idéia é ser uma fusão das principais bibliotecas do projeto: DuckDB, Polars e Delta-rs(Rust)</figcaption></figure><p>Pensando nisso, propus essa arquitetura para você que quer mais agilidade, menos burocracia e mais controle sobre os dados. A arquitetura serverless lakehouse com DuckDB, Polars e Delta-RS coloca o poder de um lakehouse eficiente nas suas mãos, permitindo que você:</p><ul><li><strong>Concentre-se nos Dados, Não na Infraestrutura</strong>: Sem clusters para gerenciar, você pode focar no que realmente importa — transformar dados em valor.</li><li><strong>Acesse Resultados Rápidos</strong>: Utilizando tecnologias modernas como o DuckDb e Polars, podemos ter a mesma eficiência e velocidade do Spark, possibilitando que análises complexas sejam feitas com o melhor custo beneficio.</li><li><strong>Reduza Custos e Ganhe Escalabilidade</strong>: O mais legal aqui é que você paga apenas quando utilizar e sem warm ups de cluster Spark</li></ul><h3>Debaixo do capô</h3><p>Tá, mas o que está de baixo do capô, o que estamos usando para fazer tudo isso?! Estamos utilizando DuckDb, Polars e Delta-rs tecnologias modernas que utilizam Rust e C++ com o intuito de serem rápidas e leves, aqui vai um resumo:</p><p><strong>DuckDB</strong> é um banco de dados analítico leve e embutido, ideal para processar grandes volumes de dados localmente, sem a necessidade de clusters complexos.</p><p><strong>Polars</strong> é uma biblioteca de processamento de dados extremamente rápida, escrita em Rust, projetada para trabalhar com grandes datasets em memória de forma eficiente.</p><p><strong>Delta-rs</strong> é uma camada de armazenamento para Data Lakes, permitindo operações ACID e versionamento de dados, garantindo consistência e integridade em grandes volumes de dados.</p><p><strong>Briefer</strong> é uma plataforma colaborativa de dados que permite criar notebooks interativos, consultar bancos de dados com SQL e Python, e construir dashboards. Ele facilita a automação de tarefas e a criação de relatórios dinâmicos</p><h3>Arquitetura e como implementar</h3><p>Ok, acredito que agora você tenha entendido os benefícios dessa arquitetura, mas como funciona?</p><p>Vamos utilizar uma arquitetura medalhão, já que é uma arquitetura consolidada e bem difundida, separando as camadas em bronze, silver e gold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zfDAqIDrA6y9SXpG" /></figure><p>Para implementar é fácil, primeiro você deve definir quais são as tabelas e suas primarys keys para upsert no arquivo artifacts/tables.yaml, caso a primary key não seja fornecida as etapas de trasnformação ocorrerá no modo append only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*K4vCioOJ9P6rzIIm" /></figure><p>Após essa configuração estamos prontos para subir nossa arquitetura para nuvem, vamos utilizar o CDK como biblioteca de infraestrutura como código, o passo a passo de como instalar, configurar e subir o CDK está aqui no <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/README.md">README</a> do projeto</p><p>Após subirmos todos esses artefatos para a nuvem, vai ser gerado dois endpoints, um para a ingestão de dados e outro para a consulta, vamos começar pela ingestão.</p><p>Esses endpoints são protegidos por IAM (aqui um post de como autenticar e fazer requisições através do Postman <a href="https://medium.com/@dimuthuarangala/securing-lambda-function-url-using-iam-authentication-5ccbc7c839ab">aqui</a> e <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-invocation-basics">aqui</a>)</p><p>Nesse endpoint, conseguimos inserir os dados para as tabelas que definimos no YAML, então é feita a checagem se a tabela foi definida no YAML e se as primary keys declaradas estão presentes no body, caso esteja tudo certo o dado é enviado e para cada tabela é criado um Firehose que serve como Buffer para que consigamos processar vários registros de uma vez.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h2WFP2TnvkvbXSqt2n_-PA.png" /><figcaption>O código da etapa de ingestão pode ser encontrado <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_ingestion/main.py">aqui</a>.</figcaption></figure><p>Após acumular 128MB ou passar 15 minutos os dados são enviados para a camada bronze do nosso lakehouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PYxLVMbgkjYx3xHr" /></figure><p>Quando o objeto chega no lakehouse um evento é disparado para o Lambda responsável por fazer a criação das delta tables, evolução de schema e o append/upsert dos dados utilizando Polars e Delta-rs, o fluxo é o seguinte:</p><p>Primeiro é feito a checagem se a tabela existe e se é necessário adicionar colunas no schema</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NeqojM30f3cC9QHR" /></figure><p>Então é feito a verificação se é para fazer o upsert na tabela baseado nas primary_keys e o timestamp da ingestão dos dados ou então se é para fazer a adição dos registro no modo append only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/0*rSsGSRfAsp4AbjR8" /></figure><p>Ao final dessa etapa os dados já são consumíveis na camada silver no formato Delta, para processar um dataset de <a href="https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page">Taxis de Nova York</a> de 1.5GB no formato JSON o tempo médio de processamento foi entre 18–21 segundos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*30lZ0HpWHkiQdRjQ" /><figcaption>O código da etapa de transformação pode ser encontrado aqui<a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_processing/main.py"> https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_processing/main.py</a></figcaption></figure><p>Para a camada Gold o pensamento é de que não tenhamos que gerenciar nenhum servidor para que não seja proibitivo para pequenas e médias empresas, por isso vamos deixar o Airflow ou outro orquestrador de lado e utilizar o EventBridge da AWS, mas você pode e deve adaptar a sua arquitetura com algum orquestrador caso tenha essa possibilidade.</p><p>Então na camada Gold, basta colocar suas querys com a regra de negócio junto a um cron e por debaixo dos panos vai ser executado uma Query com Duckdb e Delta-rs nos dados que será salva no período definido na camada Gold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z6GfmikDB3UAlcFc5ojVFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_B0_ZcE1EbhqiTy0pU7uA.png" /></figure><p>Por fim precisamos consumir esses dados, aqui você pode utilizar o outro endpoint que foi gerado, a idéia é que você consiga consultar seus dados em todas as camadas utilizando DuckDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFtJ0WJm27DORMsP_oePiA.png" /><figcaption>O código da camada de consumo está <a href="https://github.com/marcoaanogueira/serverless_data_lake/blob/main/lambdas/serverless_consumption/main.py">aqui</a></figcaption></figure><p>Mas não adianta de nada termos tudo isso se não conseguirmos construir aquele dashboard bonito para mostrarmos pros seus stakeholders né?!</p><p>Para a parte de visualização decidi utilizar o Briefer que já tem uma integração com o Duckdb, para rodar o Briefer rodei localmente utilizando esse comando, é preciso criar um volume para as credenciais da AWS (não consegui configurar com a parte de variáveis de ambiente nativa do Briefer)</p><blockquote>docker run -d \<br> -p 3000:3000 \<br> -v ~/.aws:/root/.aws \<br> -v briefer_psql_data:/var/lib/postgresql/data \<br> -v briefer_jupyter_data:/home/jupyteruser \<br> -v briefer_briefer_data:/home/briefer \<br> briefercloud/briefer<br>a4dcaa622c3d8128c9cc6af0b02298bb9796776b67c764aec63660ff8ad955c2</blockquote><p>Então basta criar um secret do DuckDB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGBXAhqJvL2fJjc4gAU3Vw.png" /></figure><p>Então você já consegue criar seus dashboards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sd7sAy8Tze7-dm-H8NUy7g.png" /></figure><h3>Próximos passos e contras (Nem tudo são flores 😕)</h3><p>Para os próximos passos pensei em algumas melhorias:</p><ul><li>Para a parte da camada Gold eu gostaria de utilizar o <a href="https://github.com/duckdb/dbt-duckdb">dbt-duckdb</a>.</li><li>Colocar o metabase no ECS para que toda a arquitetura esteja pronta para produção.</li><li>Os endpoints criados são públicos, aleatórios e assegurados por roles IAM, no futuro irei criar endpoints customizados e privados com API gateway ou Cloudfront junto com o Route53</li><li>Talvez integrar alguma camada de IA, já que atualmente tudo parece exigir IA hahaha</li></ul><p>Falando um pouco dos contras e desafios que encontrei nesse projeto, não consegui integrar o Delta com o Athena e o Glue Catalog, também tive dificuldades de consumir diversas tabelas simultaneamente com o Metabase.</p><p>Com o Glue eu recebi um erro genérico e não consegui avançar “Crawler Error: Internal Service Exception” e para o Athena eu recebi o erro de que a versão do Delta não é compatível “”Delta protocol version is too new for Athena DDL engine” apesar da versão que está descrita dos metadados ser compatível com o Athena de Acordo com a documentação ¯\_(ツ)_/¯.</p><p>Estou tentando contato com alguém da AWS para arrumar isso, assim que tiver atualizações melhoro esse artigo.</p><p>Outro ponto é que tentei utilizar o driver do Metabase para o DuckDB, mas não é possível consumir duas tabelas Delta simultaneamente da o erro &quot;TransactionContext Error: Catalog write-write conflict on create with “__default_s3”.</p><h3>Conclusão — Transformando sua arquitetura</h3><p>Essa arquitetura Lahouse Serverless tem vários benefícios, é eficiente, rápida e durante o desenvolvimento pude notar também que é barata (Não consegui nem atingir o limite do Free Tier o custo total do desenvolvimento ficou em $0.23 dólares)</p><p>Para mim essa arquitetura não é só uma solução moderna; é uma mudança de mentalidade, que coloca você no controle, empoderando você para alcançar resultados sem comprometer tempo, orçamento ou sanidade.</p><p>Então eu te convido a dizer adeus às soluções complexas e pesadas e dê as boas-vindas a um lakehouse leve, eficiente e preparado para o futuro.</p><h3>Referências:</h3><ul><li>Duckdb:<a href="https://github.com/duckdb/duckdb"> https://github.com/duckdb/duckdb</a></li><li>Polars:<a href="https://github.com/pola-rs/polars"> https://github.com/pola-rs/polars</a></li><li>Delta-rs:<a href="https://github.com/delta-io/delta-rs">https://github.com/delta-io/delta-rs</a></li><li>Metabase Duckdb Driver:<a href="https://github.com/MotherDuck-Open-Source/metabase_duckdb_driver"> https://github.com/MotherDuck-Open-Source/metabase_duckdb_driver</a></li><li>DuckDb on Lambda:<a href="https://medium.com/@kkyon/profile-a-data-lake-built-with-aws-lambda-and-duckdb-2fc810ff9f4d"> https://medium.com/@kkyon/profile-a-data-lake-built-with-aws-lambda-and-duckdb-2fc810ff9f4d</a></li><li>Delta Rs on Lambda:<a href="https://delta.io/blog/2023-04-06-deltalake-aws-lambda-wrangler-pandas/"> https://delta.io/blog/2023-04-06-deltalake-aws-lambda-wrangler-pandas/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26e54c37c061" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>