3 ms·
That does seem good, but when you consider that it’s basically just doing a DB query for an IP (and there might be a clever way to store CIDRs where the DB find
by seanp2k2 9y ago
That does seem good, but when you consider that it’s basically just doing a DB query for an IP (and there might be a clever way to store CIDRs where the DB finds it within a range) + authentication, authorization, and accounting ( AAA), it becomes a bit less impressive. I’m guessing again that the AAA stuff is actually more work than the actual lookups. I’ve made some services which use geoip before with in-memory lookups. Since it doesn’t change that frequently, aside from AAA, you don’t really need an external DB at all — just have the actual executable contain the lookup info, now you’re down to just lambda. Actually, don’t even build a service — just distribute a binary with the tables inside, so then customers don’t even need to make a call, wait, and pay for each call. Consider how well that would scale (and indeed this is already the business model for some of the MaxMind products (e.g. https://www.maxmind.com/en/geoip2-city https://www.maxmind.com/en/geoip2-city ), but it doesn’t make for as interesting of an article.
- ddorian43 9y agoHow I scaled my single-function + single-db-query api!
- jonathan-kosgei 9y agoIf anything it's closer to - How I built a multi-regional apigateway API with multiple creative workarounds despite there being no official way to do it and it only becoming possible to do so 5 months ago :)
- deleted 9y ago[deleted]
- kreetx 9y agoHear hear! Clearly a significant amount of effort has went into figuring out this design, and it's interesting to read about it. EDIT: And you're the author -- thanks!
- jonathan-kosgei 9y agoThe article is about building a fast and highly available API distribution architecture. You could just as well apply it to anything you want to build. I will agree that it's not for everyone. And would probably more likely appeal to indie makers like myself.
- antihero 9y agoCould you not spit out the DB as a JSON file and have it included directly into the lambda as a source file then have any updates as part of your CI? Then it's just an O(1) lookup in a map, and as long as the lambdas stay hot you're flying. Perhaps a JSON file for 4 billion IPs with all the data would be too large to fit in memory. Who knows. Lambdas can be up to 50MB so maybe this is a dumb idea unless you normalised the data somehow.