← Back to Napkin Math

Problem 1

https://sirupsen.com/napkin/problem-1

Problem #1: How much will the storage of logs cost for a standard, monolithic 100,000 RPS web application?

Assumptions

Let’s estimate annualized cost of logs.

Say each request generates 1KB of logs.

Blob

Say we can put them in blob storage:

But we don’t usually need to keep logs that long. Let’s say we only keep last three days

Ah, but we are also charged by writes to blob. Let’s start with 1 write per request.

Napkin math technique: let’s batch writes by 1000. Then our answer just changes by a factor of 1000.

Another thousand: $15.768 / year

Logs

Alternatively, logs pricing is $0.5 / 1 GB. For one year:

For three days:

Solution

https://sirupsen.com/napkin/problem-2

I didn’t think to estimate how much we fits into 1KB.

I also like computing with scientific notation. Let’s walk through it:

Solution also used disk storage pricing at $0.01 GB / mont. Possibly don’t have to pay for writes at this level?

Writes get pricey:

Write every 1000 requests: