Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify lambda #1

Open
hamstah opened this issue May 9, 2019 · 2 comments
Open

Simplify lambda #1

hamstah opened this issue May 9, 2019 · 2 comments

Comments

@hamstah
Copy link

hamstah commented May 9, 2019

Why not use the same principle as the iterator to store a map of id to URLs inside the handler code so you don't need the separate write and iterator. You could even make it slightly less ugly by storing it in a JSON file in the lambda next to the handler.

@kkuchta
Copy link
Owner

kkuchta commented May 10, 2019

Hmm... you'd probably have a bit of a scalability issue with that. Each url you add would make the json list take longer to load into memory. The one part of a url-shortener that you really need to be fast (redirecting from the shortened url to the long one) would grow slower linearly with the number of urls you're storing.

@hamstah
Copy link
Author

hamstah commented May 10, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants