---
# System prepended metadata

title: Design URL shortening (crypto version)

---

# Design URL shortening (crypto version)

## ToDo - Add domain being registered as part of the event structure
## ToDo2 - Add end goal (e.g. frontend) and state that for people to understand what the end goal is
## ToDo3 - Mention how the flow takes place, e.g. user registers, events emitted, then comes the system being designed, then we can retrieve data using the frontend.

ENS (Ethereum Name Service) allows people to create shortened versions of any metadata and is normally used for associating unique domains to addresses for easier transfers. An auction-like mechanism takes place for assigning domains, but let's simplify this and have people simply executing a simple transaction to reserve a name (if it has not yet been assigned). Every time a new domain is assigned, an Event is emitted -> Event(address _address).

Our goal is to design a system that is a centralized version of all registered domains. Let's assume the emitted events only broadcast the address (not the unique domain), hence we will generate unique identifiers for those addresses.


Follow [link](https://www.educative.io/courses/grokking-the-system-design-interview/m2ygV4E81AR) for reference on this problem.

Basic deliverables:
- Requirements clarification
- API design
- Database design
- Simple architectural design
- Some pros-and-cons discussions

Basic reference design
![aa](https://i.imgur.com/QvOUpSY.png)

Nice-to-have deliverables:
- Making key-generation separete from shortening
- Partitioning of the DB
- Cache
- Load balancer
- Purging old keys

Points to add during discussion:
- Let's assume we want to retrieve the most common addresses using a frontend. Can you think of any improvements or changes you would include in your design?!
 
- Let's assume we have now 1M addresses coming in every second. Would you change the system in any way?

