-
Notifications
You must be signed in to change notification settings - Fork 0
Database Structure
Noah Rijkaard edited this page Aug 20, 2024
·
3 revisions
- The database structure was designed to keep things simple yet functional. The URL shortener model was configured to generate shortened codes dynamically. I wanted to allow each original URL to have multiple shortened versions, enabling flexibility in tracking and managing different campaigns or uses.
- The model also keeps track of the original URL and its title, which is useful for reference purposes, especially when redirecting users.
- To enhance the functionality, I added a feature to track user interactions with the shortened URLs. This involved creating a user_data model that logs when and where a user clicks on a link. Although this data is currently accessible through a Rails admin dashboard, it lays the groundwork for future enhancements, such as detailed analytics and user engagement statistics.
erDiagram
URL_SHORTENER {
int id PK
string original_url
string short_url
string title
datetime created_at
}
USER_DATA {
int id PK
int url_shortener_id FK
string origin_country
string origin_city
string timezone
string latitude
string longitude
datetime created_at
}
URL_SHORTENER ||--o{ USER_DATA: has