News for hackers. Stuff that matters.
Re:DuckDB over Pandas/Polars by nomilk on Tuesday November 05, 2024 @09:10PM (#42056796)
Where does your data reside, is it on an attached EBS volume, or in S3, or somewhere else?

I had some spare time and tinkered with duckdb with a 70GB dataset, but just getting the 70GB on to the EC2 took hours. Would be pretty rocking if duckdb team could somehow set up a ~1TB sized demo that anyone can setup and try for themselves in, say, under an hour.

Re:DuckDB over Pandas/Polars by DiscreteTom on Tuesday November 05, 2024 @09:29PM (#42056865)
I tried to spread large dataset into thousands of files on S3 and use StepFunctions Distributed Map to launch thousands of Lambda instances to process those files in parallel, using DuckDB (or other libs) in Lambda. The parallel loading and processing is way faster than doing this in a single big EC2 instance.
Re:DuckDB over Pandas/Polars by ramraj07 on Tuesday November 05, 2024 @09:57PM (#42056963)
Lambda isn’t infinitely parallel. I thought it doesn’t do more than 100 parallel runners? I4i.metal has 96 cores and can be faster than that.
Re:DuckDB over Pandas/Polars by DiscreteTom on Wednesday November 06, 2024 @09:56PM (#42072882)
As per AWS said in https://aws.amazon.com/cn/blogs/aws/aws-lambda-functions-now...

> Each synchronously invoked Lambda function now scales by 1,000 concurrent executions every 10 seconds.

Re:DuckDB over Pandas/Polars by ramraj07 on Tuesday November 05, 2024 @09:55PM (#42056959)
Local drives. DONT USE EBS! you’ll incur a huge IO charge. You have to choose instances with attached nvme storage which means one of the storage optimized instances.

Reading the data off s3 will mean you will be slower than offerings like snowflake. Snowflake has optimized the crap out of doing analytics in s3, so you can’t beat it with something as simple as duckdb.

Importantly you need the data in some distributed format like parquet or split csv. Otherwise duckdb can’t read it in parallel.

Re:DuckDB over Pandas/Polars by wenc on Tuesday November 05, 2024 @11:01PM (#42057127)
Also, I learned that Hive-partitioned Parquet on S3 is much slower than on disk.

S3 is high latency unless you use for S3 Express Zones (the low latency version).

We used EFS (not EBS) and it was much faster.

Re:DuckDB over Pandas/Polars by ramraj07 on Tuesday November 05, 2024 @11:10PM (#42057156)
Test out the nvme drives though. It’s blazing.
Re:DuckDB over Pandas/Polars by szarnyasg on Wednesday November 06, 2024 @10:30AM (#42063813)
Hi – DuckDB Labs devrel here. It's great that you find DuckDB useful!

On the setup side, I agree that local (instance-attached) disks should be preferred but does EBS incur an IO fee? It incurs a significant latency for sure but it doesn't have a per-operation pricing:

> I/O is included in the price of the volumes, so you pay only for each GB of storage you provision.

(https://aws.amazon.com/ebs/pricing/)

Re:DuckDB over Pandas/Polars by ramraj07 on Sunday November 10, 2024 @01:21AM (#42098785)
Can’t remember anymore, but it’s either (a) the gp2 volumes were way too slow for the ops or (b) the IOPs charges made it bad. To be clear I didn’t do it on duckdb but hosted a Postgres. I moved to light sail instead and was happy with it (you don’t get attached SSD in ec2 until you go to instances that are super large).
Re:DuckDB over Pandas/Polars by signal11 on Tuesday November 05, 2024 @09:32PM (#42056870)
I’ve tried reading streamed parquet via PyArrow with Duck, and it’s been pretty promising. Depending on the query, you won’t need to download everything off HTTP.
Re:DuckDB over Pandas/Polars by swasheck on Tuesday November 05, 2024 @09:50PM (#42056935)
we use partitioned parquet files in s3. we use a csv in the bucket root to track the files. i’m sure there’s a better way but for now the 2tb of data are stored cheaply and we get fast reads by only reading the partitions we need to read.
Re:DuckDB over Pandas/Polars by Incipient on Tuesday November 05, 2024 @11:34PM (#42057222)
I'm curious how much simpler to build, manage, and run vs cost it would be to simply running a database on a large vultr/DO instance and paying for 2tb of storage?

I feel like you'd get away with the whole thing for around $500/mo depending on how much compute was needed?

Re:DuckDB over Pandas/Polars by ramraj07 on Wednesday November 06, 2024 @02:38AM (#42057873)
You just need to try it once to see the issue. Merely loading this amount of data onto a Postgres db will be hell.
Re:DuckDB over Pandas/Polars by swasheck on Wednesday November 06, 2024 @11:22AM (#42064639)
well that's not the infrastructure we have. we are primarily an aws shop so we use the resources available to us in the context of our infrastructure decisions. it would be a hard sell to buy something outside of that ecosystem.
Re:DuckDB over Pandas/Polars by Incipient on Friday November 08, 2024 @06:57PM (#42091427)
I understand that's the infrastructure you have. But that's more describing vendor lock-in haha.

Most of my work is with clients that don't have any set infrastructure yet, so was curious if anyone had any anecdotes.