News for hackers. Stuff that matters.
Re:Serverless Event Gateway by 21 on Thursday August 17, 2017 @06:56PM (#15041826)
Somewhat OT: I want to create an auth system (username, password, login, logout) using a serverless architecture with Cosmos DB as data storage. Each user will have it's own document and logging in will set a flag in that user document, or maybe in a session document. Login with Facebook would also be nice. Anybody know of such a pattern or best practices?
Re:Serverless Event Gateway by jchanimal on Thursday August 17, 2017 @07:39PM (#15042079)
There is a great authentication boilerplate that is set up for AWS. It might not be so hard to extend it for other platforms. Here is a blog post I did showing how to use the boiler plate with FaunaDB for authentication and authorization.

https://serverless.com/blog/faunadb-serverless-authenticatio...

Re:Serverless Event Gateway by 21 on Thursday August 17, 2017 @08:39PM (#15042445)
Thanks, this is the kind of stuff I was looking for.

BTW, I looked a bit at FaunaDB pricing. If I understood corectly, 1 mil requests costs $10.

In Cosmos DB, also if I understood corectly, 1 month of 400 req/second, so 400 x 86400 x 30 ~= 1 billion requests costs $25.

I don't know much about FaunaDB, and very likely you can't compare things the way I did, for once, Cosmos DB has separate storage costs which seems included in FaunaDB, spikes in usage require extra provisioning in Cosmos, but it's still a 3 orders of magnitude pricing difference. I'm not saying you're not worth it.

Re:Serverless Event Gateway by jchanimal on Thursday August 17, 2017 @09:21PM (#15042706)
The big question is whether you have traffic that is steady state or spiky. Steady state traffic is more economical to service with FaunaDB Enterprise on your "own" hardware. But then it is not fully managed.

That said, our goal is never to have a customer turn away because of price, so reach out at [email protected] and I can take a look at your numbers more closely.

Re:Serverless Event Gateway by mayank on Thursday August 17, 2017 @07:18PM (#15041957)
Doesn't sound particularly challenging from a serverless point of view, if you have some sort of central Cosmos DB instance. Wrap it all in a Lambda function.
Re:Serverless Event Gateway by pesfandiar on Thursday August 17, 2017 @07:27PM (#15042008)
If Cosmos DB is not a requirement, AWS Cognito is a cheap and headache-free option that covers all other requirements, including the FB login.
Re:Serverless Event Gateway by 21 on Thursday August 17, 2017 @08:22PM (#15042323)
Thanks, at first look seems useful and the pricing is great. Cosmos DB is a requirement, but not for the actual storage of the session or user data (I realize I wasn't very clear in the original description) so I might make the two work together.
Re:Serverless Event Gateway by heffay on Friday August 18, 2017 @08:21AM (#15045464)
Have you looked at Azure AD? Seems like it would do what you want if I'm understanding correctly
Re:Serverless Event Gateway by brianwawok on Thursday August 17, 2017 @07:18PM (#15041960)
Auth0?
Re:Serverless Event Gateway by 21 on Thursday August 17, 2017 @08:03PM (#15042225)
I looked into that previously. It's beautiful, exactly what I would need, but also very very expensive.
Re:Serverless Event Gateway by brianwawok on Thursday August 17, 2017 @08:53PM (#15042527)
Ah annoying I never paid the bill.