Thursday, May 2, 2024

Base 64 number system


Imagine you have to create unique sequence numbers but length should be less than 8 digits/characters,  in such case use Base 64 number system use the symbols 0-9, a-z, A-Z, -, _  (hyphen, underscore), Z represents 61, and - 62, and _ 63.


You can represent 

64 ^1 = 64
64^2  = 4096
64^3  = 262,144
...
..
64^8 = 281,474,976,710,656 (its 281 trillion, 474 billion, 976 million .... )

This technique used in shortened URL's and other places where we need to represent a large number with less digits/characters.

Tuesday, April 9, 2024

Maintain 99.999 up time

Often we hear or request to keep services up & running for 99.999 time.  How much maintenance window this gives if we have to maintain service uptime 99.999 time?

Its a simple math calculation ( 365 * 24 * 3600 ) = 31536000 seconds (not considering 365.25  or leap years)

To keep it 99.999%, we have a maintenance window 315.36 seconds, this gives roughly 5 minutes 15 seconds.  


Seconds in an hour  3600
Seconds in a day  86,400
Seconds in a week (7 * 24 * 3600 ) = 604800