System design URL shortener: Spring Boot 4.1.1, base62 ids, Redis cache-aside, Redis Lua token bucket, 24 tests and live transcripts

This commit is contained in:
2026-10-22 08:13:35 +00:00
commit aa61ed8786
51 changed files with 1717 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
PASS Base62Test.knownValues
PASS Base62Test.roundTripsAcrossTheRange
PASS Base62Test.rejectsGarbage
PASS Base62Test.sevenCharactersCoverAboutThreePointFiveTrillion
PASS CodeScramblerTest.noTwoIdsShareACodeAcrossTwoMillionConsecutiveIds
PASS CodeScramblerTest.everyCodeIsExactlySevenCharacters
PASS CodeScramblerTest.idsBeyondTheFortyBitDomainFallBackToPlainBase62
PASS CodeScramblerTest.consecutiveIdsDoNotGiveConsecutiveCodes
PASS RateLimitTest.burstOfFiveThenRejectedThenRefilled
PASS RateLimitTest.redirectsAreNeverRateLimited
PASS SnowflakeIdGeneratorTest.idsIncreaseWithinOneThread
PASS SnowflakeIdGeneratorTest.base62CodeIsLongerThanForASequenceId
PASS SnowflakeIdGeneratorTest.refusesToIssueIdsWhenTheClockGoesBackwards
PASS SnowflakeIdGeneratorTest.idsAreUniqueAcrossEightThreads
PASS SnowflakeIdGeneratorTest.nodeIdIsEncodedInTheId
PASS SnowflakeIdGeneratorTest.rejectsOutOfRangeNodeId
PASS SnowflakeProfileTest.snowflakeIdsGiveLongerCodes
PASS UrlShortenerApiTest.sameLongUrlGetsAnIndependentCodeEachTime
PASS UrlShortenerApiTest.customAliasWorksAndSecondUseIsAConflict
PASS UrlShortenerApiTest.unknownCodeIs404AndTheMissIsNegativelyCached
PASS UrlShortenerApiTest.createsAShortLinkAndRedirectsWith302
PASS UrlShortenerApiTest.countsClicks
PASS UrlShortenerApiTest.rejectsBadInput
PASS UrlShortenerApiTest.expiredLinkIs410
24 tests, 0 failures