0% completed
Few more :1)Why does the KeyDB have a table for used keys? Can't we can just del...
Nevil
Apr 23, 2022
Few more :
1)Why does the KeyDB have a table for used keys? Can't we can just delete used keys right away? When something expires we anyways have the hash which we can insert back into the table.
2)Seems like KeyService has just one operation:GetKey - to get a new key..can it be merged with AppServer logic? Untill KeyService needs a service of its own? Maintaining different services comes with its own overhead.
3)I can understand loadBalancer for Cache Server when we have a single machine cache & its replicas. This won't be straightforward/feasible in horizontally scaled cache fleets(when cache space is partitioned between machines in that fleet)
Also, for Load balancers for DB Servers, given NoSQLs like dynamo today take care of replicas transparently, i think we wouldn't generally need it?
0
0
Comments
Grayson W3 years ago
Some thoughts, from the implementation POV of the KGS
To 1), I think the table for the "used keys" belongs to the KGS' own business logic. Application servers and other don't care about such table. KGS however needs to maintain such table so that it makes sure it gener...
Whip 3 years ago
But if KGS also keeps an 'unused keys' table, why keep the 'used keys'' table? It already knows a key is available if it's in the 'unused keys' table, so it shouldn't ever need to check the 'used keys' table to ensure there are no non-duplicates. Right?
calvio 3 years ago
It needs the "used" table to actually generate keys to feed into the "unused". How else would it know that a key has previously been used -> deleted, and should not be re-generated into the "unused"?
Đạt Jackson3 years ago
1, The table for the "used keys" is used to check if a newly generate key has been generated before. Let's say you generate a key "abcde", if you give this key to a URL, when the KGS generate a new same key "abcde", we would need to make sure the key is not generated be...
On this page
- Why do we need URL shortening?
Try it yourself
Designing URL Shortener (video)
- Requirements and Goals of the System
- Capacity Estimation and Constraints
- System Interface Definition
- Create Short URL API
- Redirect API
- Analytics API
- URL Management API
- Delete Short URL API
- Database Design
- Basic System Design and Algorithm
a. Encoding actual URL
b. Generating keys offline
- Data Partitioning and Replication
- Cache
- Load Balancer (LB)
- Purging or DB cleanup
- Telemetry
- Security and Permissions