-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments
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. |
If that becomes a concern just shard to different files. Keep each dict to
100000 entries or whatever a benchmark tells you is slow, but loading text
files is probably much faster than the cold boot time for a new lambda.
If you use the line number as an index you dont even need to load the whole
thing.
…On Fri, 10 May 2019, 4:06 pm Kevin Kuchta, ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABN7DXVUJA56MGFPNFRNPLPUWFPZANCNFSM4HL6KTVA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: