New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: POST to Fastboot #185
RFC: POST to Fastboot #185
Conversation
cc @tomdale I also think you've been working on some stuff related to this. |
Why is this an RFC in ember.js when the changes seem to be in FastBoot? I haven't read the RFC yet. |
@bcardarella Thanks, I'll read the RFC later today. FWIW, we had discussed about this a few weeks back in fastboot meeting. |
I'd be interested in the use case for this. What kind of server would that proxy be? Probably not Nginx or Apache but some sort of app server (Phoenix etc.)? If that server does generate the JSON that will be used by Ember Data in the FastBoot server then, that (potentially) results in pretty strong coupling between these 2 apps - might not be a problem in some cases but certainly sth. to keep in mind. As one of FastBoot's strengths is the fact that the app runs (more or less) the same way in the browser as well as in the FastBoot server, I'd like to carefully evaluate alternative solutions before changing that basic concept. I think the fact that FastBoot's core concept is pretty simple is hugely valuable (as opposed to other systems where the app when running in Node accesses the DB directly etc.). |
@marcoow it could be a Phoenix app, but yes anything that can access data directly. For many large companies this is a very likely scenario. Their infrastructure may be such that there are multiple layers the Fastboot app server needs to sit behind and cannot be directly exposed. Imagine apps where thousands of requests are happening per minute. This is the scale that is being discussed and the motivation behind reducing the additional round trip to external API. At this scale every ms counts. |
@kratiahuja do you have a link to those meeting notes? |
@bcardarella: I see. Is there any actual reason besides corporate rules to keep the FastBoot server behind the app server as opposed to in front of it? Since conceptually it's irrelevant whether the Ember app runs in the browser or the FastBoot server as they're using the same Data APIs the default setup should be to host the FastBoot server in the same zone that e.g. the Web server runs in, no? |
I think this is an oversimplification of the some of the infrastructure that some companies have to deal with. Single choke points where all traffic flows through is necessary for many companies. Exposing multiple app servers increases the surface area that ops teams have to be responsible for. |
Sure, I understand that. I'm just trying to better understand the use case and the requirements leading to it. Wouldn't the single server that all traffic flows through usually be sth. like Nginx with both the FastBoot and the app server sitting behind that as opposed to the app server sitting behind Nginx and the FastBoot server sitting behind the app server? In that case Nginx would most likely not have the data that the FastBoot server needs. I'm not sure I understand the scenario where sth. that has already loaded the data would pass the request on to the FastBoot server that would then have to load the data again. Does dockyard see setups where the app server sits between the web and the FastBoot server? |
I must be getting old, I don't know what this word is :p |
I thought it was short for something but might very well be wrong ;) What I meant was some sort of server. |
@bcardarella : https://usecanvas.com/fastboot/fastboot-meeting-notes-2016-10-21/3QXIJR79kIx8hW18iobUn9 (Read the point where I asked if FastBoot should support POST requests) |
@kratiahuja I'll have to check our fork but I don't believe this is the same functionality that I'm describing in this RFC |
@kratiahuja indeed @bcardarella's RFC is for a wholly different setup (fwiw it's also different than what I thought it was when he first described it to me, but I like the creativity of the solution and feel it's good architecture). the TL;DR is that there is a proxy/cache server in front of the fastboot server, let's call that When |
@runspired @bcardarella My sincere apologies in misunderstanding. I still haven't done my homework of reading the RFC fully 😞 I will make time to read this RFC this week. |
In the example where the web/app server sitting in front of the FastBoot server has access to a cache that already has all the data needed by the FastBoot server to render the requested route, wouldn't it be easier to request that cache from the FastBoot server (e.g. in an initializer or whatever) instead of from the web/app server that then sends it in the Don't want to seem like a destructive element in the conversation here - just like to express some concerns and explore alternative solutions. I guess the main problems I'm seeing with the suggested change are:
|
@marcoow I definitely appreciate the devil's advocate here. Important part of vetting the RFC :) Your points are well taken, but they are all architectural decisions that make sense when one is in a position to decide that architecture or when you are greenfielding. In some orgs this is not the case and the fastboot app is just one of many apps that may be managed. In this scenario the first server layer can play many roles and if one of those roles can be leveraged to improve the response time of the cycle then this is something that fastboot could support. |
Any updates on this? |
Seems like this is something that would be great to discuss in person at EmberConf? |
Isn't the entire purpose of RFC to discuss the issue? |
Good point actually ;) My take on this is I don't think it'd be great to support |
@marcoow Fastboot already accepts POST requests. This RFC simply is requesting to allow the POST request to expose the |
Sorry, correction. This is 2 LOCs. this.method = request.method
this.body = request.body added to the Fastboot service. |
it would go here: https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/services/fastboot.js#L13 The |
I've made a PR: ember-fastboot/ember-cli-fastboot#354 |
But it will only register its middleware for
I'd actually be fine with that. I don't think it's important to prevent people from using FastBoot for |
👏 😹 indeed. |
rendered