Thanks to visit codestin.com
Credit goes to github.com

Skip to content

prestonparris/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dependencies

gradle java 8

run application

./gradlew bootRun

then visit

http://localhost:8080

in a browser

run tests

./gradlew test

system design explanation

I decided to go with a highly scalable solution based on pre-computing all of the possible 6 character tinyUrl strings. This means generating initially and storing 68.7B (unique keys). Currently only generating a small subset for testing. These keys would be stored in a distributed key value store such as cassandra allowing near constant read and write times without encountering hash key collisions. There would need to be a service to potentially expire old keys and add them back to the pool of available keys.

The KeyGenerator script is intended to be ran initially to populate the unused keys table.

There is a key service which is just responsible for providing a new unique key to the url service. The url service stores the mappings between smallUrl to largeUrl and largeUrl to smallUrl.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published