Live data from Hacker News

Architect – A Serverless Framework

blog.reifyworks.com

61–70 of 76 posts

Re: Architect – A Serverless Framework

#61

Don't invent some other file format please, just use whatever most people use unless you have a real specific reason for it.

Author here: we did? Pretty well documented issues w JSON and YAML (coming from CloudFormation perspective). Both have problems (that are unique to each) so we created a format for solving that. If you like JSON and YAML and don't mind those issues you are well served by existing solutions. Cheers!

Your arc format feels a lot like an INI-format, but with one or two teaks here and there.

Is it inherently better in a way I'm not seeing?

Would arc be suitable enough for a new project to adopt?

Re: Architect – A Serverless Framework

#62

DISCLAIMER: I've contributed a few times to the Serverless framework. I like some things about Architect, but there are things that just don't make sense: - Integrations with Slack but no way to define custom CFN resources - No authentication support - Custom file format (3) - Not being able to set CORS in this custom file format (4) - Magical vendor folders (5) I am sorry for the negativity, but brianleroux has post…

Hey np! Difference of views. No integration w CF is absolutely true but you're also totally free to do that. It doesn't prevent you from using it.

No auth support is false. We support session out of the box and you're free to impl any auth scheme of your choosing.

Custom file format is being well addressed in other comments. If you don't like it thats fine: enjoy YAML elsewhere.

CORS could be implemented in the file format…I'm personally not a fan for a variety of reasons but its open source. PR's welcome.

Magic folders! Absolutely. Structure is a good thing.

I don't find this negative. Serverless framework is an abstraction that is easily as verbose as CF but I'm not interested in comparing to it because we have different goals. Serverless is an abstraction between clouds. If mulitcloud is your goal: use Serverless. SAM is a flavor of CF which is def less verbose but still very vendor specific and …wordy.

This isn't a 'pet framework of the month'. I do take mild offense to that. Development of .arc started in 2015 for begin.com and got met with some serious production traffic (from things like Techcrunch and Venturebeat). It held up beautifully. We decided to pivot from our original producton into CI/CD for arc with begin.com because it is clear to us that it is a better way to build serverless apps.

Architect was officially open sourced in July of 2017 and donated to the JS Foundation to demonstrate the long term commitment to it. Development has been very active since. I stand behind my work, dedication to open governance and approach we're taking and, I think, I have the track record to ask for the benefit of the doubt when I say that.

Re: Architect – A Serverless Framework

#63

Lambda and SNS are super expensive. I'll skip it.

It can be very expensive. I priced out two scenarios recently for an IoT solution. Using Lambda the cost would be $27,000k a month. Using a LB/EC2 solution with reserved instances the price was $60/month. (We also priced out IoT core, and it was $3,000k a month).

Can you share more details on this? We've just moved to Lambda and are paying approx $60/month for lambda where we were paying $260 on heroku.

But then our db on AWS is another $110, where it's included in heroku.

I know it will depend on your memory usage, etc. and as we grow, we expect to move to ec2, but I'm curious as to where/how you had such a huge difference in cost.

Re: Architect – A Serverless Framework

#64

Earlier quoted context omitted.

What problems did you solve and how were they solved with your new format? I'm neutral in this argument at this point, so I'd like to hear your justifications. Thanks!

There are many issues with both formats: - JSON has no comments - YAML nesting tends to get deep which makes creating bugs very easy - Both are become hard to read / edit in larger files The primary issue is translating the intent into a machine syntax. The format we landed focused on minimalism to communicate intent. The the file format is the least interesting thing about .arc but one of the most distinctive. An .a…

YAML works pretty well for the 80% case, I think. I work at Pivotal -- we use YAML so widely in our designs that a few years ago there was a swag t-shirt with the title "Enterprise YAML Architect" printed.

YAML's shortcomings can be addressed a number of ways. The most recent trends I've seen are:

1. Simplify the YAML itself.

This usually means introducing higher-order features that make long, repetitive blocks irrelevant. An example is BOSH v2, which introduced a number of features (Eg. BOSH links) that pushed repetitive scutwork into the tool, away from the YAML manifests.

A variant of this is to use more advanced YAMLisms to make your YAML files more concise. Anchors make a big difference. I've seen this be very useful in large Concourse pipelines.

2. Use something that renders down to YAML.

For example, Jsonnet[0] or Enaml[1]. Some folks will use templating languages for this purpose (erb, mustache etc).

Templating is a last resort, in my view, because it's hard to see what the output will be without rendering it. Plus most tools format nested syntaxes poorly.

On the upside, use of a full templating engine introduces opportunities for multi-file DRYing. But that itself should be a smell that the configured tool is missing some feature or capability.

3. Use a different format.

TOML appears to be the most popular alternative to YAML and JSON. Most recently I have seen the joint Heroku-Pivotal effort on Buildpacks v3 adopting TOML over YAML or JSON.

[0] https://jsonnet.org/

[1] https://github.com/enaml-ops/enaml

Re: Architect – A Serverless Framework

#65

I actually like this. I build serverless apps all the time, mostly manually. Serverless framework is alright, but I felt it was really bloaty. There was just so much going on. Too many variables and it confuses the user. This looks clean. I might give it a try. I didn't find a link though in your blog.

There is a link, but it's buried in the middle of the second paragraph. There should really be another link in the call-to-action section at the bottom. I've wanted to try building something as a serverless architecture for a while, but every time I look into it I get confused by all the different things you have to set up to get an AWS Lambda function working, or I look into a framework but I can only find pre-canne…

Plug that I’m sure Brian won’t mind (he encouraged me to start a company a couple years ago):

If you want to get started building serverless functions and APIs quickly, do it in your browser with https://code.xyz - we just released it along with an announcement of our most recent $2M in funding from Stripe [1] who join Slack and others as investors and customers.

Disclaimer: I’m the founder.

[1] https://stdlib.com/blog/stripe-code-xyz

Re: Architect – A Serverless Framework

#66

Earlier quoted context omitted.

This is just not true. The discussion is about the syntax (.arc vs yaml), not the information it contains.

it's precisely true; but I get your gist. if you enjoy writing that much cloudformation then by all means have a good time!

The format of a configuration file has no relation to the output of the program that parses it. Why are you being so obtuse about this? Your three-line arc file would be a three line YAML file. Stop doubling down on this nonsense.

Re: Architect – A Serverless Framework

#67

DISCLAIMER: I've contributed a few times to the Serverless framework. I like some things about Architect, but there are things that just don't make sense: - Integrations with Slack but no way to define custom CFN resources - No authentication support - Custom file format (3) - Not being able to set CORS in this custom file format (4) - Magical vendor folders (5) I am sorry for the negativity, but brianleroux has post…

Hey np! Difference of views. No integration w CF is absolutely true but you're also totally free to do that. It doesn't prevent you from using it. No auth support is false. We support session out of the box and you're free to impl any auth scheme of your choosing. Custom file format is being well addressed in other comments. If you don't like it thats fine: enjoy YAML elsewhere. CORS could be implemented in the file…

Hi, thanks for the reply!

> No integration w CF is absolutely true but you're also totally free to do that.

It just seems then that there is no real way for me as a developer to transfer all the accumulated knowledge I already have about AWS to your framework. Looking through Architect's source, it actually seems as if everything is done via the AWS Javascript SDK, which seems a bit ... odd, to say the least. I'd even venture as far as saying it goes against the AWS Well Architected Framework guidelines (1) (which recommends using CloudFormation).

> No auth support is false. We support session out of the box and you're free to impl any auth scheme of your choosing.

Apologies, I couldn't find any mention in the docs. I meant more in terms of using an AWS service such as Cognito Federated Identities, and in terms of protecting API routes with either AWS_IAM, API keys or Cognito Authorizers.

> CORS could be implemented in the file format....

An Architect project deployment is not exactly repeatable if I still have to go to the Web Console to enable CORS now, is it?

> Magic folders!

I personally would prefer either my project's root `node_modules` or a Webpack bundle be deployed, over which I have some measure of control. Node already has a hard enough time with its resolution algorithms, must we add to the madness?

> Serverless framework is an abstraction that is easily as verbose as CF

I can't agree with you on Serverless being as verbose as CloudFormation, and I think you should know better as someone who has dealt with the complexity of setting up API Gateway programatically.

> but I'm not interested in comparing to it because we have different goals.

I think the comparisons are fair - both Architect and Serverless claim to be "Serverless frameworks". I could be in the minority though.

> Serverless is an abstraction between clouds. If mulitcloud is your goal: use Serverless.

I mean... you're not wrong, but that's grossly oversimplifying it. I've personally added support for Serverless AWS projects to allow hooking up Lambdas to Cognito User Pool triggers. That's a pretty solid AWS-only use-case, that likely isn't available on other cloud platforms (or at least, I never implemented it for them).

> SAM is a flavor of CF which is def less verbose but still very vendor specific and …wordy.

Well, isn't Architect vendor-specific as well?

> This isn't a 'pet framework of the month'. I do take mild offense to that.

Apologies for that remark. I'll be honest - I'm not really interested in the story behind the framework, I'm more interested in what it brings to the table. I'm glad your project worked for you and your company, and I wish it the best, but personally I don't see why Architect couldn't have just been a layer of syntax sugar over SAM/Serverless framework. If there was a killer feature that's specific to Architect, I can't see it (unless you count the file format as a feature).

(1) https://d1.awsstatic.com/whitepapers/architecture/AWS_Well-A...

Re: Architect – A Serverless Framework

#68
post #38

Earlier quoted context omitted.

Then use json5. Super weak excuse. Or use yaml or some other format and pipe it into some to-json converter. Also, json has json schema which tools like VS Code support. They can autocomplete your config. Pretty promising over most other tooling. But coming up with your own config has pretty much all the downsides. Yeah, you can invent some cuter syntax. But now your users can't even get syntax highlighting in their…

JSON5's support for unquoted keys seems like a misfeature. Not to mention that (by its nature) it has the same (lack of) support burden as any other new configuration format. If you're going to go through that frustration and incompatibility, why not pick something better suited to the job?

> JSON5's support for unquoted keys seems like a misfeature.

Seen plenty of JSON without quoted keys before that just seemed to work, so depends on parser.

Re: Architect – A Serverless Framework

#69

Earlier quoted context omitted.

There is a link, but it's buried in the middle of the second paragraph. There should really be another link in the call-to-action section at the bottom. I've wanted to try building something as a serverless architecture for a while, but every time I look into it I get confused by all the different things you have to set up to get an AWS Lambda function working, or I look into a framework but I can only find pre-canne…

Plug that I’m sure Brian won’t mind (he encouraged me to start a company a couple years ago): If you want to get started building serverless functions and APIs quickly, do it in your browser with https://code.xyz - we just released it along with an announcement of our most recent $2M in funding from Stripe [1] who join Slack and others as investors and customers. Disclaimer: I’m the founder. [1] https://stdlib.com/bl…

See, this is exactly the sort of thing I'm complaining about.

code.xyz gives some 'hello world' examples, but it doesn't even link to any docs--it just goes "look how easy it is! Here, sign in to our service!" I went hunting for the stdlib docs, and it took me five minutes to figure out how to call my service by HTTP--apparently I just get a special username.stdlib.io endpoint that I can call, but when I clicked 'Calling Services' the first thing I got was a page that explained how to use bearer tokens. I still don't know how I can POST to this endpoint, but I have learned that apparently stdlib has invented the concept of a 'source code' because apparently having a pre-canned Slack bot integration is super-important to any self-respecting FaaS provider. Also apparently I can find prebuilt 'source codes' in the 'stdlib registry', but the docs don't link to said registry, only the aforementioned Slack integration. At this point I gave up; I don't have the patience to learn a brand-new meaning for 'source codes' when all I want to do is make an API call when I get a webhook payload, which I already know how to do in a dozen lines of Python.

I realize this complaint sounds kind of harsh; you're getting a lot of my frustration dumped on you. Really all I want is basically a managed, autoscaled version of Express.js. Maybe there's some reason it's like this (I've never worked with anything that could be remotely described as 'at scale', it's mostly been line-of-business apps with a few dozen users maximum, or at most a web shop that still runs on a single dedicated server), but it seems like all of the Serverless providers add a bunch of extra concepts and confusion on top of what should really be a simple principle. Or maybe I'm completely misunderstanding the point of Serverless and it's actually intended to solve a completely different problem I've never had--I'm also open to that explanation instead!

Re: Architect – A Serverless Framework

#70

Earlier quoted context omitted.

It can be very expensive. I priced out two scenarios recently for an IoT solution. Using Lambda the cost would be $27,000k a month. Using a LB/EC2 solution with reserved instances the price was $60/month. (We also priced out IoT core, and it was $3,000k a month).

Can you share more details on this? We've just moved to Lambda and are paying approx $60/month for lambda where we were paying $260 on heroku. But then our db on AWS is another $110, where it's included in heroku. I know it will depend on your memory usage, etc. and as we grow, we expect to move to ec2, but I'm curious as to where/how you had such a huge difference in cost.

In our case the customer was interested in using Lambda as a proxy to handle logging data from a fleet. It involved a billion+ requests a month.
Post reply on HN