<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>qyv</author><text>&amp;gt; The problem when using REST &amp;quot;correctly&amp;quot; is that the way your objects interrelate is not necessarily the same way on the backend as it is on the UI. So you end up creating custom REST endpoints for complicated UI that does not map directly to how your objects are related in the database.&lt;p&gt;Not defending the article here, but I don&amp;#x27;t see this as a problem at all.  Yes, you API objects should not necessarily map directly to your persistence layer; that is a good thing.  The problem domains of the UI and the persistence layer are completely different and should therefore be modelled differently.  Your API mediates between the two, acting like a repository for your UI models and abstracting away the persistence layer completely.</text><parent_chain><item><author>jtchang</author><text>This article is a load of bullshit. When Facebook announced Relay it made immediate sense to me. The problem of fetching the right data from the backend is a pain in the ass for anyone that has built more than a simple todo app.&lt;p&gt;To me it is like sending a SQL query to the backend and instead of getting rows back you get objects nested in a way you specify.&lt;p&gt;The problem when using REST &amp;quot;correctly&amp;quot; is that the way your objects interrelate is not necessarily the same way on the backend as it is on the UI. So you end up creating custom REST endpoints for complicated UI that does not map directly to how your objects are related in the database.&lt;p&gt;This article has no substance in how they want to solve it besides just spouting &amp;quot;use REST correctly&amp;quot;.</text></item></parent_chain></comment><story><title>Facebook Relay: An Evil And/Or Incompetent Attack on REST</title><url>https://www.pandastrike.com/posts/20151015-rest-vs-relay</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>wheaties</author><text>As much as I agree about your argument, that&amp;#x27;s going to be a problem no matter how you do it. You will always run into an impedance mismatch. The problem is, which area should drive the solutions of another area? You&amp;#x27;ll never get a &amp;quot;good&amp;quot; answer.</text><parent_chain><item><author>jtchang</author><text>This article is a load of bullshit. When Facebook announced Relay it made immediate sense to me. The problem of fetching the right data from the backend is a pain in the ass for anyone that has built more than a simple todo app.&lt;p&gt;To me it is like sending a SQL query to the backend and instead of getting rows back you get objects nested in a way you specify.&lt;p&gt;The problem when using REST &amp;quot;correctly&amp;quot; is that the way your objects interrelate is not necessarily the same way on the backend as it is on the UI. So you end up creating custom REST endpoints for complicated UI that does not map directly to how your objects are related in the database.&lt;p&gt;This article has no substance in how they want to solve it besides just spouting &amp;quot;use REST correctly&amp;quot;.</text></item></parent_chain></comment><story><title>Facebook Relay: An Evil And/Or Incompetent Attack on REST</title><url>https://www.pandastrike.com/posts/20151015-rest-vs-relay</url></story>