Navigate back to the homepage
AboutWeb-DevelopmentSoftware-DevSelf-Improvement
x
x
x
x
x
x
x

Estimates every Software Developer should know

Divyansh Tripathi
May 28th, 2022 · 2 min read

Estimates every Software Developer should know

It’s alright even if you don’t, just wanted to make a catchy header. I recently got into system design back again and found somethings which I totally either overlooked or forgot in the years to come, this is one of the tidbits I wanted to share and keep for myself also. PS- This is inspired from the book System Design Interview by Alex Xu

While designing systems at times you would need to make some “back-of-the-envelope” calculations. To do so efficienty you would need to know some estimates and approximations we make for space and time in the world of computing. This blog consists of the same

The Power of 2

While estimating data storage we have to go back to basics. The way memory stored is stored in compputers is in terms of bits which make it coherent to powers of 2. An ASCII character is of one byte which is 8 bits. SO in terms of byte you can think of data in this way

PowerApproximate ValueFull nameShortname
101 Thousand1 Kilobyte1KB
201 Million1 Megabyte1MB
301 Billion1 Gigabyte1GB
401 Trillion1 Terabyte1TB
501 Quadrallion1 Petabyte1 PT

Latency Numbers

These estimates are to tell you how much time a typical computer operation would take given the current hardware capabilities we have. This information was compiled and shared by Dr. Jeff Dean from Google.

L1 cache reference0.5 ns
Branch mispredict5 ns
L2 cache reference7 ns14x L1 cache
Mutex lock/unlock25 ns
Main memory reference100 ns20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy3,000 ns ~ 3 us
Send 1K bytes over 1 Gbps network10 us
Read 4K randomly from SSD*150 us~1GB/sec SSD
Read 1 MB sequentially from memory250 us
Round trip within same datacenter500 us
Read 1 MB sequentially from SSD*1,000 us ~ 1 ms~1GB/sec SSD, 4X memory
Disk seek10 ms20x datacenter roundtrip
Read 1 MB sequentially from disk20 ms80x memory, 20X SSD
Send packet CA->Netherlands->CA~150 ms

Pictorial Representation -

Latency Numbers
Latency Numbers

src

Obviously these numbers have varied over time all thanks to the Moore’s Law. You can see the advancement in hardware and changing of these numbers over in the graphical representation here - https://colin-scott.github.io/personal_website/research/interactive_latency.html

Service Availability Numbers

Availability of system is measured by a percentage. These percentages are shared by 3rd party solution providers like AWS, GCP and Azure in terms of an agreement that formally defines the level of uptime this solution/managed service would deliver. So if a service has an SLA of 100% it means it will never go down in the entirety of its operational time. Mostly services lie between the SLA of 99% to 100%. General terms in which SLA is talked about is in terms of “Numbers of nine”. If a service has Five-Nines SLA it means its availability is 99.999%, similarly Three-Nines would mean 99.9%. This is because no one can promise 100% SLA due to obvious reasons. So we judge in terms of how close to 100 it can be.

So here’s a comparison of SLA vs Downtime expected by it.

Availability %Downtime per dayDowntime per year
99%14.40 Minutes3.65 Days
99.9%1.44 Minutes8.77 Hours
99.99%8.64 seconds52.60 Minutes
99.999%864.0 milliseconds5.26 Minutes
99.9999%86.40 milliseconds31.26 Seconds

Well that’s all for this one. This blog will serve more as a cheatsheet to me and I will keep on adding numbers as I find them useful and/or interesting. So you can bookmark this if you want to. 🍃

Join my email list and get notified about new content

I promise I won't spam or unnecesarily promotional emails through this mailing list. You might also get chance to be eligible for my monthly giveaways. Also I promise to not spam your inbox or share your email with any third parties.

More articles from Silentlad

Systemd timers onCalendar (cron) format explained

Learn the format of onCalendar for systemd timers, systemd timer every 15 minutes, systemd timer every week, systemd timers every day

October 10th, 2021 · 2 min read

How to use systemd timers (cronjob alternative)

Learn how and why to use systemd timers to schedule scripts, jobs on your unix based systems

October 7th, 2021 · 2 min read
xx
© 2018–2023 SilentladSitemapRSS feed
Link to $https://twitter.com/silent_lad_Link to $https://medium.com/@silentladLink to $https://github.com/silent-ladLink to $https://www.instagram.com/silent_lad_/Link to $https://www.linkedin.com/in/silentlad/Link to $mailto:silentlad29@gmail.com