为您的网站提供动力的100种Jamstack工具,API和服务

We’ve explained the Jamstack, a popular new way to build secure, scalable, high-performance sites. Now we’ll introduce you to the tools, services, and APIs that power Jamstack sites.

我们已经解释了Jamstack ,这是一种构建安全,可扩展的高性能站点的流行新方法。 现在,我们将向您介绍为Jamstack网站提供支持的工具,服务和API。

The A in Jamstack stands for API. APIs can do anything for you, from sending a form to authenticating a user, or from storing and retrieving data in real time to shopping for products.

Jamstack中的A代表API 。 从发送表单到验证用户身份,或者从实时存储和检索数据到购买产品,API都能为您做任何事情

In this article, we’ll do an extensive review of existing APIs and how they compare to one another. This review couldn’t possibly encompass the whole spectrum of third-party APIs that you can integrate into your website, but hopefully you’ll still find the coverage enlightening enough.

在本文中,我们将对现有的API以及它们之间的比较进行广泛的审查。 这篇评论可能无法涵盖您可以集成到您的网站中的所有第三方API,但是希望您仍然能够找到足够有启发性的报道。

We’ll use the words “headless”, “detached”, and “serverless” a lot in this article. If you haven’t already, check out our introduction to the Jamstack, which covers all the basics.

在本文中,我们将大量使用“无头”,“分离”和“无服务器”一词。 如果还没有,请查看我们对Jamstack的介绍 ,其中介绍了所有基础知识。

托管(大部分免费) (Hosting (Mostly for Free))

Provided: Netlify

提供:Netlify

Hosting a Jamstack site usually involves automated deployment pipelines. For example, you might have a repository in GitHub which, on every push, automatically triggers an online deployment (via webhooks), running the necessary build tools (such as Jekyll) and regression tests (via Travis CI).

托管Jamstack站点通常涉及自动部署管道。 例如,您可能在GitHub中有一个存储库,该存储库在每次推送时都会自动触发在线部署(通过webhooks ),运行必要的构建工具 (例如Jekyll)和回归测试 (通过Travis CI)。

Sound difficult? It can be a surprisingly simple process!

听起来很难? 这可能是一个非常简单的过程!

Most of the services here include these goodies out of the box:

这里的大多数服务都包括以下现成的东西:

  • SSD drives

    SSD驱动器
  • CDN deployments

    CDN部署
  • free SSL (including for custom domains)

    免费SSL(包括自定义域)
  • command line deployments and rollbacks

    命令行部署和回滚

Note: look out for another article in this series, coming soon, covering how to use these services.

注意:请注意本系列的另一篇文章,即将发表,内容涉及如何使用这些服务。

服务 (Services)

Google Firebase和AWS Amplify (Google Firebase and AWS Amplify)

Firebase Hosting is Google’s take on a hosting service that’s easy to understand and implement, and it’s free to use (limits apply). Firebase’s backbone actually lies on top of the Google Cloud Platform (GCP), and you can in fact access and tweak some Firebase deployments through the GCP console. But by implementing something of an “gateway” (Firebase) that transparently handles GCP resources for us, Google gave developers a brand new and highly improved user experience (UX) … and the Firebase’s YouTube channel is just brilliant!

Firebase Hosting是Google的一项托管服务,它易于理解和实施,并且可以免费使用(有限制 )。 Firebase的主干实际上位于Google Cloud Platform (GCP)之上,实际上,您可以通过GCP控制台访问和调整某些Firebase部署。 但是,通过实施某种“网关”(Firebase)可以为我们透明地处理GCP资源,Google为开发人员提供了全新的,高度改进的用户体验(UX)… Firebase的YouTube频道真是太棒了!

AWS Amplify is also an effort to reduce the complexities of Amazon Web Services (AWS) for web and mobile deployment that doesn’t quite offer free hosting but 12 months of free use for new accounts for its Storage with Amplify as part of the AWS Free Tier.

AWS Amplify还致力于降低用于Web和移动部署的Amazon Web Services (AWS)的复杂性,该服务虽然不提供免费托管,但是12个月内免费使用其存储作为AWS Free的一部分为其新帐户免费使用层级 。

Google really made a brilliant move with the Firebase family of products by “detaching” them from the GCP, but Amazon went half-way with AWS Amplify. It sure is a dramatic improvement from the regular AWS workflow, especially for novice users, and its documentation hub is superb and way more down-to-earth than the way Amazon usually documents services. But Amplify is still accessed from the same old (horrifically bloated) console. You still need a credit card to just open an account, deployments are still region-specific (no built-in CDN, seriously?), and the workflow isn’t as straightforward when compared to that of Firebase or Netlify.

Google通过将Firebase产品从GCP中“分离”出来,确实在Firebase产品系列方面做出了杰出的贡献,但是Amazon在AWS Amplify方面走了一半。 它肯定比常规的AWS工作流程有了显着的改进,尤其是对于新手用户,并且与Amazon通常记录服务的方式相比,其文档中心是一流的,而且脚踏实地。 但是仍然可以从相同的旧(令人hor肿的)控制台访问Amplify。 您仍然只需要信用卡就可以开一个帐户,部署仍然是特定于区域的(真的没有内置CDN吗?),并且与Firebase或Netlify相比,工作流程并不那么简单。

GitHub页面和GitLab页面 (GitHub Pages and GitLab Pages)

Both hosting services for Git repositories also have a built-in service to host static pages right out of your codebases, 100% free: GitHub Pages and GitLab Pages.

两种针对Git信息库的托管服务还具有内置服务,可直接在您的代码库中托管静态页面,并且100%免费: GitHub Pages和GitLab Pages 。

In a future article we’ll cover how to use these services, but in the meantime make sure to check out these easy-to-follow guides:

在以后的文章中,我们将介绍如何使用这些服务,但与此同时,请务必查看这些易于遵循的指南:

  • Getting Started with GitHub Pages

    GitHub Pages入门

  • Hosting on GitLab.com with GitLab Pages

    使用GitLab页面在GitLab.com上托管

Netlify和Heroku (Netlify and Heroku)

In a very short period of time, Netlify not only coined the Jamstack term but also positioned itself as the place to go for all things static. While you could certainly accomplish more with an elaborated AWS pipeline, the simplicity and unparalleled ease of use that Netlify offers is unbeatable. Want to host a static site? Just drop it here and it’s online. Want automatic updates? Link a repo and just push a commit. And batteries are included — instant builds, worldwide CDN, free SSL, CLI tool, on-click rollbacks, and more.

在很短的时间内, Netlify不仅创造了Jamstack术语,而且将自己定位为静态所有事物的去处。 尽管您可以通过精心设计的AWS管道完成更多工作,但是Netlify提供的简单性和无与伦比的易用性是无与伦比的。 要托管一个静态网站吗? 只需将其放到这里 ,它就在线了。 想要自动更新? 链接一个仓库,然后推送一个提交。 包括电池-即时构建,全球CDN,免费SSL,CLI工具,单击回滚等。

Heroku is the only service in this list that allows you to host dynamic pages: Node.js, Ruby, Python, Java, PHP, Go, Scala and Clojure (check their Language Support page). So if you aren’t yet quite ready to go static, this might be a good way to test your dynamic sites online for free.

Heroku是此列表中唯一允许您托管动态页面的服务:Node.js,Ruby,Python,Java,PHP,Go,Scala和Clojure(请查看其语言支持页面)。 因此,如果您还没有准备好静态化,那么这可能是免费在线测试动态站点的好方法。

其他服务 (Other Services)

With 194 data centers as of 2020, Cloudflare is — by many metrics — the company that offers the lowest latency for their DNS and CDN services around the world. They serve big companies but also have a number of services oriented to developers, like Workers Sites. The service isn’t free ($5/mo minimum charge) but it’s as top performant as you can get, and fairly easy to use.

截至2020年, Cloudflare拥有194个数据中心,从许多指标来看,该公司为全球DNS和CDN服务提供了最低的延迟。 他们为大公司提供服务,但也有面向开发人员的大量服务,例如Workers Sites 。 该服务不是免费的(最低费用为$ 5 / mo),但它是您所能获得的最高性能,并且易于使用。

Other tools targeted at static pages include Aerobatic, which offers a free trial with no credit card required and support for internationalization (i18n) and full-text search built-in plugins; Surge.sh with npm run scripts and CI services; and Vercel (formerly ZEIT Now) with an Edge Network serving big names such as Twilio and The Washington Post.

针对静态页面的其他工具包括Aerobatic ,它提供了无需信用卡的免费试用版,并且支持国际化(i18n)和全文本搜索内置插件 ; 具有npm的 Surge.sh 运行脚本和CI服务 ; 和Vercel (以前称为ZEIT Now),其边缘网络服务于Twilio和The Washington Post等知名企业。

比较方式 (Comparison)

Service Free plan Easy-of-use Tooling
Aerobatic 1 month easy good
Firebase Hosting yes easy very good
GitHub Pages completely free easy poor
GitLab Pages completely free easy good
Heroku yes somewhat easy very good
Netlify yes extremely easy very good
Storage with Amplify 1-year (new accounts) somewhat easy very good
Surge.sh yes easy good
Vercel yes easy good
Workers Sites no somewhat easy good
服务 免费计划 易用的 工装
特技飞行 1个月 简单
Firebase托管 简单 很好
GitHub页面 完全免费 简单 较差的
GitLab页面 完全免费 简单
Heroku 有点容易 很好
Netlify 非常容易 很好
放大存储 1年(新帐户) 有点容易 很好
Surge.sh 简单
Vercel 简单
工地 没有 有点容易

存储和检索数据:实时NoSQL数据库 (Storing and Retrieving Data: Real-time NoSQL Databases)

NoSQL solutions like MongoDB have been coexisting with relational databases like MySQL for some time (see the differences and how to choose), but real-time processing takes NoSQL to the next level by enabling cloud storage for state management, such as a user entering their name or clicking a radio button.

诸如MongoDB之类的NoSQL解决方案已经与诸如MySQL之类的关系数据库共存了一段时间(请参阅区别和选择方法 ),但是实时处理通过为状态管理启用云存储(例如用户输入他们的用户)将NoSQL提升到一个新的水平。名称或单击单选按钮。

If you’re familiar with Redux and Vuex — React and Vue.js libraries for state management, respectively — think of integrating that concept with a cloud storage provider.

如果您熟悉Redux和Vuex (分别用于状态管理的React和Vue.js库),请考虑将该概念与云存储提供商集成。

服务 (Services)

Amazon DynamoDB is a “fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications”. But as with many things AWS, it’s difficult to implement and very hard to debug (see Why Amazon DynamoDB isn’t for everyone, by Forrest Brazeal). In all fairness to Amazon, they also built DataStore into AWS Amplify (with GraphQL and REST API support) with a more straightforward approach, in line with the simplicity of the rest of Amplify’s products.

Amazon DynamoDB“具有内置安全性,备份和还原以及适用于Internet规模应用程序的内存缓存的完全托管,多区域,多主数据库,持久数据库” 。 但是,与AWS一样,它很难实现且很难调试(请参阅Forrest Brazeal的《 为什么Amazon DynamoDB不适合所有人 )》。 为了公平起见,与Amplify其余产品的简单性相一致 ,他们还以更直接的方法将DataStore内置到AWS Amplify中(具有GraphQL和REST API支持)。

Google Firestore made real-time NoSQL databases — a fairly complex topic in and of itself — as simple as they can be, with pretty much all the capabilities DynamoDB has. It’s very well documented (with introductory clips that are fun to watch). And React and Vue.js have wrappers around Firestore with react-redux-firebase and Vuexfire, respectively.

Google Firestore利用DynamoDB几乎具有的所有功能,使实时NoSQL数据库(本身就是一个相当复杂的话题)变得尽可能简单。 它的文档非常齐全 (带有有趣的入门剪辑 )。 React和Vue.js在Firestore周围分别使用react-redux- firebase和Vuexfire进行包装。

Cloudflare sure knows how to take performance to the very extreme, and Workers KV, a serverless key-value storage for applications, is a fine example of what a well engineered product looks like. The premise of Workers KV is that you can access a key as if it were a local file within your app, and the content will be the value stored for that key. That’s it — no API to implement, no extra coding. And because of the unbeatable performance of the Cloudflare CDN, this approach can actually be faster than querying a NoSQL database. And as simple as it is, it scales seamlessly to millions of requests.

Cloudflare肯定知道如何将性能发挥到极致,而Workers KV (一种用于应用程序的无服务器键值存储)就是精心设计的产品的一个很好的例子。 Workers KV的前提是您可以像访问应用程序中的本地文件一样访问密钥 ,并且内容将是为该密钥存储的 。 就是这样-没有要实现的API,没有额外的编码。 而且由于Cloudflare CDN的无与伦比的性能,这种方法实际上比查询NoSQL数据库要 。 它非常简单,可以无缝扩展到数百万个请求。

And finally, there’s FaunaDB, a startup that crafted a solution with native GraphQL and a simple pricing (including a free plan) that can be implemented in minutes.

最后,还有FaunaDB ,这是一家初创公司,可以使用本机GraphQL和简单的定价 (包括免费计划)制定解决方案,并且可以在几分钟内实现。

管理内容:无头CMS (Managing Content: Headless CMS)

In the “monolithic” way of doing things, whenever we used a given content management system — such as WordPress, Django, or Joomla! — it meant that we also needed to use the front-end engine that came attached to it, as back and front end were “coupled” components of a single piece of software (see our introduction to the Jamstack for more info about tightly vs loosely coupled sites).

每当我们使用给定的内容管理系统 (例如WordPress,Django或Joomla)时,就以“整体”的方式进行工作! —这意味着我们需要使用附加到它的前端引擎,因为后端和前端是单个软件的“耦合”组件(有关紧密和松散的更多信息,请参阅我们的Jamstack简介 。 耦合网站)。

Enter the headless CMS — a back end only without a front end. Since a headless CMS would normally expose an API or generate static content in the way of Markdown or HTML files, the front end can be anywhere really. In fact, multiple and simultaneous interfaces can be created for web sites, mobile apps, and Internet of Things (IoT) apps.

输入无头CMS-仅后端,而没有前端。 由于无头CMS通常会以Markdown或HTML文件的方式公开API或生成静态内容,因此前端实际上可以在任何地方 。 实际上,可以为网站,移动应用程序和物联网(IoT)应用程序创建多个同时接口。

产品和服务 (Products and Services)

There are a number of headless CMSs, both as software you can download and configure where you do the deployments yourself, or offered in the software-as-a-service (SaaS) model where everything is taken care of for you.

有许多无头CMS,既可以下载软件并配置自己的部署位置,也可以在软件即服务(SaaS)模型中提供,以确保您一切顺利。

Some features you can expect to find:

您可以期望找到的一些功能:

  • localization (l10n) and internationalization (i18n)

    本地化(l10n)和国际化(i18n)

  • microservices architecture with a RESTful API

    具有RESTful API的 微服务架构

  • editor interface

    编辑器界面
  • customization

    客制化
  • versioning*

    版本控制 *

* Since some headless CMS will integrate smoothly with your git repo, the versioning capability can actually be a remarkable improvement over a regular CMS.

* 由于某些无头CMS可以与您的git repo顺利集成,因此版本控制功能实际上是对常规CMS的显着改进。

自托管无头CMS (Self-hosted Headless CMS)

Ghost, “the #1 open source headless Node.js CMS”, is certainly the one with the most stars on GitHub. Not only can Ghost handle content, but it also offers a number of integrations to manage payments (Stripe), email lists (MailChimp), shopping (Shopify), and many more. And then there’s Ghost(Pro), which is the official managed hosting for Ghost with commercial support.

Ghost“#1开源无头Node.js CMS” ,无疑是GitHub上星级最多的人 。 Ghost不仅可以处理内容,而且还提供了许多集成来管理付款(Stripe),电子邮件列表(M​​ailChimp),购物(Shopify)等。 然后是Ghost(Pro) ,它是具有商业支持的Ghost的官方托管主机。

Fairly close to Ghost in popularity comes Strapi, with REST and GraphQL APIs, and 1-click deployments on Heroku, AWS, and DigitalOcean. It has “starters” (template projects) to work seamlessly with Gatsby, Vue.js with Nuxt.js, React with Next.js, and Angular. It also runs on Node.js and has support for a number of database engines.

相当接近普及幽灵来Strapi ,休息和GraphQL API和1次点击部署在Heroku上,AWS和DigitalOcean。 它具有“启动器”(模板项目),可与Gatsby,Vue.js与Nuxt.js,React与Next.js和Angular无缝协作。 它还可以在Node.js上运行,并支持许多数据库引擎 。

Netlify CMS is also a popular option built as a single–page React app. There’s Directus, which wraps custom SQL databases with an API and provides an intuitive admin app to manage its content, and the commercial companion Directus Cloud. There’s also TinaCMS, which is also React-based, and Ponzu, Copckpit, and many more, which you can explore oin the comprehensive list provided by headlesscms.org.

Netlify CMS还是作为单页React应用程序构建的流行选项。 有Directus和商业配套的Directus CloudDirectus使用API​​包装自定义SQL数据库并提供直观的管理应用程序来管理其内容。 还有TinaCMS (也基于React)以及PonzuCopckpit等 ,您可以在headlesscms.org提供的完整列表中进行浏览。

SaaS无头CMS (SaaS Headless CMS)

CloudCannon is the cloud CMS for Jekyll (we’ll review Jekyll later in the “static site generators” section), with smooth integration with GitHub, Bitbucket and Dropbox. They have a free plan as well but with no global CDN hosting.

CloudCannonJekyll的云CMS (我们将在稍后的“静态站点生成器”部分中回顾Jekyll),并与GitHub,Bitbucket和Dropbox进行了平滑集成。 他们也有免费计划 ,但没有全球CDN托管。

Contentful is something different: a content hub where business owners, marketers, developers and project managers can all go to set and manage all of the data sources of an organization. And their headless CMS is just a part of that strategy. The Contentful platform is fully featured, very well documented, with plenty of open-source tools. And while the pricing is a bit confusing, there’s actually a free plan that only requires attribution.

满足性与众不同:内容中心是企业所有者,市场营销人员,开发人员和项目经理可以在其中设置和管理组织的所有数据源的地方。 他们无头的CMS只是该策略的一部分 。 内容丰富的平台功能齐全 , 文档 齐全 , 并带有大量开源工具 。 虽然定价有些混乱,但实际上有一个免费计划,只需要注明出处即可 。

There are other SaaS headless CMSs with free plans, such as DatoCMS and Sanity with a proposition similar to that of Contentful; Forestry, with support for a number of static generators; GraphCMS, with GraphQL support; and Prismic. These are just a few of the many options.

还有其他具有免费计划的SaaS无头CMS,例如DatoCMSSanity的主张与Contentful相似。 林业 ,支持许多静态发电机; GraphCMS ,具有GraphQL支持; 和棱镜 。 这些只是众多选择中的几个。

发送信息:不带代码的表格 (Sending Information: Forms without Code)

Sending data through forms has forever been one of the main uses for server-side processing. There are essentially two approaches to addressing this problem on a static site, each with pros and cons.

通过表格发送数据一直以来都是服务器端处理的主要用途之一。 本质上,有两种方法可以在静态站点上解决此问题,每种方法各有利弊。

来自构建者,嵌入式和托管表单 (From Builders, Embedded and Hosted Forms)

Many times integrating a “powered by” external form is more than enough to collect email addresses or to receive feedback.

很多时候集成一个“由...提供支持”的外部表单足以收集电子邮件地址或接收反馈。

Google Forms have offered this possibility since 2008 entirely for free, with a simple interface that stores submissions on Google Sheets, and that can send alerts via email every time there’s a submission.

自2008年以来, Google表单就完全免费提供了这种可能性,其简单的界面将提交的内容存储在Google表格中 ,并且每次提交时都可以通过电子邮件发送警报。

Formstack takes forms to another level by providing an integrated workflow supporting digital signatures, document generation, Salesforce integration, and more. They offer a free tryout but no free plans.

Formstack通过提供支持数字签名,文档生成,Salesforce集成等的集成工作流,将表单提升到另一个层次。 他们提供免费试用,但没有免费计划 。

Then you have the extremely easy-to-use form builders JotForm and Wufoo, which integrate handling payments, among other things, or Typeform, which makes forms and surveys … pretty? All of them offer free plans.

然后,您将拥有非常易于使用的表单构建器JotFormWufoo ,它们集成了处理付款等功能,或者还有Typeform ,它使表单和调查变得漂亮……? 他们都提供免费计划。

外部API:表单处理即服务(FPaaS) (External API: Form Processing as a Service (FPaaS))

Sometimes a builder won’t cut it, as you need more flexibility to present information and fields, or to fully integrate the look and feel of the form with the rest of your website. For this you will need to integrate an API.

有时,构建者不会削减它,因为您需要更大的灵活性来呈现信息和字段,或者将表单的外观和感觉与网站的其余部分完全集成。 为此,您将需要集成一个API。

The way these services work is surprisingly easy: you specify a URL for submission that will do the processing for you. At most you’ll have to set a few things up but most probably won’t need to do any extra coding.

这些服务的工作方式非常简单:您指定要提交的URL,该URL将为您进行处理。 最多,您必须进行一些设置,但是最有可能不需要做任何额外的编码。

There are a number of providers offering free plans, such as Form.IO, Formcarry, Formspark, and Netlify Forms. They all work in a similar way and are very easy to implement.

有许多提供免费计划的提供商,例如Form.IOFormcarryFormsparkNetlify Forms 。 它们都以类似的方式工作,并且非常容易实现。

FormDen and FormKeep are also form builders that can otherwise be used just as back ends, though none of them offer free plans.

FormDenFormKeep 也是表单生成器,可以用作后端,尽管它们都不提供免费计划。

编程服务器端逻辑:功能即服务(FaaS) (Programming Server-Side Logic: Function as a Service (FaaS))

Couldn’t find an API that does quite what you want? Create it! You don’t need to resort back to a hosted back-end system to process server-side logic, with all the hassle that comes with it (maintenance, bills, credentials, security patches). Instead, you can implement a micro-service in your language of choice (oftentimes JavaScript, Python, or Go), encapsulate that logic into functions, and offer them through a RESTful API.

找不到符合您想要的功能的API? 创造它! 您无需借助托管的后端系统来处理服务器端逻辑,它附带了所有麻烦(维护,账单,凭证,安全补丁程序)。 相反,您可以使用自己选择的语言(通常是JavaScript,Python或Go)实现微服务,将该逻辑封装到函数中,然后通过RESTful API提供它们。

As with pretty much everything else in this list, you won’t be paying anything for a function that’s not being actively used, so no worries for just leaving it sitting there (but beware that spikes in traffic might also trigger extra billing).

与该列表中的几乎所有其他内容一样,您不会为未被积极使用的功能支付任何费用,因此不必担心将其留在那儿(但请注意,流量高峰还会触发额外的计费)。

提供者 (Providers)

While the implementation details for AWS Lambda, Azure Functions and Google Cloud Functions may differ, they all work in pretty much the same fashion and you’ll need a degree of familiarity with AWS, Azure or GCP. AWS Lambda has the richest language support of them all (and also Amazon API Gateway to help you wrap your functions into a maintainable API with monitoring tools), while Azure — not surprisingly — has the best support for .NET Framework and .NET Core (with different versions supporting different runtimes and even TypeScript transpiled to JavaScript). But be aware that Azure systematically ranks as the slowest service by a margin.

尽管AWS LambdaAzure函数Google Cloud Functions的实现细节可能有所不同,但它们的工作方式几乎相同,并且您需要对AWS,Azure或GCP有一定程度的了解。 AWS Lambda拥有对所有语言的最丰富的语言支持(以及Amazon API Gateway ,可通过监视工具帮助您将功能包装到可维护的API中),而Azure(毫不奇怪)对.NET Framework和.NET Core的最佳支持(具有支持不同运行时的不同版本 ,甚至是转换为JavaScript的TypeScript )。 但是请注意,Azure有系统地被列为最慢的服务。

Cloud Functions for Firebase and Netlify Functions are wrappers around Google Cloud Functions and AWS Lambda, respectively. They greatly simplify the management of functions on the cloud, as you effectively can get away without even having an account on such services. Code deployment and versioning become trivial with Netlify — which also has very good community support — as it will smoothly integrate with your repo offering stage, previewing, and rolling back at a click (or a commit). Simplicity naturally comes at the expense of losing some flexibility (see Firebase Cloud Functions: the great, the meh, and the ugly by Pier Bover).

用于FirebaseNetlify Functions的Cloud Functions分别是Google Cloud Functions和AWS Lambda的包装。 它们极大地简化了云功能的管理,因为您甚至无需在此类服务上就可以有效地逃脱。 Netlify(也具有很好的社区支持)使代码部署和版本控制变得无关紧要,因为它将与您的回购提供阶段,预览和单击(或一次提交)回滚顺利地集成在一起。 自然而然地,以牺牲灵活性为代价(请参阅Firebase Cloud Functions: Pier Bover的功能,优点和缺点)。

IBM Cloud Functions (based on Apache OpenWhisk) and Cloudflare Workers are other services you might want to look at. IBM has an impressive list of supported languages, including the option to deploy Docker containers with your own runtime. However, it ranked somewhat poorly performance wise. And just as Netlify systematically manages to make things the simplest, Cloudflare again makes things the fastest (and by a difference).

IBM Cloud Functions (基于Apache OpenWhisk )和Cloudflare Workers是您可能需要查看的其他服务。 IBM提供了令人印象深刻的受支持语言列表,其中包括可以在自己的运行时部署Docker容器的选项。 但是,它在性能方面排名较差。 就像Netlify设法使事情最简单一样,Cloudflare又使事情最快(并且有所不同 )。

比较方式 (Comparison)

service languages overhead* coldstart* difficulty support
AWS Lambda C#, Go, Java, JavaScript, PowerShell, Python, Ruby 86 ms 589 ms high very good
Azure Functions C#, F#, Java, JavaScript and TypeScript, PowerShell, Python 760 ms 5,907 ms high very poor
Cloud Functions for Firebase JavaScript and TypeScript 642 ms 168 ms low very good
Cloudflare Workers JavaScript, COBOL 70 ms 76 ms intermediate intermediate
Google Cloud Functions Go, Java, Node.js, Python 642 ms 168 ms high very good
IBM Cloud Functions .C#, Go, Java, JavaScript, PHP, Python, Ruby, Swift, and Docker containers 136 ms 2,103 ms high no info
Netlify Functions Go, Node.js 86 ms 589 ms very low very good
服务 语言 高架* 冷启动* 困难 支持
AWS Lambda C#,Go,Java,JavaScript,PowerShell,Python,Ruby 86毫秒 589毫秒 很好
Azure功能 C#,F#,Java,JavaScript和TypeScript,PowerShell,Python 760毫秒 5,907毫秒 很差
Firebase的云功能 JavaScript和TypeScript 642毫秒 168毫秒 很好
Cloudflare工人 JavaScript的 , COBOL 70毫秒 76毫秒 中间 中间
Google Cloud功能 Go,Java,Node.js,Python 642毫秒 168毫秒 很好
IBM Cloud功能 .C#,Go,Java,JavaScript,PHP,Python,Ruby,Swift和Docker容器 136毫秒 2,103毫秒 暂无信息
网络化功能 转到 Node.js 86毫秒 589毫秒 非常低 很好

* As measured by λ Serverless Benchmark, the overhead is the time from request to response without the time the function took (for a concurrency of 50), and the coldstart is how long the servers takes to respond when queried are spanned every 3 hours; the lower the values, the better.

* 根据λ无服务器基准测试 , 开销是从请求到响应的时间,而不是功能花费的时间(并发数为50),而冷启动是每3小时查询一次服务器响应所花费的时间; 值越低越好。

验证用户:身份即服务 (Authenticating Users: Identity as a Service)

Identity as a Service (IDaaS), also called sometimes Authentication as a Service (AaaS), involves managing a full user registration, confirmation, and authentication with just APIs. The Geist of “stateless authentication” is that a user will authenticate against a third-party and come back to you with a valid “token” that you can verify, or revoke if need be.

身份即服务(IDaaS),有时也称为身份验证即服务 (AaaS),涉及仅使用API​​管理完整的用户注册,确认和身份验证。 “无状态身份验证”的精神是,用户将针对第三方进行身份验证,并使用有效的“令牌”返回给您,您可以验证该令牌,或者在需要时撤销该令牌。

In some cases, a provider might even offer a “drop-in” user interface (UI) that will work seamlessly across desktop and mobile, all of which could potentially save you very long hours of work.

在某些情况下,提供商甚至可能会提供“插入式”用户界面(UI),该界面可在台式机和移动设备之间无缝运行,所有这些都可能节省您长时间的工作。

服务 (Services)

Auth0 has been in business the longest and has quickstart guides for a number of scenarios. It’s an excellent provider if you want to implement a complex solution and already have some experience implementing authentication. But as they point out, “identity is complex, deal with it”. The large scope Auth0 services (universal login, single sign on (SSO), multifactor authentication, branch password detection, and so on) can be overwhelming if you’re just starting on the topic.

Auth0的营业时间最长,并且针对许多情况提供了快速入门指南 。 如果您想实施复杂的解决方案并且已经具有实施身份验证的经验,那么它是出色的提供商。 但是正如他们指出的那样, “身份很复杂,要加以处理” 。 如果您只是从这个主题开始,那么范围广泛的Auth0服务(通用登录,单点登录(SSO),多因素身份验证,分支密码检测等)可能会让人不知所措。

Firebase Authentication (with its ready-to-use UI) and Authentication with Amplify are also very comprehensive and flexible, and somewhat presented in a more straightforward manner than Auth0. Firebase also offers anonymous authentication! Curious? Check out this clip:

Firebase身份验证 (具有立即可用的UI )和带Amplify的身份验证也非常全面和灵活,并且比Auth0更为直观。 Firebase还提供匿名身份验证! 好奇? 查看此剪辑:

Once again, Netlify seems to come up with the easiest solution to implement with Netlify Identity and its open-source zero config netlify-identity-widget to create a secure login in 10 minutes! But of course, there are some limitations (check out Four Dealbreakers in Netlify Identity, by Jean Cochrane).

再一次,Netlify似乎提出了最简单的解决方案,可以用Netlify Identity及其开源零配置netlify-identity-widget实施,以在10分钟内创建安全登录 ! 但是,当然有一些限制(请查看Jean Cochrane的《 Netlify Identity中的四个Dealbreakers》 )。

You can also check Okta, FusionAuth and LoginRadius, all of which have free plans. There are no freebies for Ping Identity, OneLogin, and Ubisecure, which are more oriented to the enterprise sector. Finally, consider Cloudflare Access, as everything Cloudflare does is rock solid.

您还可以检查OktaFusionAuthLoginRadius ,所有这些都有免费计划。 没有针对Ping Identity , OneLogin和Ubisecure的赠品,这些赠品更面向企业领域。 最后,考虑Cloudflare Access ,因为Cloudflare所做的一切都是坚如磐石。

走向F·A·S·T:静态网站生成器(SSG) (Going F·A·S·T: Static Site Generators (SSG))

I can hear some of you saying “all of this might be okay for future projects, but my sites are already dynamic, so what to do?” Here’s when static site generators enter the picture.

我可以听到一些人说: “所有这些对于将来的项目都可以,但是我的网站已经处于动态状态,该怎么办?” 这是静态网站生成器输入图片的时间。

You can have the best of both worlds — the convenience of a familiar CMS and static pages with code and data splitting, preloading, caching, image optimization, and all sorts of performance enhancements. An SSR will bridge that gap by querying your database and generating static output out of it (for example, Markdown pages), and with some settings to set your template, you’ll be all set.

您可以两全其美-熟悉的CMS 静态页面的便利性, 以及 代码和数据拆分 , 预加载 ,缓存,图像优化以及各种性能增强功能。 SSR将通过查询数据库并从数据库中生成静态输出(例如Markdown页面)来弥合差距,并通过一些设置来设置模板,您将一切就绪。

The listing here is tiny compared to the ever increasing list of SSRs. Have a look at StaticGen for more info.

与不断增加的SSR列表相比,这里的清单很小 。 看看StaticGen以获得更多信息。

主要产品 (Main Products)

GatsbyJS is powered by React.js and webpack, meaning that it can generate progressive web apps (aka PWAs, websites that look and feel like an apps). It also supports GraphQL (see Write Apps with Better Building Blocks) and it has +1,000 plugins to get data from anywhere (WordPress, Drupal, Contentful, GraphCMS, DatoCMS, and many more). See how GatsbyJS says it compares to its main competitors, Hugo and Jekyll.

GatsbyJS由React.js和webpack提供支持,这意味着它可以生成渐进式Web应用程序(又名PWA,外观和感觉像应用程序的网站)。 它还支持GraphQL(请参阅使用更好的构建块编写应用程序 ),并具有+1,000个插件,可从任何地方 (WordPress,Drupal,Contentful,GraphCMS,DatoCMS等) 获取数据 。 了解GatsbyJS如何与主要竞争对手Hugo和Jekyll进行比较 。

All of this flexibility comes at a cost, as setting and customizing GatsbyJS can be a time-consuming process, and if you don’t have a decent understanding of React — and therefore JavaScript — you won’t be able to make much of it. That’s where Gatsby Cloud comes in, offering support to build and maintain Gatsby sites for free or for a fee, where you could automate your fast builds, access to previews, generate daily edits, and fire deployments with ease to Netlify, Cloudflare, AWS CloudFront or Akamai.

所有这些灵活性都需要付出一定的代价,因为设置和自定义GatsbyJS可能是一个耗时的过程,而且如果您对React和JavaScript缺乏体面的了解,那么您将无法做很多事情。 那就是Gatsby Cloud的来历,它提供了免费或收费构建和维护Gatsby站点的支持,您可以在其中自动化快速构建,访问预览,生成每日编辑以及轻松部署Netlify,Cloudflare,AWS CloudFront的部署或Akamai。

Hugo claims to be “the world’s fastest framework for building websites”, and it sure can generate massive sites in milliseconds. With built-in templates (literally hundreds of them available) and native support for internationalization (i18n), it’s also one of the most popular SSGs. Hugo is a Go app, and while Go isn’t hard to set and learn, you’ll definitely need to be checking the documentation often if you aren’t familiar with it.

Hugo声称是“世界上构建网站最快的框架” ,并且可以在几毫秒内生成大量网站。 凭借内置的模板(几乎有数百个模板可用 )和对国际化的本地支持(i18n),它也是最受欢迎的SSG之一。 Hugo是一个Go应用程序 ,虽然Go的设置和学习并不困难,但是如果您不熟悉它,那么肯定需要经常检查该文档。

Unlike GatsbyJS, configuring and deploying Jekyll is a rather straightforward process. Furthermore, Jekyll is the only SSR supported by GitHub Pages (Tom Preston-Werner, creator of Jekyll, is also a co-founder of GitHub), and can smoothly deploy static sites for free right out of your GitHub repos! Jekyll uses Shopify’s Liquid template language, which is also easy to learn. The downsides? As a Ruby app, Jekyll can be hard to set on a Windows environment, and optimizations such as minimizing JavaScript code and image preloading aren’t included by default. In fact, Jekyll doesn’t even aim at generating a PWA but just purely static sites — which might still be fine depending on what you need.

与GatsbyJS不同,配置和部署Jekyll是一个相当简单的过程。 此外,Jekyll是GitHub Pages支持的唯一SSR(Jekyll的创建者Tom Preston-Werner,也是GitHub的共同创始人),并且可以从GitHub存储库中免费顺畅地免费部署静态站点! Jekyll使用Shopify的Liquid模板语言 ,该语言也很容易学习。 不利之处? 作为Ruby应用程序 ,Jekyll很难在Windows环境中设置,并且默认情况下不包括诸如使JavaScript代码最小化和图像预​​加载之类的优化。 实际上,Jekyll甚至不打算生成PWA,而仅仅是生成静态站点,根据您的需要,这仍然可以。

比较方式 (Comparison)
Product Language Templating Setting GitHub stars
GatsbyJS JavaScript React.js difficult
Hugo Go Go (library) intermediate
Jekyll Ruby Liquid easy
产品 语言 模板化 设置 GitHub明星
盖茨比 JavaScript React.js
雨果 去( 图书馆 ) 中间
杰基尔 Ruby 液体 简单

其他 (Others)

WP2Static is an SSR designed specifically for WordPress (WP). It has a small but very interesting set of plugins, like Algolia search, and Cloudflare Workers and Netlify deployments. HardyPress is actually a SaaS solution to generate static WP sites, and for a fee you’ll have an admin panel from where you can enter some credentials to access your online WP installations to manage everything: shut down live WP installs that were already imported, transparent deployment to global a CDN, HTTPS, forms, search. Other WP-related SSGs with commercial support are Shifter, Strattic, and Sitesauce.

WP2Static是专门为WordPress(WP)设计的SSR。 它有一组很小但非常有趣的插件 ,例如Algolia搜索,Cloudflare Workers和Netlify部署。 HardyPress实际上是一种生成静态WP网站的SaaS解决方案,您需要付费才能获得一个管理面板,从中可以输入一些凭据来访问在线WP安装,以管理所有内容:关闭已导入的实时WP安装,透明部署到全局CDN,HTTPS,表单,搜索。 其他具有商业支持的与WP相关的SSG包括ShifterStratticSitesauce

Since I am admittedly biased towards Vue.js, I had to include VuePress, which is intended to generate single page applications (SPAs) and has a minimal setup with markdown-centered files, and it’s also powered by webpack. Gridsome and Nuxt.js are more featured Vue.js powered frameworks with SSR capabilities.

由于我确实偏向于Vue.js ,因此我不得不包括VuePress ,它旨在生成单页应用程序(SPA),并且具有以markdown为中心的文件的最小设置,并且还由webpack提供支持 。 GridsomeNuxt.js是具有SSR功能的功能更强大的Vue.js框架。

销售和处理付款:无头购物车 (Selling and Processing Payments: Headless Shopping Carts)

The architecture and benefits of headless ecommerce is not that different from that of a headless CMS: massive cost reduction (hosting, licenses, maintenance), less time to market, seamless integration, and — a big one for commerce — “omnichannel” capabilities.

无头电子商务的体系结构和优势与无头CMS的体系结构和优势没有什么不同:大量降低了成本(托管,许可证,维护), 缩短了上市时间 ,无缝集成以及“全渠道 ”功能(这对商业而言是一个很大的优势 )。

Headless shopping carts are substantially different from services like Shopify, as you aren’t bound to a storefront and you can move data around to a variety of media and from a variety of sources. A headless ecommerce provider is not opinionated on how you present your content or access your data and has no control over it.

无头购物车与Shopify之类的服务有很大不同,因为您不必局限于店面,并且可以将数据移动到各种媒体和各种来源。 无头的电子商务提供商对您如何呈现内容或访问数据没有意见,并且无法控制它们。

Precisely this is what enables an omnichannel strategy, in which you can not only deliver content to multiple channels (web, mobile, IoT) but also centralize the processes management across different channels for a holistic, improved UX. Mind you, studies by Harvard Business Review and Aspect Software have shown that such strategies provide a significant edge over the “multi channel” or “online alone” approach.

正是这正是启用全渠道策略的原因,在该策略中,您不仅可以将内容交付到多个渠道(Web,移动,IoT),而且可以跨不同渠道集中进行流程管理,以实现整体改进的UX。 请注意, 哈佛商业评论和Aspect Software的研究表明,这种策略在“多渠道”或“仅在线”方法上具有明显优势。

服务 (Services)

Foxy.io and Snipcart provide a simple service that’s ridiculously easy to integrate into a number of formats. Foxy.io is subscription-based, whereas Snipcart charges a percentage of transactions.

Foxy.ioSnipcart提供了一种简单的服务,非常容易将其集成为多种格式。 Foxy.io是基于订阅的 ,而Snipcart收取一定百分比的交易 。

At a more corporate level, Elastic Path offers headless ecommerce services for the automotive, manufacturing and healthcare industries, among others. And Salesforce Commerce Cloud leverages the Salesforce platform into headless ecommerce for business-to-consumer (B2C) and business-to-business (B2B).

在企业层面上, Elastic Path为汽车,制造业和医疗保健行业等提供无端的电子商务服务。 而且, Salesforce Commerce Cloud利用Salesforce平台将无头电子商务应用于企业对消费者(B2C)和企业对企业(B2B)。

查找所需内容:即服务搜索 (Finding What You Want: Search as a Service)

Web search can also be integrated in our websites via search as a service, letting a third-party do the indexing and sorting of the results for us.

网络搜索可以通过搜索即服务集成到我们的网站中,让第三方为我们完成结果的索引和排序。

Google Custom Search (and its rebranding as Programmable Search Engine) was a pioneer in this field, but while very easy to use and implement, it didn’t integrate well with the look and feel of the site, and the search results depended on what Google previously indexed.

Google自定义搜索 (及其更名为Programmable Search Engine )是该领域的先驱,但是虽然易于使用和实施,但它与网站的外观和风格并不能很好地集成在一起,并且搜索结果取决于Google以前已建立索引。

There’s Elasticsearch with managed solutions like Amazon Elasticsearch Service, and other AI-powered services like Azure Cognitive Search, Amazon Kendra and Amazon CloudSearch, and Apache Solr. And they’re all excellent and will yield excellent results if well implemented. But that’s precisely the problem — implementation. It takes quality time and skills to craft a solution that actually works.

Elasticsearch拥有托管解决方案,例如Amazon Elasticsearch Service ,以及其他基于AI的服务,例如Azure Cognitive Search , Amazon Kendra和Amazon CloudSearch以及Apache Solr 。 而且它们都非常出色,如果实施得当,它们将产生出色的结果。 但这正是问题所在–实施。 制定切实可行的解决方案需要花费大量的时间和技巧。

产品展示 (Products)

Algolia is the one service that took integrated search to another level with its ultra fast Search API that can be used in a number of situations (site, voice, geo, mobile, ecommerce, media, and more). It offers a generous free “Community” plan.

Algolia是一项通过其快速Search API将集成搜索提升到另一个层次的服务,该API可用于多种情况 (站点,语音,地理,移动,电子商务,媒体等)。 它提供了一个慷慨的免费“社区”计划 。

Klevu and Sooqr Search are search solutions specifically targeted at ecommerce, to make it easier to connect shoppers with the products you have to offer. Sooqr offers a free plan for up to 100 unique products, while Klevu doesn’t.

KlevuSooqr Search是专门针对电子商务的搜索解决方案,可以更轻松地将购物者与您提供的产品联系起来。 Sooqr提供了多达100种独特产品的免费计划,而Klevu则没有。

Expertrec and Swiftype are other services you might want to check for site and app search. No free plans, though.

ExpertrecSwiftype是您可能要检查站点和应用搜索的其他服务。 不过,没有免费计划。

保持最新:通知 (Staying Up to Date: Notifications)

Having a strategy to communicate across a number of channels is key to stimulating user engagement, and yet it’s even better to combine them in a programmatic way with a single API to send messages across all platforms.

制定跨多个渠道进行交流的策略是激发用户参与度的关键,但将它们以编程方式与单个API组合以跨所有平台发送消息则更好。

There are essentially four complimentary pathways you can use:

您基本上可以使用四种互补途径:

  • Mobile push is a highly visible way to send (hopefully) relevant messages so that users go back to your app.

    移动推送是发送(希望)相关消息的一种高度可见的方式,以便用户返回到您的应用程序。

  • Web push follows the same principle but for desktop and mobile browsers.

    Web推送遵循相同的原理,但适用于台式机和移动浏览器。

  • In-App messages are yet another way to retain subscribers, providing assistance your users might need.

    应用内消息是保留订户的另一种方法,可为用户提供所需的帮助。

  • And Email, because even in 2020 and with all of the IMs and social apps, email marketing is still a thing.

    还有电子邮件 ,因为即使在2020年以及所有IM和社交应用程序中,电子邮件营销仍然是一件大事。

服务 (Services)

Have you ever heard that most people think they’re above average? Seems like companies fall into bias as well, as OneSignal, Pushwoosh and Truepush all proclaim themselves as the “#1 push notifications service”. In any case, they all have generous free plans (and a lot of marketing insights to get out of the data you send through them), with OneSignal having more integrations to offer.

您是否听说过大多数人认为自己高于平均水平 ? 似乎公司也陷入了偏见, OneSignalPushwooshTruepush都宣称自己是“#1推送通知服务” 。 无论如何,它们都有大量免费的计划(以及大量的营销见解,以使您摆脱通过它们发送的数据),而OneSignal可以提供更多的集成 。

You can also check Airship, Catapush, Leanplum, Pushover, and many more …

您还可以检查飞艇CatapushLeanplum推倒 , 和 许多 更多 ...

Also, if you’re already using Google Firebase, you might want to have a look at Cloud Messaging and In-App Messaging. Likewise, for AWS Amplify, check Push Notifications.

另外,如果您已经在使用Google Firebase,则可能需要查看Cloud MessagingApp-In Messaging 。 同样,对于AWS Amplify,请检查“ 推送通知”

附加:通过分析获取见解 (Extra: Getting Insights with Analytics)

Google Analytics for Firebase is something of a Google Analytics wrapper for the mobile, and also for a simplified web experience. It’s managed from the user-friendly Google Firebase console.

Google Analytics for Firebase是用于移动设备的Google Analytics(分析)包装,也是一种简化的网络体验。 通过用户友好的Google Firebase控制台进行管理 。

Netlify Analytics really has an edge here. It’s so simple to set up that there’s actually no setup! The one requirement to use the service (aside from paying the $9/mo fee per site) is that you already host your site in Netlify. With that, they already have all the information they need “right from the source of truth” to present you with the stats — no JavaScript code, no cookies, no pixels tracking needed. While this doesn’t scale to mobile apps like Google Analytics for Firebase does, it offers better performance (no impact on the render time) and more accurate numbers (session runs on the server, not on the client).

Netlify Analytics在这里确实具有优势。 设置非常简单 ,实际上没有任何设置! 使用该服务的一个要求(除了为每个站点支付$ 9 / mo的费用外)是您已经在Netlify中托管了站点。 这样一来,他们已经拥有了“从真相出发”所需的所有信息可以为您提供统计信息-无需JavaScript代码,无需Cookie,无需跟踪像素。 虽然它不能像Google Analytics for Firebase那样扩展到移动应用程序,但是它提供了更好的性能(不影响渲染时间)和更准确的数字(会话在服务器上运行,而不是在客户端上运行)。

Analytics with Amplify is Amazon’s approach to a service that works in pretty much the same fashion as Google Analytics for Firebase, working on Android, iOS and the Web.

带有Amplify的Analytics(分析)是Amazon的一种服务方法,其工作方式与Android,iOS和Web上的Google Analytics for Firebase几乎相同。

结论(或为什么要为自己可以发展的东西付费?) (Conclusions (or Why Pay for Something You Could Develop Yourself?))

If you’ve got this far, you’ve probably noticed that most of the services we’ve covered can be used for free up to a point — which is generally when your site or app takes off. So why not develop your own search or authentication solution, or manage your own server and create ad-hoc notifications that are exactly what you need?

如果您已经了解到了这一点,则可能已经注意到,我们涵盖的大多数服务都可以免费使用到一定程度(通常是在您的网站或应用起飞时)。 那么,为什么不开发自己的搜索或身份验证解决方案,或者管理自己的服务器并创建恰好需要的临时通知呢?

Well, here’s a question: have you noticed that even huge corporations with the finest IT departments that money can buy also use these services?

好吧,这是一个问题:您是否注意到,即使拥有资金最雄厚的IT部门的大型公司也可以使用这些服务?

  • Twitch uses Algolia

    Twitch使用Algolia
  • Spotify and Airbnb use GatsbyJS

    Spotify和Airbnb使用GatsbyJS
  • Atlassian uses Auth0

    Atlassian使用Auth0
  • Netflix uses CloudCannon

    Netflix使用CloudCannon
  • Alibaba uses Firebase

    阿里巴巴使用Firebase
  • Mozilla uses Ghost

    Mozilla使用Ghost
  • pretty much everyone uses AWS and Cloudflare

    几乎每个人都使用AWS和Cloudflare
  • … and so on, and so on

    … 等等等等

The ultimate question is — are you really going to save money and/or have more control by shifting your resources and focus into solving a problem that isn’t the core of your business, and that somebody with a more qualified team has already solved? If so, by all means go for it! Or else you can accept the price tag, forget about that one problem, and move on to the next one.

最终的问题是- 您是否 真的会节省金钱和/或通过转移资源并专注于解决不是您的业务核心的问题,并且已经拥有一支更胜任的团队的人来解决问题而拥有更多控制权? 如果是这样,一定要去! 否则,您可以接受价格标签,而不必理会这个问题,然后继续进行下一个问题。

Jamstack基金会 (Jamstack Foundations)

Get up to speed with the Jamstack. Our Jamstack Foundations collection helps you take your first steps into the Jamstack and beyond, and we’re adding to it constantly. We’ll bring you the tutorials you need to become a pro. You can always refer to our index as it’s updated at the end of our Introduction to the Jamstack:

赶紧使用Jamstack。 我们的Jamstack Foundations系列可帮助您迈入Jamstack及其它领域之外的第一步,并且我们会不断对其进行补充。 我们将带给您成为专业人士所需的教程。 您可以随时参考我们的索引,因为它在Jamstack简介的末尾进行了更新:

➤ Jamstack Foundations

➤Jamstack基础

翻译自: https://www.sitepoint.com/jamstack-tools-services-apis/

你可能感兴趣的:(电子商务,java,编程语言,entity,google)