{"componentChunkName":"component---src-templates-blog-detail-tsx","path":"/blog/2020-05-11-scf-layer-practice","result":{"data":{"currentBlog":{"id":"13c6d4ce-80d3-50b2-8670-125074e036ee","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020514/1589461771804-layer.jpg","authors":["Alfred"],"categories":["guides-and-tutorials"],"date":"2020-05-11T00:00:00.000Z","title":"如何借助 Layer 实现云函数快速打包轻松部署","description":"层的功能为依赖库和不经常修改的静态文件提供了新的存储方案，与函数的剥离使得这类文件能够多函数复用，版本化管理；随着层功能的发展，腾讯云 Serverless team 也将进一步拓展层功能的使用","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["Serverless","layer"],"keywords":"Serverless 全局变量组件,Serverless 单独部署组件,Serverless Component","outdated":null},"wordCount":{"words":286,"sentences":34,"paragraphs":34},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-05-11-scf-layer-practice.md","fields":{"slug":"/blog/2020-05-11-scf-layer-practice/","keywords":["python","serverless","云函数","函数","绑定","cmq","requests","依赖","代码"]},"html":"<p><strong>在使用云函数进行项目开发的时候，当函数数量变多后，您是否遇到函数的依赖库的管理问题？</strong></p>\n<p>由于云函数在创建或更新时，需要将函数的业务代码，和依赖库一同打包上传，因此在本地开发时，也经常是将依赖库和业务代码放置在一个文件夹下。</p>\n<p><strong>在这种情况下</strong></p>\n<p>每个云函数的代码目录下均有一套依赖库代码，而这其中有很多在若干个函数中都是重复的，不但占用了大量的空间，而且管理麻烦，在某些依赖库需要进行升级时，要进入到每个函数项目中去检查依赖关系和升级操作。</p>\n<p>另一方面，这些依赖库通常不会有大的变动，但是却需要在每次函数进行更新时，都要和业务代码一同打包上传，导致实际的代码更新可能就一两行，但是需要生成一个十几兆甚至几十兆的包去上传，在网络环境不好的情况下还需要忍受缓慢的上传速度。</p>\n<h2 id=\"解决方案来了\"><a href=\"#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E6%9D%A5%E4%BA%86\" aria-label=\"解决方案来了 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>解决方案来了</h2>\n<p>近期，腾讯云的 SCF 云函数推出了层功能，是为了这类不经常变动的依赖库或静态文件而准备的产品功能。</p>\n<p>通过使用层功能来存储及管理依赖库，并在使用时按需与函数进行绑定，就可以实现依赖库的多函数共享，仅需上传一份，就可以在多个要使用到的函数中绑定并引用。</p>\n<p>通过与云函数绑定的使用方式，也就意味着不需要在云函数的业务代码中再附上相应的依赖库了，可以将业务代码和依赖库分开进行管理和部署，降低云函数每次上传时需要提交的包大小，加快上传更新的速度。</p>\n<h2 id=\"层功能介绍\"><a href=\"#%E5%B1%82%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D\" aria-label=\"层功能介绍 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>层功能介绍</h2>\n<p><img src=\"https://img.serverlesscloud.cn/2020511/1589168582373-%E6%88%AA%E5%B1%8F2020-05-11%20%E4%B8%8A%E5%8D%8811.42.24.png\"></p>\n<p>层作为一个和云函数独立的资源，有独立的创建、管理流程。和函数创建类似，可以通过上传 zip 包，或者控制台上选择文件夹，或者将 zip 包提前上传 cos 后再引用的方式，来将文件内容提交到云上，并创建好层。每一个提交到层中的文件包，都将生成一个新的版本。</p>\n<p>因此，在创建好一个层以后，就将具有了第一个版本；而后续如果依赖库或文件内容有升级，可以继续更新层，并生成新的版本，版本号依次增大。在创建层，或发布新版本的时候，还可以指定当前层所可支持的 runtime，这样相应 runtime 的函数，才可以浏览或绑定当前层。</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020511/1589168582380-%E6%88%AA%E5%B1%8F2020-05-11%20%E4%B8%8A%E5%8D%8811.42.24.png\"></p>\n<p>在使用层时，通过云函数与具体层的具体版本绑定，来实现层内容的引入和使用。在函数的配置管理界面，新增加了层的绑定配置界面。通过选择层及期望绑定的版本，就可以完成绑定操作。绑定了层以后，在函数运行时，运行环境中的 /opt 目录下就会有层的内容。当然，系统中的 NODE_PATH，PYTHONPATH 已经指定好了 /opt 目录，绑定好的层中如果包含有依赖库，在函数代码中可以直接通过 import，require 等方法直接引用，与常规写法一致，不需要额外进行路径的指定。同时，目前一个函数支持最多绑定 5 个层的版本，因此可以通过这种方法，将所需的依赖库分别引入到层中。</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020511/1589168581412-%E6%88%AA%E5%B1%8F2020-05-11%20%E4%B8%8A%E5%8D%8811.42.24.png\"></p>\n<p>在多个层绑定到同一个函数时，层之间有一定的顺序关系。层是按照顺序关系依次加载的，如果在相同路径下有同名文件，会产生后加载的文件覆盖先加载文件的问题，需要在此处注意多个层绑定时是否会有内容覆盖，以及加载循序是否是按自身的控制需要来的。另一方面，层与函数的绑定关系，也作为函数的配置保存。$LATEST版本的函数可以按需修改调整绑定配置，而一旦发布版本后，生成的函数版本中的配置就固定了，无法再次修改。因此，通过发布版本来固化已经开发完成的版本，可以避免函数代码或层内容的修改导致的代码不可用。</p>\n<p><img src=\"https://img.serverlesscloud.cn/2020511/1589168581362-%E6%88%AA%E5%B1%8F2020-05-11%20%E4%B8%8A%E5%8D%8811.42.24.png\"></p>\n<h2 id=\"层功能的使用\"><a href=\"#%E5%B1%82%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8\" aria-label=\"层功能的使用 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>层功能的使用</h2>\n<p>在这个案例中，我们将实现一个拨测网站，并在检测到异常时发送消息到 cmq 消息队列中的云函数。这个云函数由 python 写成，将使用两个依赖库，requests 库用来实现 url 地址的 http 访问检测，及 cmq 库用来实现向 cmq 的队列发送消息。</p>\n<p>在创建函数前，我将使用这两个库分别创建两个层，并在后续将函数与这两个层绑定来使用依赖库。</p>\n<p>首先在本地分别创建两个文件夹：  <code class=\"language-text\">requests-lib</code> 和 <code class=\"language-text\">cmq-lib</code>，通过命令行进入 <code class=\"language-text\">requests-lib</code> 文件夹后，执行命令</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\"> pip install requests -t</code></pre></div>\n<p>在此目录下完成 requests 库的下载安装。而在 cmq-lib 文件夹内，我们通过下载或 clone <a href=\"https://github.com/tencentyun/cmq-python-sdk\">https://github.com/tencentyun/cmq-python-sdk</a> 项目，将 cmq 的 sdk 下载到本地。</p>\n<p>接下来，使用这两个文件夹分别创建两个层，同样命名为 <code class=\"language-text\">requests-lib</code> 和 <code class=\"language-text\">cmq-lib</code>，通过直接选择文件夹创建，并选择好适配 runtime 为 python2。在创建完成两个层后，他们都具有版本 1可供函数绑定。</p>\n<p>同时，我在相同地域下也创建好了名字为 <code class=\"language-text\">testq</code> 的 cmq 队列，并根据 sdk 需要准备好了账号 id，secret id，secret key 等信息。</p>\n<p><strong>接下来，我将使用如下代码创建函数 detect-sendmsg，实现 url 的拨测，并向 cmq 消息队列中发送消息</strong></p>\n<p>代码中的 appid、secretid、secretkey，需要替换为自身账号下的相关内容。</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\"># -*- coding: utf8 -*-\nimport json\nimport logging\nimport os\n\nfrom cmq.account import Account\nfrom cmq.cmq_exception import *\nfrom cmq.topic import *\nimport requests\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\n\nprint(&#39;Loading function&#39;)\n\nappid = 1252724xxx #please change to your appid. Find it in Account Info\nsecretId = &#39;AKIDkkxxxxxxxxxxxxxxx&#39; #please change to your API secret id. Find it in API secret key pair\nsecretKey = ‘xxxxxxxxxxxxxxxxxx&#39; #please change to your API secret key. Find it in API secret key pair\nregion = u&#39;gz&#39;\nendpoint = &#39;https://cmq-queue-gz.api.qcloud.com&#39;\n\nmy_account = Account(endpoint, secretId, secretKey)\nmy_account.set_log_level(logging.INFO)\nqueue_name = &#39;testq&#39;\nmy_queue = my_account.get_queue(queue_name)\n\ntest_url_list = [\n    &quot;http://www.baidu.com&quot;,\n    &quot;http://www.qq.com&quot;,\n    &quot;http://cloud.tencent.com&quot;,\n    &quot;http://unkownurl.com&quot;\n]\n\n\ndef test_url(url_list):\n    errorinfo = []\n    for url in url_list:\n        resp = None\n        try:\n            resp = requests.get(url,timeout=3)\n        except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, requests.exceptions.ConnectTimeout) as e:\n            logger.warn(&quot;request exceptions:&quot;+str(e))\n            errorinfo.append(&quot;Access &quot;+ url + &quot; timeout&quot;)\n        else:\n            if resp.status_code &gt;= 400:\n                logger.warn(&quot;response status code fail:&quot;+str(resp.status_code))\n                errorinfo.append(&quot;Access &quot;+ url + &quot; fail, status code:&quot; + str(resp.status_code))\n    if len(errorinfo) != 0:\n        send_msg(&quot;拨测异常通知:&quot;+&quot;\\r\\n&quot;.join(errorinfo))\n\ndef send_msg(msg_body):\n    try:\n        logger.info(&quot;send msg&quot;+msg_body)\n        msg = Message(msg_body)\n        ret_msg = my_queue.send_message(msg)\n    except CMQExceptionBase as e:\n        logger.warn(&quot;Send msg to queue Fail! Exception:%s\\n&quot; % e)\n        raise e\n\ndef main_handler(event, context):\n    test_url(test_url_list)\n    return “finish&quot;</code></pre></div>\n<p>使用此代码创建好函数，并在函数的层管理中，分别绑定好 requests-lib、cmq-lib 两个层。由于这两个层没有重复部分，因此可以以任意顺序绑定。</p>\n<p>完成绑定后，可以直接通过控制台触发函数，查看运行情况。一切正常的情况下，可以看到拨测的过程，以及消息发送到消息队列中的记录。同时，也可以到消息队列的对应 queue 中，通过获取消息，获取到发送到其中的消息记录。</p>\n<p><strong>从这个例子中可以看到</strong></p>\n<p>函数代码中应用了 requests 库，和 cmq 的 sdk，但并未通过和函数一同打包上传来实现，而是将依赖库放置到层里面后，通过绑定关系来引用。通过这种方式，如果下次我们启动一个新的函数也需要使用到 requests 库，直接与已有的层绑定即可使用，而同样不需要再次打包上传。而函数代码仅一个文件，不需要带有较大的依赖库，也可以降低每次更新上传时的包大小，甚至直接快速的使用 WebIDE 来进行编辑就行。</p>\n<p>层的功能为依赖库和不经常修改的静态文件提供了新的存储方案，与函数的剥离使得这类文件能够多函数复用，版本化管理；随着层功能的发展，腾讯云 Serverless team 也将进一步拓展层功能的使用，包括了在开发工具中实现自动化的层创建和绑定、层的共享、提供公共层供用户直接复用等，都已经在 roadmap 中，将在接下来的发展中逐步落地，供云函数的开发体验更加便利。</p>\n<blockquote>\n<p>回放：点击观看 <a href=\"https://cloud.tencent.com/edu/learning/live-2437\">Tencent Serverless Hours 线上分享会第一期</a></p>\n</blockquote>\n<hr>\n<div id='scf-deploy-iframe-or-md'></div>\n<hr>\n<blockquote>\n<p><strong>传送门：</strong></p>\n<ul>\n<li>GitHub: <a href=\"https://github.com/serverless/serverless/blob/master/README_CN.md\">github.com/serverless</a></li>\n<li>官网：<a href=\"https://serverless.com/\">serverless.com</a></li>\n</ul>\n</blockquote>\n<p>欢迎访问：<a href=\"https://serverlesscloud.cn/\">Serverless 中文网</a>，您可以在 <a href=\"https://serverlesscloud.cn/best-practice\">最佳实践</a> 里体验更多关于 Serverless 应用的开发！</p>","tableOfContents":"<ul>\n<li><a href=\"/blog/2020-05-11-scf-layer-practice/#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E6%9D%A5%E4%BA%86\">解决方案来了</a></li>\n<li><a href=\"/blog/2020-05-11-scf-layer-practice/#%E5%B1%82%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D\">层功能介绍</a></li>\n<li><a href=\"/blog/2020-05-11-scf-layer-practice/#%E5%B1%82%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%BF%E7%94%A8\">层功能的使用</a></li>\n</ul>"},"previousBlog":{"id":"38503518-dfcb-58ff-8b5a-f545d5459e6b","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020518/1589791111276-node12%E5%89%AF%E6%9C%AC.jpg","authors":["Wes"],"categories":["guides-and-tutorials"],"date":"2020-05-12T00:00:00.000Z","title":"云函数 SCF Node.js Runtime 最佳实践","description":"如何使用腾讯云云函数来开发 Node.js 应用以及云函数的 Node.js runtime 实现原理","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["Node.js","云函数"],"keywords":"Serverless,scf,Node.js","outdated":null},"wordCount":{"words":313,"sentences":54,"paragraphs":54},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-05-12-nodejs-runtime.md","fields":{"slug":"/blog/2020-05-12-nodejs-runtime/","keywords":["java","serverless","spa","云函数","函数","异步","callback","返回","Node","event","context"]}},"nextBlog":{"id":"f14c4bf2-d4d4-572e-ae97-d51f1d8ac773","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/202058/1588940051457-%E4%BC%9A%E5%90%8E%E5%AE%A3%E4%BC%A0banner.png","authors":["Serverless 社区"],"categories":["news"],"date":"2020-05-09T00:00:00.000Z","title":"回顾 | Tencent Serverless Hours 线上分享会第一期","description":"5 月 8 日（周五）15:00 举办的 Tencent Serverless Hours 第一期线上分享会如期举行！","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["Serverless","Meetup"],"keywords":"Serverless;Serverless Framework;Tencent Serverless","outdated":null},"wordCount":{"words":155,"sentences":25,"paragraphs":25},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-05-09-tencent-serverless-hours.md","fields":{"slug":"/blog/2020-05-09-tencent-serverless-hours/","keywords":["python","serverless","云函数","分享","腾讯","serverlesscloud","serverless","Node"]}},"recommendBlogs":{"edges":[{"node":{"id":"665f9ce2-4451-59fd-bf98-1861789d3b3b","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/Serverless_logo.png","authors":["AndreaPasswater"],"categories":["guides-and-tutorials","engineering-culture"],"date":"2018-03-19T00:00:00.000Z","title":"如何为无服务器开放源代码项目做贡献","description":"想要为无服务器开放源代码项目做贡献？您可以遵循下面的指南。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":96,"sentences":36,"paragraphs":36},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-19-how-contribute-to-serverless-open-source.md","fields":{"slug":"/blog/2018-03-19-how-contribute-to-serverless-open-source/","keywords":["serverless","无服务器","serverless","github","插件","服务器","贡献","示例","blog","contribute"]}}},{"node":{"id":"a3e92579-65c3-5159-937c-32d18c5df7d7","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/why-not/why-not-header.png","authors":["AndreaPasswater"],"categories":["guides-and-tutorials","operations-and-observability","engineering-culture"],"date":"2018-03-21T00:00:00.000Z","title":"不适合选择无服务器的情境及原因","description":"无服务器既有优点也有缺点。那么，哪些情境下不适合选择无服务器？原因又是什么呢？","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":163,"sentences":43,"paragraphs":43},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-21-when-why-not-use-serverless.md","fields":{"slug":"/blog/2018-03-21-when-why-not-use-serverless/","keywords":["faas","react","serverless","spa","无服务器","无服务器函数","无服务器架构","无服务器开发","服务器","twitter","serverless","blockquote","lang","script","en"]}}},{"node":{"id":"6a16520b-7886-582e-9182-64e50712d486","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/vendor+choice/serverless-data-portability.jpg","authors":["NickGottlieb"],"categories":["engineering-culture","guides-and-tutorials"],"date":"2018-06-20T00:00:00.000Z","title":"浅谈无服务器、数据锁定和供应商选择","description":"供应商选择是如今 IT 领导者需要考虑的最重要事项，而这一点可利用数据可移植性来实现。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":205,"sentences":33,"paragraphs":33},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-06-20-data-lockin-vendor-choice-portability.md","fields":{"slug":"/blog/2018-06-20-data-lockin-vendor-choice-portability/","keywords":["go","serverless","无服务器","无服务器架构","供应商","serverless","开发人员","数据","锁定","选择","服务"]}}},{"node":{"id":"94741abb-10ba-5db1-9756-cd1d573473fa","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/webstorm-ide/streamline-webstorm-serverless2.jpg","authors":["EslamHefnawy"],"categories":["guides-and-tutorials","engineering-culture"],"date":"2018-08-15T00:00:00.000Z","title":"如何使用 WebStorm 简化无服务器工作流程","description":"在本文中，我将和您分享如何使用 WebStorm 进行无服务器特定的 IDE 设置以及如何利用它来极大地加快无服务器工作流程。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":234,"sentences":54,"paragraphs":54},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-08-15-streamline-serverless-workflow-webstorm.md","fields":{"slug":"/blog/2018-08-15-streamline-serverless-workflow-webstorm/","keywords":["nodejs","serverless","无服务器","无服务器开发","serverless","WebStorm","webstorm","服务器","blog","assets"]}}},{"node":{"id":"713a0563-4bf9-5721-bacb-3b4ef609fe4a","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/camp-fire/camp-fire-housing-thumb.jpg","authors":["EricWyne"],"categories":["guides-and-tutorials","user-stories"],"date":"2018-12-05T00:00:00.000Z","title":"Serverless Twitter 机器人帮助为坎普山火受灾者安置住房","description":"加利福尼亚州的坎普山火致使数千人流离失所，为此，我构建了一个简单的 Serverless Twitter 机器人来帮助将受灾者安置在临时住房！","authorslink":["https://serverless.com/author/ericwyne/"],"translators":["Aceyclee"],"translatorslink":["zhihu.com/people/Aceyclee"],"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":157,"sentences":26,"paragraphs":26},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-12-05-serverless-twitter-camp-fire.md","fields":{"slug":"/blog/2018-12-05-serverless-twitter-camp-fire/","keywords":["serverless","无服务器","云函数","Serverless","org","住房","Twitter","函数","受灾","机器人","山火"]}}},{"node":{"id":"17c972d9-0583-51f6-9d5d-c2ba5f21b6a3","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/20191227/1577409288454-v2-577c2b21d600e3ea07f156f3e9d2d6b8_1200x500.jpg","authors":["Alfred Huang"],"categories":["guides-and-tutorials"],"date":"2019-08-21T00:00:00.000Z","title":"Serverless 的运行原理与组件架构","description":"本文重点探讨下开发者使用 Serverless 时经常遇到的一些问题，以及如何解决","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["运行原理","serverless"],"keywords":"Serverless 运行原理,Serverless 组件架构","outdated":null},"wordCount":{"words":236,"sentences":33,"paragraphs":33},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-08-21-serverless-operation-architecture.md","fields":{"slug":"/blog/2019-08-21-serverless-operation-architecture/","keywords":["koa","serverless","云函数","Serverless","用户","函数","请求","实例","形态","业务","serverlesscloud"]}}},{"node":{"id":"ae4fd2f8-515c-5aec-b584-38427ef33f7e","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020114/1578989800047-part-00492-780.jpg","authors":["Anycodes"],"categories":["guides-and-tutorials","user-stories"],"date":"2019-09-16T00:00:00.000Z","title":"突破传统 OJ 瓶颈，「判题姬」接入云函数","description":"通过 Serverless 实现在线编程","authorslink":["https://www.zhihu.com/people/liuyu-43-97"],"translators":null,"translatorslink":null,"tags":["在线编程","云函数"],"keywords":"Serverless 在线编程,Serverless OJ","outdated":null},"wordCount":{"words":169,"sentences":30,"paragraphs":30},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-09-16-online-Judge.md","fields":{"slug":"/blog/2019-09-16-online-Judge/","keywords":["python","serverless","云函数","代码","函数","serverless"]}}},{"node":{"id":"545ab3d2-e14e-5cc2-8548-0e863eac942b","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.blog.serverless.com/2019-10-deployment-best-practices/safeguard-header.png","authors":["FernandoMedinaCorey"],"categories":["guides-and-tutorials"],"date":"2019-10-14T00:00:00.000Z","title":"无服务器部署最佳实践","description":"了解部署无服务器应用时的一些最佳实践。","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":221,"sentences":46,"paragraphs":46},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-14-serverless-deployment-best-practices.md","fields":{"slug":"/blog/2019-10-14-serverless-deployment-best-practices/","keywords":["serverless","无服务器","serverless","部署","服务器","开发人员","应用","安全措施","使用","函数"]}}}],"totalCount":31}},"pageContext":{"isCreatedByStatefulCreatePages":false,"blogId":"13c6d4ce-80d3-50b2-8670-125074e036ee","previousBlogId":"38503518-dfcb-58ff-8b5a-f545d5459e6b","nextBlogId":"f14c4bf2-d4d4-572e-ae97-d51f1d8ac773","categories":["guides-and-tutorials"]}}}