8 ms·
Twilio Functions – Public Beta
- sparrish 9y agoOther providers like Tropo have had this hosted scripting for years. Nice to see Twilio catching up.
- itake 9y agotrue, but have you actually used tropo? Their documentation is horrible and you are extremely limited when running the code on their servers. If you need to do anything complicated, you have to have things running through their WebAPI. They have made breaking changes to their API without communicating with their user's.
- sparrish 9y agoYes, I've been using Tropo, Twilio, Plivo, Nexmo, (seems you have to end with 'o' to be in programmable telephony these days) for many years. Nothing too complicated with any of them.
- sciurus 9y agoI'm not sure why this comment was downvoted. I worked for Tropo four years ago. You could write your code in JavaScript, PHP, Ruby, Python, or Groovy; upload it to our servers; and we'd run it on your behalf. It was literally zero infrastructure on your part and one line of code to answer a phone call. Tropo certainly lacked some things compared to Twilio while I was there, but this is undoubtedly an area where Twilio is playing catch up. https://www.tropo.com/docs/scripting/overview https://www.tropo.com/docs/scripting/overview
- kevinburke 9y agoPointing out "Company X already does this" when someone launches something new is a pretty douchey move...
- stale2002 9y agoUgh, Twilio is the far and above market leader in this space. I don't think they are to bothered by us pointing things out like this.
- thesimon 9y agoWhy? It's certainly useful to see what other companies are offering and what the differences between these offerings are. If just mentioning a competitor is bad then maybe the product is bad.
- kevinburke 9y agoWhether it's a company launching a product or a developer showing off something they built in their spare time, it's really depressing to launch something you've been working on for months or years and to get back "well, X already does this." I'd add that "X already does this" comments like this are a routine feature of Twilio HN threads, as long as the company's been alive. https://kev.inburke.com/kevin/six-years-of-hacker-news-comments-about-twilio/ https://kev.inburke.com/kevin/six-years-of-hacker-news-comme...
- jknoepfler 9y agoThe success of this product is dependent on torpedoing aws lambda from a usability and reliability perspective imo (not hard). After using twilio to build the sms side off of an app I've been quietly rooting for them (and betting on them actively) If they built this ON lambda then I'd bet against it very strongly, but I can't imagine smart engineers doing that in 2017 (ha...)
- ubercow 9y agoYou obviously have a strong dislike for lambda. I've never used it personally, but from afar it seems cool. What are some of the shortcomings you ran into using it?
- nolite 9y agoLambda is far from the most easy to use platform, no argument there, but I don't see any justification for bashing its reliability..
- teej 9y agoMaybe I just don't have enough experience with the competitors but I had to spend significant time writing wrappers and tooling to make Lambda usable in a sane way. Off the top of my head, I added - prefix logging, controlled timeouts to prevent AWS's terrible auto-retry feature, continuation to work around AWS's low 5 min timeout limit, and local testing.
- jedberg 9y ago> continuation to work around AWS's low 5 min timeout limit, and local testing. If you had to work around the 5 minute limit then lambda may have been the wrong technology choice. It's really neat for short quick bursts of compute, not long running processes.
- stale2002 9y agoYou are thinking about this wrong. Serverless functions on Twilio (or any other platform for that matter) is not competing with Lambda. The point of serverless functions is to take your Twilio app that you were already creating and to completely eliminate the back-end. Now you can make a fully functioning Twilio app without messing around with heroku.
- CJKinni 9y agoI've loved being able to hack away on projects with Twilio for a while now. They're relatively easy to get started with, and this is going to make it even easier. 10,000 invocations free, with subsequent invocations priced at 10,000/$1 seems like a great model. No idea about how this scales financially, compared to other similar services. But as someone making relatively limited use tools, most without a business model, their pricing certainly keeps me feeling great about using them.
- keithwhor 9y agoWell, to be honest, compute is becoming a commodity very quickly. We offer 100,000 invocations free and offer 50,000 per $1 [1] with a paid account. There are some pretty smart people who have talked at length about startups historically underpricing, but I think we're making a bet on the raw value of compute trending to zero. (This is a weird thing to say outright, our goal, generally, is to change the way people think about service composition and building things on the internet.) Twilio is interesting because they're offering this as a business-specific offering i.e., integrate with Twilio directly (SMS, voice), which on its face is actually more valuable than, say, a "generalized compute platform" (which we've referred to ourselves as, at times). I think it'll be really interesting to see how Twilio markets + plays with this model --- theoretically if it sells their other services they could get away with this being a loss-leader, which is an intriguing concept. [1] https://stdlib.com/pricing/ https://stdlib.com/pricing/
- skynode 9y ago> I think we're making a bet on the raw value of compute trending to zero. I'm thinking you mean the COST of compute here. If that's the case, I actually disagree on cost trend direction. I think the raw cost of compute will slowly increase. Long story but most of it borders on the economics of cloud computing.
- discodave 9y agoSomebody above pointed out that they're using Lambda. So you can figure out their loss/margin based off the public Lambda pricing model. Lambda costs 0.00001667 per GB-s... so if each Twilio function used 1GB of memory and ran for 1 second, it would cost them $0.17 per month to serve you. Since the max memory in Lambda is 1.5GB and the max runtime is 5 minutes... the worst case is that twilio is spending $75 for those 10k requests. I assume they were smart enough to use lower amounts of memory and set the maximum runtime of the Lambda function pretty low, like a few seconds.
- keithwhor 9y agoAwesome play by Twilio. We've been working on StdLib [1] and an open specification for FaaS execution [2] for a while now, and demos with Twilio (sending text messages after automatically validating parameters, hooking into other functions in our ecosystem) have really helped developers grok what's possible. (We have a built-in SMS utility that actually uses Twilio behind the scenes [3]). Happy to see we've come to the same conclusions about utility independently :). [1] https://stdlib.com/ https://stdlib.com/ [2] https://github.com/faaslang/faaslang/ https://github.com/faaslang/faaslang/ [3] https://stdlib.com/utils/sms https://stdlib.com/utils/sms
- gregorymichael 9y agoJust checked out stdlib.com. Looks awesome. Much appreciate you using Twilio to demo it. Would you drop me an email at gb@twilio.com? Would love to send you something.
- keithwhor 9y agoGladly. We're big fans!
- pw 9y agoI wonder if this is an independent effort or if it's built on top of AWS Lambda. Also, anyone know why all these serverless environments that are coming out focus on Node.js?
- dested 9y agoI would guess it's related to the prevalence of javascript combined with the low barrier to entry to build javascript app and the relatively low startup time of a nodejs app.
- keithwhor 9y agoFastest growing runtime, largest module ecosystem. That's it. The goal is to encourage adoption and validate a product quickly, so you ride the biggest wave. AWS has the resources to grow teams around different languages / runtimes, smaller players (or recent IPOs) do not in the same capacity. Targeting anything other than Node would be "the largest" disservice to your customer base in the case of Twilio, and would artificially slow any other player.
- PKop 9y agoIn addition, Node seems to have beneficial performance characteristics when it comes to cold startup time, compared to say Java, which probably helps when it comes to pay-only-for-requests functions as a service that aren't always running. https://forums.aws.amazon.com/thread.jspa?messageID=679050 https://forums.aws.amazon.com/thread.jspa?messageID=679050
- derefr 9y agoMy own hypothesis is that the teams building these FaaSes wanted to choose a runtime that has a good story for internal multitenant partitionability, so that they didn't have to either just-in-time spawn, or prefork, a new (containerized) copy of the runtime for each user, with all the overhead that implies. Node.js is such an internally-partitionable runtime. (So is Lua†, but like the parent says, Node.js is bigger and more people want it.) For a visible-to-the-public-eye example of what I mean, look at how CouchDB uses Node.js for its view functions: the CouchDB daemon process spawn an unprivileged Node.js slave process, which uses Node's ability to drop or virtualize syscall-making APIs, along with Node "VM"s (https://nodejs.org/api/vm.html https://nodejs.org/api/vm.html) —essentially the same kind of isolation as you get from distinct-origin browser tabs—to allow for the execution of arbitrary Javascript by multiple tenants. That's not too far off from a FaaS already. It's a good model to copy and extend. I'm betting AWS Lambda, and Twilio's offering as well, are mostly built around such a model. Mind you, Lambda now also offers a "prefork" container-based stack for function execution, but it didn't at first, and for good reason: it's harder to build, harder to operate, and has much higher overhead than a cluster of regular processes with internal sandboxing. This is much the same reason that Heroku started with their Alpine stack—an cluster of internally-partitioned Ruby processes, and boy was that a feat—before building their container service. --- † Given that you could pretty easily multitenant-sandbox Lua evaluation... it'd be quite easy to extend OpenResty (https://openresty.org/ https://openresty.org/) into being a FaaS, wouldn't it? Anyone hacking on this?
- deleted 9y ago[deleted]
- foolfoolz 9y agogood amount of comments here missing how hard it is for "normal" people to use twilio. the article is clear: twilio's many interface to your code is a callback URL. think about what it takes to have a callback URL you can input to the twilio website. could they really set up an AWS account, lambda function, IAM role, API gateway, with cloud watch logs? ive done this in AWS. you have to use 5+ AWS services that have funny names and look nothing alike, and make them all work together. or lets say you wanted to buy a domain, hosting for it, and put your code on there for twilio to hit with a callback URL. thats hard too. if you are going to do either of the 2 approaches above, how many hours are you going to spend getting the callback URL foundation set up (and working) before you even get to use a twilio product?
- Mister_Snuggles 9y agoCan the callback URL use an IP address, or does it need to be a proper DNS name? Can it have a self-signed certificate? Does it even need to be secured? If the callback URL can use an IP address and doesn't require https, you could set up a Digital Ocean droplet for it in a couple of minutes. Or you could set up a port-forward on your router and run an HTTP server on your machine, but I think the Digital Ocean route might be quicker.
- foolfoolz 9y agowho are you expecting to understand this? there's tons of people out there who have no idea what these terms mean. DNS? Self Signed? IP address maybe... droplet? they are going to say "too hard, close tab"
- Mister_Snuggles 9y agoAt a quick glance, it seems like anything beyond a fire-and-forget SMS/fax done with Twilio requires a callback. My guess is that Twilio is expecting their customers to be able to write a callback and is willing to accept the associated barriers for entry.
- atomicUpdate 9y ago
- ryanar 9y agoI wish Twilio had free offerings for their other services. I didnt even dare playing around testing Twilio because I would be getting charged 2 cents per SMS sent
- keithwhor 9y agoThe truth of the matter is if you have a hard time paying 2 cents to send a text message for a few beta / trial runs, you're probably not contributing to Twilio's bottom line in any reasonable fashion, and unfortunately, they don't care. Not because they don't want to, but because they can't afford to. If every engineer with a six-figure salary decided they would pay the couple bucks it costs to test drive a product, the customer long-tail for dev products would add up to something appreciable and as a result you might actually see a lot more innovation around dev tools. As it stands, one of the best developer products of our generation, Heroku, even had a hard time pricing / selling to their long tail and we saw shutdowns of great products like Parse. Twilio actually has a very reasonable model. $20 deposit, non-recurring, is way less than you'd spend on a Thursday night date, for example, and you get to build something with it. Hell, speaking of building, you've probably spent more on a Lego set. (I have. As an adult... for myself.) (What actually ends up happening is developer companies go full OSS, give everything away for free for massive adoption, then AWS figures out how to productize it and sell to Enterprise. You can trace the points from Docker's inception to AWS Lambda processing trillions of trades per day.)
- sjtgraham 9y agoOver 95% of Twilio's users don't meaningfully contribute to their bottom-line. Their revenue is a fat long-tail dominated by outliers. I'd say Twilio does care about every developer because they have no idea which customers will become outliers.
- gbaygon 9y agothey do have a testing environment where you can send SMS to only registered and verified phone numbers
- 9y ago
- revicon 9y agoIt's definitely using AWS Lamba, I spun up a trial account and texted myself the output of JSON.stringify(process.env)... Edit: adding linebreaks... 2nd edit: Realized there were AWS access tokens in there. It's probably not a good idea for those to be exposed to the environment they're running this user generated code in. They should probably be wrapping these in vm.runInNewContext() { "PATH":"/var/lang/bin:/usr/local/bin:/usr/bin/:/bin", "LANG":"en_US.UTF-8", "TZ":":/etc/localtime", "LD_LIBRARY_PATH":"/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib", "LAMBDA_TASK_ROOT":"/var/task", "LAMBDA_RUNTIME_DIR":"/var/runtime", "AWS_REGION":"us-east-1", "AWS_DEFAULT_REGION":"us-east-1", "AWS_LAMBDA_LOG_GROUP_NAME":"/aws/lambda/ZDfb2ab7cd7ac1734d9a1a06a018a1c522", "AWS_LAMBDA_LOG_STREAM_NAME":"2017/05/25/[$LATEST]2d7b70d5a6914e3980f081ba96c9d4ab", "AWS_LAMBDA_FUNCTION_NAME":"ZDfb2ab7cd7ac1734d9a1a06a018a1c522", "AWS_LAMBDA_FUNCTION_MEMORY_SIZE":"512", "AWS_LAMBDA_FUNCTION_VERSION":"$LATEST", "_AWS_XRAY_DAEMON_ADDRESS":"169.254.79.2", "_AWS_XRAY_DAEMON_PORT":"2000", "AWS_XRAY_DAEMON_ADDRESS":"169.254.79.2:2000", "AWS_XRAY_CONTEXT_MISSING":"LOG_ERROR", "_X_AMZN_TRACE_ID":"Root=1-59274f44-71756c3273bfaf4895cd5610;Parent=4126596e259f5d9f;Sampled=0", "AWS_EXECUTION_ENV":"AWS_Lambda_nodejs6.10", "_HANDLER":"enigma.handler", "NODE_PATH":"/var/runtime:/var/task:/var/runtime/node_modules", "AWS_ACCESS_KEY_ID":"REMOVINGTHIS", "AWS_SECRET_ACCESS_KEY":"ALSOREMOVINGTHIS", "AWS_SESSION_TOKEN":"REMOVINGTHISTOO" }
- kentonv 9y ago... Are those actually Twilio's keys, or are they creating a new Lambda instance (with its own private access keys) for each customer? Maybe they actually intend for people to be able to use all the functionality of Lambda, some of which (I guess) requires using the AWS access key? Or are people naively assuming their own Lambda container is a reasonable sandbox for third-party code? If so, yikes.
- poolsh4rk 9y agoWhile it seems concerning on the service, you have to imagine twilio made a conscious decision not to wipe the env variables, just as aws don't. If you think about this product, you are paying for the service, so if you tried anything malicious, at worst you would do is impact yourself, and ultimately pick up a bill for your usage at the end of month, heh.
- rockmeamedee 9y agoInteresting. Thinking out loud here, are Functions a new opening for Saas businesses? (tldr no). If you have a big enough user base/set of use cases, the next step after opening an API to your service might be adding a Baas/Faas, so people with small use cases or prototypes can get started easily without using a server. But it's not like Linkedin or Zenefits users would get more value out of "Linkedin Functions". It probably makes more sense if you can "eat" what would have been a separate (micro)service. The one thing I don't see though, is if somebody is sold enough on Faas, why would they use your siloed Twilio Faas instead of AWS Lambda/whatever where you can interact with Twilio _and_ eg Shopify, Instagram, other APIs... Maybe then an interesting idea for the big FaaS providers duking it out for market share right now might be an ability for SaaS providers to build "$YOUR_SAAS Functions" on top of their offering. The end-user would see Lambda/Function/whatever templates pre-filled with the right API calls an a UI for choosing the different API-related triggers. This could be like the AWS marketplace, but for Faas. So I guess the answer to my clickbait-ey question at the top is mostly likely no, but maybe, let's see it play out. It definitely feels like a good way to sell more API usage.
- keithwhor 9y ago;) The answer to your "clickbait-y" question is definitely "we'll see," and it's already playing out.
- sagivo 9y agoI love the new popularity of lambda/functions as a service. each provider can now give you a custom code to do whatever you like, stripping away the needs for servers and that what i can really see as a full "micro-service"
- fpgaminer 9y agoIs there some way to create an SMS based service using Twilio, and charge users? Like, the user gets charged on their phone bill and I, the service owner, get paid by Twilio or something. Or is that just not a thing and it has to be done OOB?
- Roedou 9y agoIt depends on the country. In the UK it's very common, and relatively easy to do the 'premium sms' that you describe. It's not at all common in the US, and Twilio doesn't seem to support it anywhere.
- hacknat 9y agoI was already doing this with their API on Lambda. If anybody is interested: https://github.com/nathanjsweet/narthan https://github.com/nathanjsweet/narthan Good on them for integrating it.
- bryanh 9y agoThis is very similar to what we've done to bootstrap the Zapier CLI and developer platform -- especially relative to repurposing AWS Lambda. Wrote a bit of behind the scenes just the other day https://zapier.com/engineering/behind-the-cli/ https://zapier.com/engineering/behind-the-cli/ if this sort of stuff tickles your fancy.
- fiatjaf 9y agoWho are these people writing SMS apps? Why is Twilio so proeminent when no one uses SMS anymore?
- chadwittman 9y agoOur customers at Dolly love receiving SMS. Also helps with low data connectivity locations. Not sure "no one uses SMS anymore" is accurate.
- kevinburke 9y agoIt's still the easiest universal way to reach people on their phones. You can replace it for people that you know, but not if you are ZZZ Pizza and you want to message a customer that their order's on the way.
- exhilaration 9y agoI have the impression that everybody uses SMS for authentication. Everyone from Bank of America to Uber to even Whatsapp uses SMS to validate phone numbers or for 2-factor authentication.
- deleted 9y ago[deleted]
- tchaffee 9y ago> no one uses SMS anymore Except for the 6 billion SMS messages sent each day. https://www.smseagle.eu/2017/03/06/sms-mobile-statistics-2/ https://www.smseagle.eu/2017/03/06/sms-mobile-statistics-2/
- joshdance 9y agoWould be interested in the data or observations that no one uses SMS. I use SMS everyday with everyone who doesn't have iMessage.
- rsync 9y agoI am a (happy) twilio customer and I do not understand this: "Today, we’re excited to announce Twilio Functions, a serverless environment to build and run Twilio applications so you can get to production faster." I did just that ... I signed up for twilio, wrote a simple twiML[1] inside their web editor, and attached it to a phone number. No servers were involved (I am not sure how I could involve a server) and I "got to production" very fast. What would I do differently now ? [1] "Ring Forever"
- PKop 9y agoIs there not functionality that can't be expressed in a twiML? Like communicating to separate service or database within a given request from an SMS or Voice callback, etc... functionality that until today would have required web-hooks running on some other server (or cloud function)?
- jjeaff 9y agoYes, we pull data from our database to make dynamic responses. But I'm not sure if this services model helps that. You would have to create an API to interface with your own DB.