3 ms·
1) Loop detection -- don't let me shoot myself in the foot an make an infinite loop of two functions calling each other 2) Multi-datacenter -- I want to deploy
by jedberg 10y ago
1) Loop detection -- don't let me shoot myself in the foot an make an infinite loop of two functions calling each other
2) Multi-datacenter -- I want to deploy to two places at least so my risk goes down
The lack of database and/or storage would be a big showstopper. It would mean that if I want build anything with state, I need to store it in another service, which costs money to move data out of. Even a very basic key store would better than nothing. You could actually build one pretty easily on top of Postgres or even SQLLite (although you'd need one per customer w/ SQLLite).
- hayd 10y agoIf you're using lambda you have access to dynamodb, which is reasonably priced (and runs on a similar "pay what you use" and very generous free plan).
- marktangotango 10y agoHa, got the Sqlite case covered! Full disclosure lite-engine.com is my service, the idea here is SQL as a service, literally. The net result is basically MS Access backend for the web, with html/css/js for the frontend: https://www.lite-engine.com/blog/api_queries.html https://www.lite-engine.com/blog/api_queries.html Edit: To the downvoters: self promotion is allowed on this site, and in fact encouraged! https://news.ycombinator.com/item?id=12559012 https://news.ycombinator.com/item?id=12559012
- ohstopitu 10y agoThanks for the reply! 1. Loop detection does seem harder to implement but I'll definitely look into it (if the api service is used, it would be trivial to implement) 2. but multi-datacenter has almost been implemented (you can select from different service providers, regions or a combinations of each - and the functions would scale accordingly). As for a database/key store...would integrating with database solutions from other cloud providers be of some consideration? (from GC / AWS / Azure?). Keep in mind that all users would have access to environment variables (across projects/functions etc.) by default.
- mdergosits 10y agoWouldn't loop detection be equivalent to solving the halting problem? Obviously a naive approach would be disallow recursion/ mutual recursion, but there are valid use cases for those that may not result in infinite execution
- dllthomas 10y agoAs I understand it, this is mutual recursion accross services, which is a much more specific case. Forbidding it may be viable.
- harlanji 10y agoI helped design a large scale JS execution engine. We used Babel to rewrite code with loops that could be interrupted by our system. Eg. `for(...){mycode();}` would be recompiled to `for(...){if(!running()){halt();}mycode();}`. The technical reason is that tight loops wouldn't respond to SIGINT, if I recall correctly. So while it doesn't stop infinite loops, it can control the program. I wasn't involved in productionizing it.
- duaneb 10y agoSorry--couldn't be interrupted by SIGINT? That's arguably the point of signals. Does the runtime just queue signals rather than respond in the signal handler itself?