{"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\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","title":{"rendered":"Developing AWS Lambda Functions with Golang and 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> is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang, and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. <a href=\"https:\/\/twitter.com\/nraboy\">Nic<\/a> writes about his development experiences related to making web and mobile development easier to understand.<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">About a year or so ago, when functions as a service (FaaS) had just started to become popular, I had written a few tutorials around developing functions that made use of <\/span><a href=\"https:\/\/www.couchbase.com\/\"><span style=\"font-weight: 400\">Couchbase<\/span><\/a><span style=\"font-weight: 400\"> as the NoSQL database. For example, <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/use-aws-lambda-api-gateway-node-js-couchbase-nosql\/\"><span style=\"font-weight: 400\">Use AWS Lambda and API Gateway with Node.js and Couchbase NoSQL<\/span><\/a><span style=\"font-weight: 400\"> focused on Node.js, which is one of my favorite programming technologies. However, at the time, my other favorite programming technology, Golang, was not yet supported with Amazon Web Services (AWS) Lambda. Fast forward a bit, Golang is now supported by Lambda and it is incredibly easy to use in combination with Couchbase because of the well-made <a href=\"https:\/\/docs.couchbase.com\/go-sdk\/1.5\/start-using-sdk.html\">Go SDK<\/a> for Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In this tutorial, we&#8217;re going to take a look at how to build a function on AWS Lambda that communicates with Couchbase using the Go programming language.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Creating a Go Lambda Function for Creating and Querying NoSQL Data<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Since Go is now officially supported by AWS, we can make use of the official SDK rather than trying to build something of our own. Within your **$GOPATH**, create a new project and execute the following commands:<\/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\">The above commands will download the Lambda SDK as well as the Couchbase SDK for Golang. We are also downloading a UUID package that will allow us to create unique values that will represent our NoSQL document keys.<\/span><\/p>\n<p><span style=\"font-weight: 400\">With the dependencies available, create a **main.go** file and include the following boilerplate code:<\/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\">Before we get into the function design, let&#8217;s break down the above code.<\/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\/products\/n1ql\/\">N1QL<\/a> we can query our bucket and return all the items as a stringified JSON response.<\/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\">Our overall function could be more elegantly designed, but the point of what we&#8217;re doing should be clear. The setup and usage of Couchbase isn&#8217;t really any different from how we use it in a RESTful or GraphQL application, but this time around we designed our code as a Lambda function.<\/span><\/p>\n<p><span style=\"font-weight: 400\">With the function ready to go, we can work toward our deployment.<\/span><\/p>\n<h3><span style=\"font-weight: 400\"> Deploying and Testing the AWS Lambda Function<\/span><\/h3>\n<p><span style=\"font-weight: 400\">When it comes to AWS Lambda there are certain requirements that differ from how we might run our application locally. For one, Lambda uses a particular operating system and a potentially different architecture from what we&#8217;re doing locally. For this reason, we need to cross compile our application and then bundle it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">From the command line, execute the following:<\/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\">For more information on cross compiling Go applications, check out my previous tutorial on the subject: <\/span><a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/04\/cross-compiling-golang-applications-raspberry-pi\/\"><span style=\"font-weight: 400\">Cross Compiling Golang Applications for Use on a Raspberry Pi<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">With the **handler.zip** file available, go to the <a href=\"https:\/\/console.aws.amazon.com\/lambda\">AWS Lambda Console<\/a>\u00a0where we can create a new function.<\/span><\/p>\n<p><span style=\"font-weight: 400\">When creating the function, choose the defaults, but make sure that you choose a Go 1.x application because that is what we&#8217;re going to deploy. When you&#8217;re at your function dashboard, don&#8217;t worry about adding a trigger for this example. Instead, choose to upload your function code which is the **handler.zip** file. For the **Handler** make sure to use the name of your application binary.<\/span><\/p>\n<p><span style=\"font-weight: 400\">To test our deployment, we can create a test right in the dashboard. Toward the top of the screen, choose to configure a new test event. You can name the test event whatever you want, but add the following as the request content:<\/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\">After saving the test event, execute it from the dashboard and look at the results. It should have run successfully and you should have a new document in your Couchbase database.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400\">You just saw how to create a new AWS Lambda function with the Go programming language that communicates with <\/span><a href=\"https:\/\/www.couchbase.com\/\"><span style=\"font-weight: 400\">Couchbase Server<\/span><\/a><span style=\"font-weight: 400\">. The process is quite simple, and can be extended with triggers like AWS Gateway to make it a little more useful from a usage perspective.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In the next tutorial, we&#8217;re going to take a look at expanding this tutorial to support Amazon Alexa-powered devices. This way, we can use Alexa as our trigger and create or query documents with our voice.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/community\/community-writers-program\"><em>This post is part of the Couchbase Community Writing Program<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we&#8217;re going to take a look at how to build a function on AWS Lambda that communicates with Couchbase using the Go programming language.<\/p>\n","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.7.1 (Yoast SEO v25.7) - 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\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\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\/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 minutes\" \/>\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\":\"en-US\",\"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\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\":\"en-US\",\"@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\/author\/laura-czajkowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Develop AWS Lambda Functions with Golang & Couchbase NoSQL","description":"This post focuses on how to create a new AWS Lambda function with the Go programming language that communicates with 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\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/","og_locale":"en_US","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\/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 minutes"},"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":"en-US","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":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/developing-aws-lambda-functions-with-golang-and-couchbase-nosql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@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":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@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":"en-US","@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\/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 is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=6315"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6315\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=6315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=6315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=6315"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=6315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}