Softwr

Databases · head to head

AWS WAF vs DynamoDB

AWS WAF logo

AWS WAF

Databases

Managed web application firewall for CloudFront, load balancers and APIs on AWS

From
$5/month
Free plan
No
DynamoDB logo

DynamoDB

Databases

AWS-only managed key-value and document database with fixed per-partition throughput limits and no ad hoc queries.

From
Free
Free plan
Yes

The short version

  • DynamoDB has a free plan, then $0.625/mo; AWS WAF starts at $5/mo.
  • Only AWS WAF lists web ACLs and rules; only DynamoDB lists predictable latency.
  • Where AWS WAF falls short: it only attaches to a fixed list of AWS resources, so applications hosted outside AWS or behind another CDN cannot use it.

How do AWS WAF and DynamoDB differ?

AWS WAF and DynamoDB differ on starting price ($5/month against Free), pricing model and free tier (No against Yes). Only the attributes on which AWS WAF and DynamoDB actually diverge.

Attributes where AWS WAF and DynamoDB differ
AttributeAWS WAFDynamoDB
Starting price$5/monthFree
Pricing modelPer web ACL, per rule and per million requestsUsage-based
Free tierNoYes
PlatformsWebAWS

Not yet recorded: category for AWS WAF, founded for AWS WAF.

Which features does each one have?

They share no listed features; 6 appear only for AWS WAF and 10 only for DynamoDB. 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 WAF

  • Web ACLs and rules
  • Managed rule groups
  • Bot Control
  • Fraud Control
  • Rate-based rules
  • Logging

Only in DynamoDB

  • Managed and serverless
  • Predictable latency
  • On-demand or provisioned capacity
  • Global secondary indexes
  • Transactions
  • DynamoDB Streams
  • Global tables
  • Point-in-time recovery

What is each one used for?

AWS WAF is most often brought in for rate limiting login and API endpoints that sit behind CloudFront. The jobs each tool is most often brought in to do.

AWS WAF

  • Blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancernot DynamoDB
  • Rate limiting login and API endpoints that sit behind CloudFrontnot DynamoDB
  • Adding bot detection to a retail site already hosted on AWSnot DynamoDB
  • Applying one set of WAF rules across many accounts through AWS Firewall Managernot DynamoDB

DynamoDB

  • High-volume keyed workloads such as sessions, shopping carts, device state or user profiles where the access pattern is fixed and knownnot AWS WAF
  • Traffic that spikes unpredictably, where on-demand capacity absorbs a burst without a capacity-planning exercisenot AWS WAF
  • Serverless applications on Lambda, where an HTTP-based datastore avoids the connection pooling problem relational databases havenot AWS WAF
  • Event or telemetry ingestion where writes vastly outnumber reads and each record is retrieved by a known identifiernot AWS WAF

Where do AWS WAF and DynamoDB fall short?

Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

AWS WAF

  • It only attaches to a fixed list of AWS resources, so applications hosted outside AWS or behind another CDN cannot use it
  • Charges come from several meters at once (web ACL, rules, rule groups, requests, logging, and per-feature fees), so predicting a bill needs a worksheet rather than a single price
  • Account Takeover Prevention and Fraud Control start at $1,000 per million requests, so protecting a busy login endpoint can cost more than the web ACL itself
  • Managed rules ship in count-first workflows and generate false positives on unusual payloads, so someone has to review logs and tune exclusions
  • Request body inspection is capped by default, and inspecting beyond the limit or using more than the default capacity units carries extra per-request charges

DynamoDB

  • Access patterns must be designed into the key schema before launch; a query nobody anticipated needs a new global secondary index, which is a full extra copy of the projected attributes billed as storage and as writes, or an offline migration
  • Global secondary indexes are eventually consistent and cannot be read strongly, so a read-after-write against an index can legitimately miss the item that was just written, and application code must be written to tolerate that
  • Per-partition throughput is capped at roughly 3,000 read and 1,000 write units, so a hot key throttles even when the table has spare capacity overall, and the only real fix is changing the key design to spread the load
  • Items are limited to 400 KB and query results paginate at 1 MB, so large or list-shaped data has to be split, offloaded to S3 with a pointer, or read through pagination loops that complicate every consumer
  • It runs only on AWS and the API is proprietary rather than a standard, so moving the data layer means rewriting it; ScyllaDB's Alternator is the only meaningfully compatible target and it brings a much smaller ecosystem

How much do AWS WAF and DynamoDB cost?

AWS WAF starts at $5/mo; DynamoDB has a free plan, with paid plans from $0.625/mo. Plan by plan below, from each vendor's own pricing page.

AWS WAF

$5/month
  • Pay-as-you-go$5/mo
    • $5.00 per web ACL per month
    • $1.00 per rule and $1.00 per rule group per month
    • $0.60 per million requests
  • Bot Control$10/mo
    • $10.00 per web ACL per month subscription
    • Common: $1.00 per million requests, first 10 million free
    • Targeted: $10.00 per million requests, first million free
  • Account Takeover and Fraud Control$10/mo
    • $10.00 per web ACL per month per rule group
    • $1,000 per million requests for the first 2 million, falling to $50 per million at the highest tier

DynamoDB

Free
  • On-Demand CapacityOn request
    • Pay-per-request pricing with automatic scaling
    • Read: 0.5 RRU per 4 KB (eventually consistent), 1 RRU per 4 KB (strongly consistent), 2 RRU per 4 KB (transactional)
    • Write: 1 WRU per 1 KB
  • Provisioned CapacityOn request
    • Fixed hourly charges based on reserved capacity
    • RCU rate: $0.00013 per hour (Standard)
    • WCU rate: $0.00065 per hour (Standard)
  • Standard Table Class Storage$0.25/per gb/month
    • $0.25 per GB/month after free tier
    • First 25 GB free per month (free tier)
  • Standard-Infrequent Access Table Class$0.1/per gb/month
    • $0.10 per GB/month

Which should you pick?

Choose AWS WAF if

  • You need web acls and rules.
  • You also want managed rule groups.

Choose DynamoDB if

  • You need managed and serverless.
  • You want to start without paying.
  • You work on AWS.
  • You also want predictable latency.

Questions people ask

Is AWS WAF or DynamoDB better?
It depends on the job. AWS WAF fits blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancer; DynamoDB fits high-volume keyed workloads such as sessions, shopping carts, device state or user profiles where the access pattern is fixed and known. AWS WAF starts at $5/month and DynamoDB at Free.
Which is cheaper, AWS WAF or DynamoDB?
DynamoDB has a free tier; the other does not. Paid plans start at $5/month for AWS WAF and Free for DynamoDB.
Does AWS WAF or DynamoDB run on more platforms?
AWS WAF runs on Web. DynamoDB runs on AWS.
Can I use DynamoDB for free?
Yes. DynamoDB has a free tier, so you can try it without paying. AWS WAF starts at $5/month.
What is AWS WAF best used for?
AWS WAF is most often used for blocking sql injection, cross-site scripting and known bad inputs in front of an application load balancer, rate limiting login and api endpoints that sit behind cloudfront, adding bot detection to a retail site already hosted on aws, applying one set of waf rules across many accounts through aws firewall manager. Of those, blocking sql injection, cross-site scripting and known bad inputs in front of an application load balancer and rate limiting login and api endpoints that sit behind cloudfront are not what DynamoDB is typically brought in for.
What can AWS WAF do that DynamoDB cannot?
AWS WAF covers Web ACLs and rules, Managed rule groups, Bot Control, Fraud Control. DynamoDB covers Managed and serverless, Predictable latency, On-demand or provisioned capacity, Global secondary indexes.

Answered from the vendors’ own pages

AWS WAF: How much does AWS WAF cost per month?

On pay-as-you-go pricing it is $5.00 per web ACL and $1.00 per rule per month, plus $0.60 per million requests, per the AWS pricing page. Bot Control, fraud rules, CAPTCHA and logging are billed on top.

DynamoDB: On-demand or provisioned capacity?

On-demand suits unpredictable or spiky traffic and removes capacity planning. Provisioned with autoscaling is considerably cheaper for steady high-volume workloads. Tables can be switched between them, though not arbitrarily often.

AWS WAF: Does AWS WAF work outside AWS?

No. It protects supported AWS resources such as CloudFront, Application Load Balancer and API Gateway. Origins elsewhere can be covered if they sit behind CloudFront.

DynamoDB: Can I run DynamoDB outside AWS?

No. DynamoDB Local exists for development and testing only. For a production-compatible alternative elsewhere, ScyllaDB's Alternator implements the DynamoDB API, but it is a different system with a different ecosystem.

AWS WAF: Is AWS WAF included with Shield Advanced?

Shield Advanced includes WAF usage for protected resources, up to 50 billion requests per month and 1,500 capacity units per web ACL, per the Shield pricing page.

DynamoDB: Can I run ad hoc queries or analytics?

Not on the table itself. Scans are slow and expensive at scale. The usual pattern is to export to S3 or stream changes out and query them in Athena, Redshift or another analytical engine.

DynamoDB: Is single-table design necessary?

It is the pattern that gets the most from DynamoDB when access patterns are well known, because it lets related items be retrieved in one query. It also makes the model harder to evolve, so many teams reasonably choose multiple simpler tables and accept extra requests.

DynamoDB: What are the real limits I should design around?

400 KB per item, 1 MB per query or scan page, 100 items per transaction, roughly 3,000 read and 1,000 write units per partition, and eventual consistency on global secondary indexes.

Share

Related pages

Other head to heads