Skip Navigation

Data Engineering

Members
0
Posts
37
Created
3 yr. ago

Why does my graph plot look incorrect?

Hello, I have a question - I have differences calculated between game genres. The difference is a positive float number, the bigger the number, the greater the difference there is between the two genres. I want to visualise differences and I have the following code:

 
import json
import networkx as nx
import matplotlib.pyplot as plt

with open('genres_weights.json', 'r') as file:
    data = json.load(file)

G = nx.Graph()
max_diff = max(item['difference'] for item in data) if data else 1.0

for item in data:
    node1, node2 = item['weightsPair']
    difference = item['difference']
    weight = item['difference'] + 0.25

    G.add_edge(node1, node2, weight=weight, original_diff=difference)

plt.figure(figsize=(40, 20))
pos = nx.kamada_kawai_layout(G, weight='weight')

nx.draw_networkx_nodes(G, pos, node_size=2000, node_color='#2b83ba', alpha=0.9)

nx.draw_networkx_labels(G, pos, font_size=7, font_family='sans-serif')

plt.show()

that gives the following result for my data: image A lot of things look great, and overall graph represents data correctly (I guess). But there is the thing - in the bottom left part of the graph there are two bubbles: "immersive sim" and "rhythm". Those two genres appear to be very similar (as some other pairs of games that are very similar and have a very low number for difference), but in reality, they are not - they have a difference of 9, which is a lot (the maximum difference between genres is around 14), so I expect them to be on the different side of the graph and not nearly together. I'm not sure where the problem is. Can someone please help me?

Are there best practices for time series database designs?

I am creating a couple of bigger database tables with at least hundreds of millions of observations, but growing. Some tables are by minute, some by milliseconds. timestamps are not necessarily unique.

Should I create separate year, month, or date and time columns? Is one unique datetime column enough? At what size would you partition the tables?

Raw data is in csv.

Currently I aim for postgres and duckdb. Does timescaledb make a significant difference?

Building a real-time data pipeline - Technical article and GitHub repo

If you're a Data Engineer, before long you'll be asked to build a real-time pipeline.

In my latest article, I build a real-time pipeline using Kafka, Polars and Delta tables to demonstrate how these can work together. Everything is available to try yourself in the associated GitHub repo. So if you're curious, take a moment to check out this technical post.

medium.com

Diagrams as Code

How often do you build and edit Entity Relationship Diagrams? If the answer is ‘more often than I’d like’, and you’re fed up with tweaking your diagrams, take <5 minutes to read my latest article on building your diagrams with code. Track their changes in GitHub, have them build as part of your CI/CD pipeline, and even drop them into your dbt docs if you like.

This is a ‘friends and family’ link, so it’ll bypass the usual Medium paywall.

I’m not affiliated to the tool I’ve chosen in any way. Just like how it works.

Let me know yours thoughts!

medium.com

Dremio is offering free pdf copies of "Apache Iceberg: The Definitive Guide: Data Lakehouse Functionality, Performance and Scalability on the Data Lake"

Book Preface:

Welcome to Apache Iceberg: The Definitive Guide! We’re delighted you have embarked on this learning journey with us. In this preface, we provide an overview of this book, why we wrote it, and how you can make the most of it.

About This Book

In these pages, you’ll learn what Apache Iceberg is, why it exists, how it works, and how to harness its power. Designed for data engineers, architects, scientists, and analysts working with large datasets across various use cases from BI dashboards to AI/ML, this book explores the core concepts, inner workings, and practical applications of Apache Iceberg. By the time you reach the end, you will have grasped the essentials and possess the practical knowledge to implement Apache Iceberg effectively in your data projects. Whether you are a newcomer or an experienced practitioner, Apache Iceberg: The Definitive Guide will be your trusted companion on this enlightening journey into Apache Iceberg.

Why We Wrote This Book

As we observed the rapid growth and adoption of the Apache Iceberg ecosystem, it became evident that a growing knowledge gap needed to be addressed. Initially, we began by sharing insights through a series of blog posts on the Dremio platform to provide valuable information to the burgeoning Iceberg community. However, it soon became clear that a comprehensive and centralized resource was essential to meet the increasing demand for a definitive Iceberg reference. This realization was the driving force behind the creation of Apache Iceberg: The Definitive Guide. Our goal is to provide readers with a single authoritative source that bridges the knowledge gap and empowers individuals and organizations to make the most of Apache Iceberg’s capabilities in their data-related endeavors.

What You Will Find Inside

In the following chapters, you will learn what Apache Iceberg is and how it works, how you can take advantage of the format with a variety of tools, and best practices to manage the quality and governance of the data in Apache Iceberg tables. Here is a summary of each chapter’s content: • Chapter 1, “Introduction to Apache Iceberg” Exploration of the historical context of data lakehouses and the essential concepts underlying Apache Iceberg. • Chapter 2, “The Architecture of Apache Iceberg” Deep dive into the intricate design of Apache Iceberg, examining how its various components function together. • Chapter 3, “Lifecycle of Write and Read Queries” Examination of the step-by-step process involved in Apache Iceberg transactions, highlighting updates, reads, and time-travel queries. • Chapter 4, “Optimizing the Performance of Iceberg Tables” Discussions on maintaining optimized performance in Apache Iceberg tables through techniques such as compaction and sorting. • Chapter 5, “Iceberg Catalogs” In-depth explanation of the role of Apache Iceberg catalogs, exploring the different catalog options available. • Chapter 6, “Apache Spark” Practical sessions using Apache Spark to manage and interact with Apache Iceberg tables. • Chapter 7, “Dremio’s SQL Query Engine” Exploration of the Dremio lakehouse platform, focusing on DDL, DML, and table optimization for Apache Iceberg tables. • Chapter 8, “AWS Glue” Demonstration of the use of AWS Glue Catalog and AWS Glue Studio for working with Apache Iceberg tables. • Chapter 9, “Apache Flink” Practical exercises in using Apache Flink for streaming data processing with Apache Iceberg tables. • Chapter 10, “Apache Iceberg in Production” Insights into managing data quality in production, using metadata tables for table health monitoring and employing table and catalog versioning for various operational needs. • Chapter 11, “Streaming with Apache Iceberg” Use of tools such as Apache Spark, Flink, and AWS Glue for streaming data processing into Iceberg tables. • Chapter 12, “Governance and Security” Exploration of the application of governance and security at various levels in Apache Iceberg tables, such as storage, semantic layers, and catalogs. • Chapter 13, “Migrating to Apache Iceberg” Guidelines on transforming existing datasets from different file types and databases into Apache Iceberg tables. • Chapter 14, “Real-World Use Cases of Apache Iceberg” A look at real-world applications of Apache Iceberg, including business intelligence dashboards and implementing change data capture Direct link to PDF Dremio bills itself as a "Unified Analytics Platform for a Self-Service Lakehouse". The authors of the book work for Dremio and may have ownership interest in Dremio.

hello.dremio.com

Data Newbie Looking for Advice

Hello,

I am looking for some advice to help me out at my job. Apologies if this is the wrong place to ask.

So, basically my boss is a complete technophobe and all of our data is stored across multiple excel files in drop box and I'm looking for a way to change that into a centralized database. I know my way around a computer but writing code is not something I have ever been able to grasp well.

The main issue with our situation is that our workers are all completely remote, and no I don't mean work from home in the suburbs from a home office. They use little laptops with no data connection and go out gathering data every day from a variety of locations, sometimes not even cell coverage.

We need up to 20 people entering data all day long and then updating a centralized database at the end of the day when they get back home and have internet connection. It will generally all be new entries, no one will need to be updating old entries.

It would be nice to have some sort of data entry form in drop box and a centralized database on our local server at head office which pulls the data at the end of each day. Field workers would also need access to certain data such as addresses, contact info, maps, photos, historical data, etc. but not all of it. For example the worker in City A only needs access to the historical data from records in and around City A, and workers in City B only need access to records involving City B.

Is there any recommended options for software which can achieve this? It needs to be relatively user friendly and simple as our workers are typically biology oriented summer students, not programmers.

Postgres vs. Pinecone | Lantern Blog | Narek Galstyan | July 18, 2024

July 18, 2024 Narek Galstyan writes:

We were naturally curious when we saw Pinecone's blog post comparing Postgres and Pinecone. In their post on Postgres, Pinecone recognizes that Postgres is easy to start with as a vector database, since most developers are familiar with it. However, they argue that Postgres falls short in terms of quality. They describe issues with index size predictability, index creation resource intensity, metadata filtering performance, and cost. This is a response to Pinecone's blog post, where we show that Postgres outperforms Pinecone in the same benchmarks with a few additional tweaks. We show that with just 20 lines of additional code, Postgres with the pgvector or lantern extension outperforms Pinecone by reaching 90% recall (compared to Pinecone's 60%) with under 200ms p95 latency.

Read Postgres vs. Pinecone

lantern.dev

Why Use Data Build Tools (dbt)

Time and again I see the same questions asked: "Why should I use dbt?" or "I don't understand what value dbt offers". So I thought I'd put together an article that touches on some of the benefits, as well as putting together a step through on setting up a new project (using DuckDB as the database), complete with associated GitHub repo for you to take a look at.

Having used dbt since early 2018, and with my partner being a dbt trainer, I hope that this article is useful for some of you. The link is paywall bypassed.

medium.com

Definite: Comparing Iceberg Query Engines (with Duckdb and Iceberg Full Notebook Example) | Steven Wang | 7/3/2024

7/3/2024 Steven Wang writes:

Many in the data space are now aware of Iceberg and its powerful features that bring database-like functionality to files stored in the likes of S3 or GCS. But Iceberg is just one piece of the puzzle when it comes to transforming files in a data lake into a Lakehouse capable of analytical and ML workloads. Along with Iceberg, which is primarily a table format, a query engine is also required to run queries against the tables and schemas managed by Iceberg. In this post we explore some of the query engines available to those looking to build a data stack around Iceberg: Snowflake, Spark, Trino, and DuckDB.

...

DuckDB + Iceberg Example We will be loading 12 months of NYC yellow cab trip data (April 2023 - April 2024) into Iceberg tables and demonstrating how DuckDB can query these tables.

Read Comparing Iceberg Query Engines

www.definite.app

Database Fundamentals

Posted on 2023-12-15 by Tony Solomonik

About a year ago, I tried thinking which database I should choose for my next project, and came to the realization that I don't really know the differences of databases enough. I went to different database websites and saw mostly marketing and words I don't understand. This is when I decided to read the excellent books Database Internals by Alex Petrov and Designing Data-Intensive Applications by Martin Kleppmann. The books piqued my curiosity enough to write my own little database I called dbeel. This post is basically a short summary of these books, with a focus on the fundamental problems a database engineer thinks about in the shower.

Read Database Fundamentals

tontinton.com

A guide how to adopt an existing Spark scala library for Spark Connect

Let me share my post with a detailed step by step guide how an exisiting Spark scala library may be adopted to work with recently introduced Spark Connect. As an example I have chosen a pupular open source data quality tool AWS Deequ. I made all the necessary protobuf messages and a Spark Connect Plugin. I tested it from PySpark Connect 3.5.1 and it works. Of course, all the code is public in git.

semyonsinchenko.github.io

Building data abstractions with streaming at Yelp

Mar 8, 2024 | Hakampreet Singh Pandher writes:

Yelp relies heavily on streaming to synchronize enormous volumes of data in real time. This is facilitated by Yelp’s underlying data pipeline infrastructure, which manages the real-time flow of millions of messages originating from a plethora of services. This blog post covers how we leverage Yelp’s extensive streaming infrastructure to build robust data abstractions for our offline and streaming data consumers. We will use Yelp’s Business Properties ecosystem (explained in the upcoming sections) as an example.

Read Building data abstractions with streaming at Yelp

engineeringblog.yelp.com