graphql 有必要吗

Most web and mobile applications institute client — server communication. Acquired data are used in the app’s internal processes. Nevertheless, you must know that the beginnings were tough and didn’t provide any models of proceedings. Engineers tried to create a standard which would make the manner of communication more legible and easier to implement. Examples of such standards are REST and SOAP. Unfortunately, nothing in the world is perfect. REST is used most frequently being a main player and overtaking slightly older SOAP. However, years of using REST have shown its shortages which arose due to changes in the world of web and mobile applications. Main instigators of those alterations were mobile apps which constitute larger and larger market share.

大多数Web和移动应用程序都会建立客户端-服务器通信。 所获取的数据将在应用程序的内部流程中使用。 但是,您必须知道,起步艰难,没有提供任何诉讼程序模型。 工程师试图创建一个标准,使通信方式更清晰易懂且易于实施。 REST和SOAP是此类标准的示例。 不幸的是,世界上没有什么是完美的。 REST最常被用作主要角色,并取代了稍旧的SOAP。 但是,由于网络和移动应用程序世界的变化,使用REST的多年已经显示出它的不足。 这些改变的主要诱因是构成越来越大市场份额的移动应用程序

进步=新问题 (Progress = new problems)

Mobile devices have become a chief tool for using the internet resources, yet smartphones have limited computing power and memory. Although their efficiency is constantly rising, the level is still much lower than in laptops. Another constraint is the battery that always runs out too soon :). That’s why we want the apps to encumber batteries in the least. After initial analysis, it has been established that a triggering factor can be the amount of uploaded data. We send too much and not use enough of it.

移动设备已成为使用Internet资源的主要工具,而智能手机的计算能力和内存却有限。 尽管它们的效率不断提高,但水平仍然远远低于笔记本电脑。 另一个限制是电池总是会很快用完:)。 这就是为什么我们希望这些应用程序最少消耗电池电量。 经过初步分析,可以确定触发因素可以是上传数据的数量。 我们发送的邮件过多,使用不足。

Somebody had to come up with proper solutions. In 2012 Facebook app had a substantial user flow so the server — client data exchange was extremely large.

必须有人提出适当的解决方案。 2012年,Facebook应用程序拥有大量用户,因此服务器-客户端数据交换量非常大。

Facebook programmers decided to solve the problem by creating a new manner of communication which would limit the amount of sent data.

Facebook程序员决定通过创建一种新的通信方式来解决该问题,该方式将限制发送的数据量。

Appropriable reasons were:

适当的原因是:

  • higher usage of mobile apps移动应用程序的使用率更高
  • low power devices低功耗设备
  • impaired internet connection which makes it difficult to send larger data files互联网连接受损,这使得难以发送较大的数据文件

Technical reasons were:

技术原因是:

  • over-fetching过度获取
  • under-fetching提取不足
  • alterations generated in API RESTAPI REST中生成的更改

GraphQL —新解决方案(GraphQL — new solution)

So, what is this new Facebook tool? Actually, it’s a query language based on a type scheme created with API. Data is presented in the form of a graph — and that’s where the name came from. The solution was published in 2015 as an open source. Today, it’s developed and available in all popular programming environments. As opposed to REST, GraphQL uses one endpoint which provides all the server-side data. Decisions about the number and type of data are transferred to the client-side which means that the app decides what it wants to get from the server in this particular moment.

那么,这个新的Facebook工具是什么? 实际上,这是一种基于使用API​​创建的类型方案的查询语言。 数据以图形的形式呈现-这就是名称的来源。 该解决方案于2015年作为开源发布。 今天,它已经开发并在所有流行的编程环境中可用。 与REST相反,GraphQL使用一个提供所有服务器端数据的端点。 有关数据数量和类型的决策将传输到客户端,这意味着应用程序将决定在此特定时刻从服务器获取什么。

Major REST’s problem is a consistent scheme of acquired data. Example: App displays user’s name, so it downloads data from API. In REST, endpoint response has a consistent number of attributes compatible with the user’s data. In GraphQL, we are able to determine what we need from all the available data reducing the business of the response. In the presented example, what’s downloaded from the server is only the user’s name and nothing else. Using such a solution, programmers don’t have to modify the backend and create a special endpoint to provide only the user’s name.

REST的主要问题是获取数据的一致方案。 示例:应用程序显示用户名,因此它从API下载数据。 在REST中,端点响应具有与用户数据兼容的一致数量的属性。 在GraphQL中,我们能够从所有可用数据中确定我们需要什么,从而减少响应的业务量。 在给出的示例中,从服务器下载的只是用户名,而没有其他内容。 使用这种解决方案,程序员不必修改后端并创建特殊的端点即可仅提供用户名。

Solved technical problems:

解决了技术问题:

  1. Over-fetching过度获取

The problem lies in downloading data’s structure which consists of a large number of attributes. We have data that will be used in the application.

问题在于下载包含大量属性的数据结构。 我们有将在应用程序中使用的数据。

  1. Under-fetching提取不足

The problem is that downloaded data is insufficient. That’s why we have to send another query to the server and ask for additional data.

问题是下载的数据不足。 这就是为什么我们必须向服务器发送另一个查询并要求其他数据的原因。

In both cases in GraphQL we only download the data we currently need.

在GraphQL中,在这两种情况下,我们仅下载当前需要的数据。

API的变化 (Changes in API)

Created endpoints in REST approach have a defined structure. To download additional data, programmers have to modify existing endpoints or add supplemental ones to fulfill the needs of the client’s layer. Besides, the client’s layer is not resistant to unexpected changes in endpoints which can lead to instability of the app’s operation. This kind of process is an additional burden also for the client’s budget.

REST方法中创建的端点具有定义的结构。 要下载其他数据,程序员必须修改现有端点或添加补充端点,以满足客户层的需求。 此外,客户端的层无法抵抗端点中的意外更改,这可能导致应用程序操作不稳定。 这种过程对于客户的预算也是一个额外的负担。

加起来 (Summing up)

GraphQL approach solves basic problems and is used more and more frequently. Will it substitute the REST approach? Rather not, but it’s a stron alternative showing that some elements can be managed better.

GraphQL方法解决了基本问题,并且越来越多地被使用。 它会替代REST方法吗? 并非如此,但这是一个更可靠的选择,表明可以更好地管理某些元素。

Author: Marcin Starmach, Flutter Developer at Iteo

作者:Iteo的Flutter开发人员Marcin Starmach

翻译自: https://medium.com/@iteo/is-mobile-development-ready-for-graphql-9f5c6cc928a1

graphql 有必要吗


http://www.taodudu.cc/news/show-2953470.html

相关文章:

  • 转载:常用英文简写
  • 详解EBS接口开发之采购订单导入
  • OracleERP表结构--PO模块(1)
  • 在ASP.NET开发中一些单词的标准缩写
  • 移动应用ui设计模式pdf_移动ui了解应用ui设计的13种基本模式
  • 配置管理和变更管理_想要改善变更管理,消除对它的需要
  • Don‘t Cry Over Spilt Milk
  • 详解EBS接口开发之采购订单导入(转载)
  • 一些英文词的标准缩写
  • 【高等数学】二元函数的奇偶性与对称性
  • y=asin(wx+φ)的对称中心_函数y=Asin(wx+φ)的性质.ppt
  • 高斯分布的性质(含代码)
  • 激活函数以0为中心的好处
  • 公钥密码(非对称加密)
  • 高斯函数的性质
  • c语言中3次方函数图像,三次函数的性质
  • 抽象函数的对称性验证
  • 各类积分对称性详细总结
  • 拓扑的定义和性质
  • 点或积分区域的对称性,积分结果的对称性
  • 数字图像频谱的中心化
  • DFT的一些基本性质
  • y=asin(wx+φ)的对称中心_函数y=Asin(wx+φ)图像和性质
  • 中心对称图形——平行四边形·复习整理
  • 函数对称性常见公式_函数的各种对称性
  • 抽象函数性质归纳
  • 协方差及中心矩阵
  • 业务流程监控的几点建议
  • OA系统流程效率改进方案
  • 端到端流程解决方案

graphql 有必要吗_为graphql准备好移动开发了吗相关推荐

  1. graphql 嵌套查询_了解GraphQL中的查询

    graphql 嵌套查询 介绍 (Introduction) In this tutorial, we'll take an in-depth look at queries in GraphQL s ...

  2. laravel graphql php,结合 Laravel 初步学习 GraphQL

    本文字数:7134,大概需要14.27分钟. 按照官网所述的: A query language for your API一种用于 API 的查询语言 GraphQL is a query langu ...

  3. 微信公众号_订阅号+服务号开发工具包-翟东平-专题视频课程

    微信公众号_订阅号+服务号开发工具包-15114人已学习 课程介绍         "微信公众平台深度开发Java版 v2.0"系列课程共有6季,使用JAVA语言,系统讲解微信公众 ...

  4. 视频教程-企业微信支付JAVA版_向员工收款-微信开发

    企业微信支付JAVA版_向员工收款 微信企业号星级会员.10多年软件从业经历,国家级软件项目负责人,主要从事软件研发.软件企业员工技能培训.已经取得计算机技术与软件资格考试(软考)--"信息 ...

  5. 【源码+教程】Java学生成绩在线管理项目_Java实战项目_Java开源项目_Java毕设项目_Java毕业设计_计算机毕业设计_Java项目开发

    今天为大家带来的是Java实战项目--学生成绩在线管理,可以用来做毕业设计喔~源码和教程就在下方.请大家查收~[源码+教程]Java学生成绩在线管理项目_Java实战项目_Java开源项目_Java毕 ...

  6. graphql 有必要吗_您准备好观看GraphQL了吗?

    graphql 有必要吗 在上一篇文章中,我们讨论了GraphQL与REST相比的优势. 在本文中,我们将看到GraphQL的实际应用. 我创建了一个示例应用程序来展示REST和GraphQL之间的差 ...

  7. 前端工程师号称魔术师_使用graphql将rethinkdbs实时魔术带到前端

    前端工程师号称魔术师 In a recent post we explored how RethinkDB's built-in reactivity is a perfect fit to writ ...

  8. graphql是什么_为什么GraphQL是避免技术债务的关键

    graphql是什么 GraphQL (not to be confused with GraphDB or Open Graph or even an actual graph) is a rema ...

  9. 【.NET 遇上 GraphQL】使用 Hot Chocolate 构建 GraphQL 服务

    Hot Chocolate 是 .NET 平台下的一个开源组件库, 您可以使用它创建 GraphQL 服务, 它消除了构建成熟的 GraphQL 服务的复杂性, Hot Chocolate 可以连接任 ...

最新文章

  1. Java面试题之一 (转)
  2. python的GUI库PyQt5的使用
  3. 升级 90天 vs2008 在win2008下。
  4. python Pandas SettingwithCopy 警告解决方案
  5. 关于iis部署的一些小问题
  6. 为何出现Error Loading Midas.dll消息?
  7. 辰星计划2021 | 旷视春季实习生招募—空中宣讲会第二弹来了!
  8. Hive的安装【完整版】
  9. 一个入门的学生选课系统
  10. 我眼中的服务提供和服务消费
  11. 大数据后从此再无隐私_0-2输球后,恒大再迎2大坏消息,2项数据很尴尬,补时还后场倒脚...
  12. (轉貼) 如何解決MegaCore IP 6.0安裝時-6001的錯誤? (IC Design) (MegaCore)
  13. Android studio引入XUI
  14. 使用手机访问电脑上开发的html页面
  15. 零基础小白如何学习角色建模?这些流程步骤你一定要知道!
  16. 最大信息熵增益_信息熵(Entropy)、信息增益(Information Gain)
  17. 阿里云搭建svn服务器
  18. 获取token(/oauth/token)
  19. Sass函数-Miscellaneous函数(三元条件函数)
  20. 控制kobuki 运行一个矩形: 类的形式写ROS节点程序

热门文章

  1. PowerShell隐藏不显示窗口的多种方法
  2. function介绍
  3. 利用3D-DNA流程组装基因组
  4. Markdown - Emoji表情大全
  5. TravelFlan携小猴问问亮相ITB,看人工智能如何化解旅游痛点
  6. char与varchar详解
  7. 《通用数据保护条例》(GDPR)系列解读四:出海欧洲必须遵守的七大数据处理原则
  8. 碳监测能源消耗监测管理系统_碳排放在线监测管理系统_碳管理平台
  9. 流言粉碎机:JAVA使用 try catch会影响性能
  10. 民航运输服务与管理类毕业论文文献有哪些?