Softwr

Cloud · head to head

AWS Lambda vs DuckDB

AWS Lambda logo

AWS Lambda

Cloud

Run code without thinking about servers

From
Free
Free plan
Yes
DuckDB logo

DuckDB

Databases

MIT-licensed analytical SQL database that runs inside your process, with no server, no dependencies and one writer at a time.

From
Free
Free plan
Yes

The short version

  • AWS Lambda is a serverless compute service.
  • Both are free.
  • Only AWS Lambda lists multiple languages; only DuckDB lists vectorised columnar engine.
  • Where AWS Lambda falls short: provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs.

How do AWS Lambda and DuckDB differ?

AWS Lambda and DuckDB differ on pricing model (Usage-based against Open-source), platforms and category (Cloud against Databases). Only the attributes on which AWS Lambda and DuckDB actually diverge.

Attributes where AWS Lambda and DuckDB differ
AttributeAWS LambdaDuckDB
Pricing modelUsage-basedOpen-source
PlatformsWeb, APILinux, macOS, Windows, Web
CategoryCloudDatabases
Founded20142019

Identical on both: starting price (Free), free tier (Yes).

Which features does each one have?

They share no listed features; 20 appear only for AWS Lambda and 10 only for DuckDB. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in AWS Lambda

  • Function-as-a-Service
  • Event-driven execution
  • Auto-scaling
  • Pay-per-use
  • Multiple languages
  • Concurrency limits
  • Dead Letter Queues
  • Environment variables

Only in DuckDB

  • In-process execution
  • Vectorised columnar engine
  • Direct file querying
  • Zero dependencies
  • Larger-than-memory queries
  • MIT licence
  • Postgres-flavoured SQL
  • Extension ecosystem

What is each one used for?

AWS Lambda is most often brought in for event-driven functions without managing servers. The jobs each tool is most often brought in to do.

AWS Lambda

  • Event-driven functions without managing serversnot DuckDB
  • API backends behind API Gatewaynot DuckDB
  • Processing S3, DynamoDB, SQS and Kinesis eventsnot DuckDB
  • Scheduled jobs without a always-on instancenot DuckDB
  • Edge compute through Lambda@Edgenot DuckDB

DuckDB

  • Transformation steps in a data pipeline that would otherwise need Spark, replaced by SQL over Parquet in a single processnot AWS Lambda
  • Analytical queries embedded in an application or a dashboard where shipping a database server alongside it is not acceptablenot AWS Lambda
  • Local exploration of files that are too large for a pandas dataframe but far too small to justify a warehousenot AWS Lambda
  • Continuous integration and testing of analytical SQL, where a real engine can run in the test process without provisioning anythingnot AWS Lambda

Where do AWS Lambda and DuckDB fall short?

AWS Lambda's most cited limit: ephemeral storage beyond the included 512 MB is metered. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

AWS Lambda

  • Billed on two axes at once, $0.20 per million requests plus $0.0000166667 per GB-second of duration, so memory settings change the bill as much as traffic does
  • Provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs
  • Ephemeral storage beyond the included 512 MB is metered
  • Lambda@Edge costs $0.60 per million requests, three times the standard request rate
  • VPC use and cross-region data transfer carry EC2 charges on top

DuckDB

  • A database file accepts one read-write process at a time; other processes must open it read-only and will not see subsequent writes, so DuckDB cannot be the shared database behind several services
  • There is no network protocol, authentication or user management, so exposing it to remote clients means writing and securing your own service around it
  • It is built for scans and aggregations, not for many small transactions, so a workload of high-frequency single-row inserts and updates performs badly compared with SQLite or Postgres
  • Storage files are backwards compatible but not forwards compatible, so a file written by a newer version cannot be read by an older one and every consumer of a shared file must be upgraded together
  • Query memory settings matter: some operations still need to hold significant state, so an under-configured memory limit turns a large join or a high-cardinality aggregation into a spill-heavy query or an out-of-memory failure rather than a slow success

How much do AWS Lambda and DuckDB cost?

AWS Lambda is free to use; DuckDB is free to use. Plan by plan below, from each vendor's own pricing page.

AWS Lambda

Free
  • Free TierFree
    • 1M free requests/month
    • 400,000 GB-seconds/month
    • Always free

DuckDB

Free
  • Open source (MIT licence)Free

Which should you pick?

Choose AWS Lambda if

  • You need function-as-a-service.
  • You want to start without paying.
  • You work on Web, API.
  • You also want event-driven execution.

Choose DuckDB if

  • You need in-process execution.
  • You want to start without paying.
  • You work on Linux, macOS, Windows, Web.
  • You also want vectorised columnar engine.

Questions people ask

Is AWS Lambda or DuckDB better?
It depends on the job. AWS Lambda fits event-driven functions without managing servers; DuckDB fits transformation steps in a data pipeline that would otherwise need Spark, replaced by SQL over Parquet in a single process. AWS Lambda starts at Free and DuckDB at Free.
Which is cheaper, AWS Lambda or DuckDB?
AWS Lambda starts at Free and DuckDB at Free.
Does AWS Lambda or DuckDB run on more platforms?
AWS Lambda runs on Web, API. DuckDB runs on Linux, macOS, Windows, Web.
Can I use AWS Lambda for free?
Both have a free tier, so you can try either at no cost before committing.
What is AWS Lambda best used for?
AWS Lambda is most often used for event-driven functions without managing servers, api backends behind api gateway, processing s3, dynamodb, sqs and kinesis events, scheduled jobs without a always-on instance. Of those, event-driven functions without managing servers and api backends behind api gateway are not what DuckDB is typically brought in for.
What can AWS Lambda do that DuckDB cannot?
AWS Lambda covers Function-as-a-Service, Event-driven execution, Auto-scaling, Pay-per-use. DuckDB covers In-process execution, Vectorised columnar engine, Direct file querying, Zero dependencies.

Answered from the vendors’ own pages

AWS Lambda: Is there a free tier for AWS Lambda?

Yes. AWS Lambda offers a free tier including 1 million requests per month, 400,000 GB-seconds per month, and 100 GB monthly response streaming.

Source
DuckDB: Can multiple applications share one DuckDB database?

Not for writing. One process holds the database read-write; others may attach read-only and will not see later writes. Shared multi-writer access needs a different database or a table format with a catalogue.

AWS Lambda: How is AWS Lambda charged?

Lambda charges $0.20 per million requests. Duration charges are $0.0000166667 per GB-second for x86 (up to 6 billion GB-seconds/month in US East Ohio with tiered pricing). Ephemeral storage over the included 512 MB costs $0.0000000309 per GB-second. Provisioned Concurrency costs $0.0000041667 per GB-second with a 5-minute minimum.

Source
DuckDB: Is it a replacement for a data warehouse?

For single-node analytical workloads up to a few hundred gigabytes it very often is. It is not a replacement when many concurrent users need a shared, governed, always-on service.

AWS Lambda: What are Lambda Durable Functions pricing?

Lambda Durable Functions include operations at $8.00 per million (start execution, steps, waits). Data written costs $0.25 per GB. Data retention is $0.15 per GB-month with configurable 1-90 day retention (default 14 days).

Source
DuckDB: Do I have to load data into it?

No. It queries Parquet, CSV, JSON and Arrow in place, including on object storage. Its own storage format is optional and mainly useful when you want indexes, constraints and faster repeated access.

DuckDB: What is MotherDuck's relationship to it?

MotherDuck is a separate company offering a managed and hybrid service built on the DuckDB engine. DuckDB itself remains MIT-licensed and independent of it, with the IP held by the DuckDB Foundation.

DuckDB: Is it suitable for OLTP?

No. It is designed for analytical scans. For transactional workloads with frequent small writes, SQLite or Postgres is the right tool.

Share

Related pages

Other head to heads