{"id":6315,"date":"2019-01-23T06:28:09","date_gmt":"2019-01-23T14:28:09","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=6315"},"modified":"2025-06-13T21:09:41","modified_gmt":"2025-06-14T04:09:41","slug":"developing-aws-lambda-functions-with-golang-and-couchbase-nosql","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","title":{"rendered":"Desenvolvimento de fun\u00e7\u00f5es AWS Lambda com Golang e Couchbase NoSQL"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6316\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/01\/nraboy-here-300x300.jpg\" alt=\"Nic Raboy\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-300x300.jpg 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here.jpg 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-150x150.jpg 150w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-768x768.jpg 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-65x65.jpg 65w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-50x50.jpg 50w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here-20x20.jpg 20w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><em><span style=\"font-weight: 400\"><a href=\"https:\/\/www.thepolyglotdeveloper.com\/\">Nic Raboy<\/a> \u00e9 um defensor das modernas tecnologias de desenvolvimento m\u00f3vel e da Web. Ele tem experi\u00eancia em Java, JavaScript, Golang e uma variedade de estruturas, como Angular, NativeScript e Apache Cordova. <a href=\"https:\/\/twitter.com\/nraboy\">Nic<\/a> escreve sobre suas experi\u00eancias de desenvolvimento relacionadas a tornar o desenvolvimento m\u00f3vel e da Web mais f\u00e1cil de entender.<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">H\u00e1 mais ou menos um ano, quando as fun\u00e7\u00f5es como servi\u00e7o (FaaS) come\u00e7aram a se tornar populares, escrevi alguns tutoriais sobre o desenvolvimento de fun\u00e7\u00f5es que usavam <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/\"><span style=\"font-weight: 400\">Couchbase<\/span><\/a><span style=\"font-weight: 400\"> como o banco de dados NoSQL. Por exemplo, <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/use-aws-lambda-api-gateway-node-js-couchbase-nosql\/\"><span style=\"font-weight: 400\">Use o AWS Lambda e o API Gateway com Node.js e Couchbase NoSQL<\/span><\/a><span style=\"font-weight: 400\"> focado no Node.js, que \u00e9 uma das minhas tecnologias de programa\u00e7\u00e3o favoritas. No entanto, na \u00e9poca, minha outra tecnologia de programa\u00e7\u00e3o favorita, a Golang, ainda n\u00e3o era compat\u00edvel com o Amazon Web Services (AWS) Lambda. Avan\u00e7ando um pouco, a Golang agora \u00e9 compat\u00edvel com o Lambda e \u00e9 incrivelmente f\u00e1cil de usar em combina\u00e7\u00e3o com o Couchbase por causa da tecnologia bem elaborada <a href=\"https:\/\/docs.couchbase.com\/go-sdk\/1.5\/start-using-sdk.html\">Go SDK<\/a> para o Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Neste tutorial, vamos dar uma olhada em como criar uma fun\u00e7\u00e3o no AWS Lambda que se comunica com o Couchbase usando a linguagem de programa\u00e7\u00e3o Go.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Cria\u00e7\u00e3o de uma fun\u00e7\u00e3o Go Lambda para criar e consultar dados NoSQL<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Como o Go agora \u00e9 oficialmente compat\u00edvel com o AWS, podemos usar o SDK oficial em vez de tentar criar algo pr\u00f3prio. Em seu **$GOPATH**, crie um novo projeto e execute os seguintes comandos:<\/span><\/p>\n<pre class=\"lang:default decode:true\">bash\r\ngo get github.com\/aws\/aws-lambda-go\/lambda\r\ngo get gopkg.in\/couchbase\/gocb.v1\r\ngo get github.com\/satori\/go.uuid\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Os comandos acima far\u00e3o o download do Lambda SDK, bem como do Couchbase SDK para Golang. Tamb\u00e9m estamos baixando um pacote UUID que nos permitir\u00e1 criar valores exclusivos que representar\u00e3o nossas chaves de documento NoSQL.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Com as depend\u00eancias dispon\u00edveis, crie um arquivo **main.go** e inclua o seguinte c\u00f3digo padr\u00e3o:<\/span><\/p>\n<pre class=\"lang:default decode:true\">package main\r\n\r\nimport (\r\n    \"context\"\r\n    \"encoding\/json\"\r\n    \"github.com\/aws\/aws-lambda-go\/lambda\"\r\n    uuid \"github.com\/satori\/go.uuid\"\r\n    gocb \"gopkg.in\/couchbase\/gocb.v1\"\r\n)\r\n\r\nvar bucket *gocb.Bucket\r\n\r\ntype Todo struct {\r\n    ID   string `json:\"id,omitempty\"`\r\n    Text string `json:\"text,omitempty\"`\r\n    Type string `json:\"type,omitempty\"`\r\n}\r\n\r\ntype LambdaRequest struct {\r\n    Todo string `json:\"todo\"`\r\n}\r\n\r\nfunc Handler(ctx context.Context, request LambdaRequest) (string, error) { }\r\n\r\nfunc main() {\r\n    cluster, _ := gocb.Connect(\"couchbase:\/\/COUCHBASE_HOST_HERE\")\r\n    cluster.Authenticate(gocb.PasswordAuthenticator{Username: \"todos\", Password: \"123456\"})\r\n    bucket, _ = cluster.OpenBucket(\"todos\", \"\")\r\n    lambda.Start(Handler)\r\n}\r\n<\/pre>\n<h4><span style=\"font-weight: 400\">Antes de entrarmos no design da fun\u00e7\u00e3o, vamos decompor o c\u00f3digo acima.<\/span><\/h4>\n<p><span style=\"font-weight: 400\">Beyond importing our dependencies, we are creating two native data structures. The first `Todo` data structure will represent the data that we plan to work with within the application. For clarity, we&#8217;re going to create a simple todo list type application that will allow us to save todo items and query for them. The second data structure will represent our incoming requests to the function. The incoming requests in our example should either contain JSON with a `todo` property or nothing at all.<\/span><\/p>\n<p><span style=\"font-weight: 400\">We are also creating a global `bucket` variable which will be accessible from everywhere else in our code. Within the `main` function we can connect to our Couchbase instance and open that bucket. It is important that your Couchbase instance is not running on `localhost` because Lambda, a remote service, needs to be able to reach it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">After configuring the database, we can start Lambda and point it at our `Handler` function. In general, each function should accomplish a specific task, but our function will handle querying as well as data creation.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Take a look at the `Handler` function code below:<\/span><\/p>\n<pre class=\"lang:default decode:true\">func Handler(ctx context.Context, request LambdaRequest) (string, error) {\r\n    if request == (LambdaRequest{}) {\r\n        var todos []Todo\r\n        query := gocb.NewN1qlQuery(\"SELECT text FROM `todos` AS todos\")\r\n        rows, _ := bucket.ExecuteN1qlQuery(query, nil)\r\n        var row Todo\r\n        for rows.Next(&amp;row) {\r\n            todos = append(todos, row)\r\n        }\r\n        todosJson, _ := json.Marshal(todos)\r\n        return string(todosJson), nil\r\n    }\r\n    todo := Todo{Text: request.Todo}\r\n    bucket.Insert(uuid.Must(uuid.NewV4()).String(), todo, 0)\r\n    todoJson, _ := json.Marshal(todo)\r\n    return string(todoJson), nil\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">When the Lambda function is executed we want to look at the `request` that comes in. If it is empty or only contains properties that we&#8217;re not interested in, we are going to query for our todo items. Using <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/products\/n1ql\/\">N1QL<\/a> podemos consultar o nosso bucket e retornar todos os itens como uma resposta JSON com string.<\/span><\/p>\n<p><span style=\"font-weight: 400\">If the incoming `request` variable is not empty, it means we want to create some data in our database. Using a UUID, we can take the request and create a new document without an expiration. Then the data itself is returned.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Nossa fun\u00e7\u00e3o geral poderia ser projetada de forma mais elegante, mas o objetivo do que estamos fazendo deve estar claro. A configura\u00e7\u00e3o e o uso do Couchbase n\u00e3o s\u00e3o realmente diferentes de como o usamos em um aplicativo RESTful ou GraphQL, mas, desta vez, projetamos nosso c\u00f3digo como uma fun\u00e7\u00e3o Lambda.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Com a fun\u00e7\u00e3o pronta para funcionar, podemos trabalhar em nossa implanta\u00e7\u00e3o.<\/span><\/p>\n<h3><span style=\"font-weight: 400\"> Implanta\u00e7\u00e3o e teste da fun\u00e7\u00e3o AWS Lambda<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Quando se trata do AWS Lambda, h\u00e1 certos requisitos que diferem de como podemos executar nosso aplicativo localmente. Por exemplo, o Lambda usa um sistema operacional espec\u00edfico e uma arquitetura potencialmente diferente da que estamos usando localmente. Por esse motivo, precisamos compilar nosso aplicativo de forma cruzada e, em seguida, empacot\u00e1-lo.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Na linha de comando, execute o seguinte:<\/span><\/p>\n<pre class=\"lang:default decode:true\">bash\r\nGOOS=linux go build\r\nzip handler.zip .\/binary-name\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">The above commands will build for Linux and create an archive of the binary. Just make sure to change `binary-name` with that of your actual binary name. If the `zip` command doesn&#8217;t work on your operating system, just archive it manually.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para obter mais informa\u00e7\u00f5es sobre a compila\u00e7\u00e3o cruzada de aplicativos Go, consulte meu tutorial anterior sobre o assunto: <\/span><a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/04\/cross-compiling-golang-applications-raspberry-pi\/\"><span style=\"font-weight: 400\">Compila\u00e7\u00e3o cruzada de aplicativos Golang para uso em um Raspberry Pi<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Com o arquivo **handler.zip** dispon\u00edvel, v\u00e1 para o diret\u00f3rio <a href=\"https:\/\/console.aws.amazon.com\/lambda\">Console do AWS Lambda<\/a>\u00a0onde podemos criar uma nova fun\u00e7\u00e3o.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Ao criar a fun\u00e7\u00e3o, escolha os padr\u00f5es, mas certifique-se de escolher um aplicativo Go 1.x, pois \u00e9 isso que vamos implantar. Quando estiver no painel da fun\u00e7\u00e3o, n\u00e3o se preocupe em adicionar um acionador para este exemplo. Em vez disso, escolha carregar o c\u00f3digo da fun\u00e7\u00e3o, que \u00e9 o arquivo **handler.zip**. Para o **Handler**, certifique-se de usar o nome do bin\u00e1rio do seu aplicativo.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para testar nossa implementa\u00e7\u00e3o, podemos criar um teste diretamente no painel. Na parte superior da tela, escolha configurar um novo evento de teste. Voc\u00ea pode nomear o evento de teste como quiser, mas adicione o seguinte como conte\u00fado da solicita\u00e7\u00e3o:<\/span><\/p>\n<pre class=\"lang:default decode:true\">{\r\n  \"todo\": \"Complete Taxes\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Depois de salvar o evento de teste, execute-o no painel e veja os resultados. Ele deve ter sido executado com \u00eaxito e voc\u00ea deve ter um novo documento no banco de dados do Couchbase.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Conclus\u00e3o<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Voc\u00ea acabou de ver como criar uma nova fun\u00e7\u00e3o AWS Lambda com a linguagem de programa\u00e7\u00e3o Go que se comunica com <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/\"><span style=\"font-weight: 400\">Servidor Couchbase<\/span><\/a><span style=\"font-weight: 400\">. O processo \u00e9 bastante simples e pode ser ampliado com acionadores como o AWS Gateway para torn\u00e1-lo um pouco mais \u00fatil do ponto de vista do uso.<\/span><\/p>\n<p><span style=\"font-weight: 400\">No pr\u00f3ximo tutorial, vamos dar uma olhada na expans\u00e3o deste tutorial para oferecer suporte a dispositivos com o Amazon Alexa. Dessa forma, poderemos usar a Alexa como nosso acionador e criar ou consultar documentos com nossa voz.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/community\/community-writers-program\/\"><em>Esta postagem faz parte do Programa de Reda\u00e7\u00e3o da Comunidade Couchbase<\/em><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Neste tutorial, vamos dar uma olhada em como criar uma fun\u00e7\u00e3o no AWS Lambda que se comunica com o Couchbase usando a linguagem de programa\u00e7\u00e3o Go.<\/p>","protected":false},"author":53,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2225,1820,1812,2201],"tags":[10124,2100],"ppma_author":[9026],"class_list":["post-6315","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-golang","category-n1ql-query","category-tools-sdks","tag-amazon-web-services-aws","tag-lambda"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Develop AWS Lambda Functions with Golang &amp; Couchbase NoSQL<\/title>\n<meta name=\"description\" content=\"This post focuses on how to create a new AWS Lambda function with the Go programming language that communicates with Couchbase Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Developing AWS Lambda Functions with Golang and Couchbase NoSQL\" \/>\n<meta property=\"og:description\" content=\"This post focuses on how to create a new AWS Lambda function with the Go programming language that communicates with Couchbase Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-23T14:28:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T04:09:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"Developing AWS Lambda Functions with Golang and Couchbase NoSQL\",\"datePublished\":\"2019-01-23T14:28:09+00:00\",\"dateModified\":\"2025-06-14T04:09:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\"},\"wordCount\":1049,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Amazon Web Services (AWS)\",\"lambda\"],\"articleSection\":[\"Couchbase Capella\",\"GoLang\",\"SQL++ \/ N1QL Query\",\"Tools &amp; SDKs\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\",\"name\":\"Develop AWS Lambda Functions with Golang & Couchbase NoSQL\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2019-01-23T14:28:09+00:00\",\"dateModified\":\"2025-06-14T04:09:41+00:00\",\"description\":\"This post focuses on how to create a new AWS Lambda function with the Go programming language that communicates with Couchbase Server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Developing AWS Lambda Functions with Golang and Couchbase NoSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\",\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"caption\":\"Laura Czajkowski, Developer Community Manager, Couchbase\"},\"description\":\"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/laura-czajkowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Develop AWS Lambda Functions with Golang & Couchbase NoSQL","description":"Esta postagem se concentra em como criar uma nova fun\u00e7\u00e3o do AWS Lambda com a linguagem de programa\u00e7\u00e3o Go que se comunica com o Couchbase Server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","og_locale":"pt_BR","og_type":"article","og_title":"Developing AWS Lambda Functions with Golang and Couchbase NoSQL","og_description":"This post focuses on how to create a new AWS Lambda function with the Go programming language that communicates with Couchbase Server.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","og_site_name":"The Couchbase Blog","article_published_time":"2019-01-23T14:28:09+00:00","article_modified_time":"2025-06-14T04:09:41+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/01\/nraboy-here.jpg","type":"image\/jpeg"}],"author":"Laura Czajkowski, Developer Community Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Laura Czajkowski, Developer Community Manager, Couchbase","Est. reading time":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"Developing AWS Lambda Functions with Golang and Couchbase NoSQL","datePublished":"2019-01-23T14:28:09+00:00","dateModified":"2025-06-14T04:09:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/"},"wordCount":1049,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Amazon Web Services (AWS)","lambda"],"articleSection":["Couchbase Capella","GoLang","SQL++ \/ N1QL Query","Tools &amp; SDKs"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","url":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","name":"Develop AWS Lambda Functions with Golang & Couchbase NoSQL","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2019-01-23T14:28:09+00:00","dateModified":"2025-06-14T04:09:41+00:00","description":"Esta postagem se concentra em como criar uma nova fun\u00e7\u00e3o do AWS Lambda com a linguagem de programa\u00e7\u00e3o Go que se comunica com o Couchbase Server.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Developing AWS Lambda Functions with Golang and Couchbase NoSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220","name":"Laura Czajkowski, gerente da comunidade de desenvolvedores, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409","url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","caption":"Laura Czajkowski, Developer Community Manager, Couchbase"},"description":"Laura Czajkowski \u00e9 a Snr. Developer Community Manager da Couchbase, supervisionando a comunidade. Ela \u00e9 respons\u00e1vel pelo nosso boletim informativo mensal para desenvolvedores.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/laura-czajkowski\/"}]}},"authors":[{"term_id":9026,"user_id":53,"is_guest":0,"slug":"laura-czajkowski","display_name":"Laura Czajkowski, Developer Community Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","author_category":"","last_name":"Czajkowski","first_name":"Laura","job_title":"","user_url":"","description":"Laura Czajkowski \u00e9 a Snr. Developer Community Manager da Couchbase, supervisionando a comunidade. Ela \u00e9 respons\u00e1vel pelo nosso boletim informativo mensal para desenvolvedores."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/6315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=6315"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/6315\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=6315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=6315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=6315"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=6315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}