News for hackers. Stuff that matters.
Re:Serverless dev practices questions by fiokoden on Wednesday September 06, 2017 @05:27AM (#15182258)
I have a very large application implemented as one single lambda python function.

Works great.

Re:Serverless dev practices questions by JackC on Wednesday September 06, 2017 @09:16AM (#15183378)
This is true of any project using Zappa, right? https://github.com/Miserlou/Zappa

The python project defines a wsgi application (which is a python function meeting the wsgi spec), and Zappa runs the function on Lambda.

I wonder how large Zappa sites have gotten.

Re:Serverless dev practices questions by nvivo on Wednesday September 06, 2017 @05:42AM (#15182320)
Please define "very large". When I think large app, I think at least a few hundred endpoints split across tens of thousands of files. How can you have a very large app with a single endpoint? Could you elaborate?
Re:Serverless dev practices questions by fiokoden on Wednesday September 06, 2017 @05:58AM (#15182388)
Ok we have very different definitions of very large. I mean s complete full featured SAAS workflow application.

I don't actually use the AWS HTTP API gateway. I control the front end entirely so my UI just talks direct to lambda. It's very simple - instead of futzing around implementing REST API mapping layers I just connect all my front end functions to a single lambda function and specify in the params the name of the python function I want to run. Super easy.

Even if you wanted to use API gateway you could still map all the end points to one single application and dispatch based on the route/URL.

I can make a solid recommendation to anyone use lambda .... seriously consider using Cognito for your user management.

There's no reason why you couldn't have tens of thousands of functions in the same function, in fact probably a good idea.

Re:Serverless dev practices questions by mseebach on Wednesday September 06, 2017 @06:37AM (#15182571)
> seriously consider using Cognito for your user management.

Can you please expand on that recommendation? I tried and found it profoundly opaque, and eventually gave up in favour of auth0. I specifically wanted to use the hosted login/sign-up forms.

Re:Serverless dev practices questions by danesparza on Wednesday September 06, 2017 @08:26AM (#15183049)
I found this tutorial had some very good information on incorporating Cognito into an app: https://aws.amazon.com/blogs/aws/build-your-first-serverless...

It lays out the architecture fairly well and how Cognito ties into it. Still very fiddly, and doesn't give any indication on how to use their hosted forms (which are a bit of a mystery to me as well).

Since it's still on point with the OP's question, I'll ask: What has your experience been with auth0? It's another service I have considered.

Re:Serverless dev practices questions by mseebach on Wednesday September 06, 2017 @08:49AM (#15183168)
I really liked it. Easy to follow instructions and an active community where all questions I could come up with were already answered. Took me an afternoon after getting almost nowhere with Cognito in three days.

The thing I spend the most time on was "user_metadata" and "app_metadata", two JSON blobs on each user, RW and RO respectively. In order to read those at all from your application, you have to define a custom "rule" (arbitrary Javascript that wraps responses). The reason for this is something about standards and name-spacing, but I couldn't really follow the argument, and it's seems like this is something that very confusing to a lot of users.

Re:Serverless dev practices questions by niteshade on Wednesday September 06, 2017 @11:57AM (#15184646)
We recently managed to implement Cognito User Pools with hosted pages, the details are on the StackOverflow page[0].

[0]: https://stackoverflow.com/questions/45828654/aws-cognito-use...

Re:Serverless dev practices questions by fiokoden on Wednesday September 06, 2017 @06:58AM (#15182656)
Yeah it was fiddly to understand and set up but it all worked fine in the end after persisting with it.
Re:Serverless dev practices questions by danpalmer on Wednesday September 06, 2017 @08:05AM (#15182946)
I work on a large (I think) Django application, ~1000 endpoints, ~150k sloc. I've been thinking of how something of that size could work in a serverless context, and I really struggle to imagine it working well.

Between the startup time (importing that much Python takes a few seconds, fine for a long running server, not good per-request), and all the dev-ops/infrastructure automation to get it all working correctly in dev/prod, I just think it would be more effort than it's worth, compared to running in "normally" on a cluster of VMs or dedicated machines.

Re:Serverless dev practices questions by shawabawa3 on Wednesday September 06, 2017 @05:45AM (#15182335)
A single lambda function doesn't mean a single endpoint.

The lambda function gets the request, looks at the url and routes based on that