{"id":2501,"date":"2017-01-19T21:36:31","date_gmt":"2017-01-19T21:36:31","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2501"},"modified":"2023-06-21T05:50:24","modified_gmt":"2023-06-21T12:50:24","slug":"aws-serverless-lambda-scheduled-events-tweets-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/","title":{"rendered":"Eventos agendados do AWS Serverless Lambda para armazenar tweets no Couchbase"},"content":{"rendered":"<p><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/author\/arun-gupta\/\">Este blog<\/a> explicou alguns conceitos do Serverless com exemplos de c\u00f3digo:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/serverless-faas-aws-lambda-java\/\">FaaS sem servidor com AWS Lambda e Java<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/aws-iot-button-lambda-couchbase\/\">Bot\u00e3o IoT do AWS, Lambda e Couchbase<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/microservice-aws-api-gateway-lambda-couchbase\/\">Microsservi\u00e7o usando o AWS API Gateway, o AWS Lambda e o Couchbase<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/microservice-aws-serverless-application-model-couchbase\/\">Microsservi\u00e7o usando o modelo de aplicativo sem servidor do AWS e o Couchbase<\/a><\/li>\n<\/ul>\n<p>Esta entrada de blog espec\u00edfica mostrar\u00e1 como usar o AWS Lambda para armazenar tweets de um tweeter em <a href=\"https:\/\/developer.couchbase.com\/server\">Couchbase.<\/a>\u00a0Aqui est\u00e3o os componentes de alto n\u00edvel:<\/p>\n<p><a href=\"\/wp-content\/original-assets\/january-2017\/aws-serverless-lambda-scheduled-events-to-store-tweets-in-couchbase\/lambda-twitter-couchbase-1024x539.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14559\" src=\"\/wp-content\/original-assets\/january-2017\/aws-serverless-lambda-scheduled-events-to-store-tweets-in-couchbase\/lambda-twitter-couchbase-1024x539.png\" alt=\"lambda-twitter-couchbase\" width=\"604\" height=\"318\" \/><\/a><\/p>\n<p>Os principais conceitos s\u00e3o:<\/p>\n<ul>\n<li>Fun\u00e7\u00e3o Lambda implementada usando <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/microservice-aws-serverless-application-model-couchbase\/\">Modelo de aplicativo sem servidor<\/a><\/li>\n<li>Acionado a cada 3 horas usando <a href=\"https:\/\/docs.aws.amazon.com\/lambda\/latest\/dg\/with-scheduled-events.html\">Eventos programados<\/a><\/li>\n<li>Usos <a href=\"https:\/\/twitter4j.org\/en\/\">Twitter4J<\/a> API para consultar novos tweets desde a \u00faltima busca<\/li>\n<li>Uso <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/java\/start-using-sdk.html\">API do SDK Java do Couchbase<\/a> para armazenar documentos JSON no\u00a0<a href=\"https:\/\/developer.couchbase.com\/server\">Servidor Couchbase<\/a><\/li>\n<\/ul>\n<p>O c\u00f3digo de amostra completo para este blog est\u00e1 dispon\u00edvel em\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/twitter-n1ql\">github.com\/arun-gupta\/twitter-n1ql<\/a>.<\/p>\n<h2>Modelo de aplicativo sem servidor<\/h2>\n<p><a href=\"https:\/\/aws.amazon.com\/about-aws\/whats-new\/2016\/11\/introducing-the-aws-serverless-application-model\/\">Modelo de aplicativo sem servidor<\/a>ou SAM, define uma sintaxe simplificada para expressar recursos sem servidor. O SAM estende\u00a0<a href=\"https:\/\/aws.amazon.com\/cloudformation\/\">AWS CloudFormation<\/a>\u00a0para<br \/>\nadicionar suporte para API Gateway, AWS Lambda e Amazon DynamoDB. Leia mais detalhes em <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/microservice-aws-serverless-application-model-couchbase\/\">Microsservi\u00e7o usando o modelo de aplicativo sem servidor do AWS e o Couchbase<\/a>.<br \/>\nPara nosso aplicativo, o modelo SAM est\u00e1 dispon\u00edvel em <a href=\"https:\/\/github.com\/arun-gupta\/twitter-n1ql\/blob\/master\/template-example.yml\">github.com\/arun-gupta\/twitter-n1ql\/blob\/master\/template-example.yml<\/a> e mostrado abaixo:<\/p>\n<pre class=\"lang:default decode:true\">AWSTemplateFormatVersion : '2010-09-09'\r\nTransform: AWS::Serverless-2016-10-31\r\nDescription: Twitter Feed Analysis using Couchbase\/N1QL\r\nResources:\r\n  TrumpFeed:\r\n    Type: AWS::Serverless::Function\r\n    Properties:\r\n      Handler: org.sample.twitter.TwitterRequestHandler\r\n      Runtime: java8\r\n      CodeUri: s3:\/\/arungupta.me\/twitter-feed-1.0-SNAPSHOT.jar\r\n      Timeout: 30\r\n      MemorySize: 1024\r\n      Environment:\r\n        Variables:\r\n          COUCHBASE_HOST: \r\n          COUCHBASE_BUCKET_PASSWORD: \r\n      Role: arn:aws:iam::598307997273:role\/microserviceRole\r\n      Events:\r\n        Timer:\r\n          Type: Schedule\r\n          Properties:\r\n            Schedule: rate(3 hours)<\/pre>\n<p>O que estamos vendo aqui?<\/p>\n<ul>\n<li>A fun\u00e7\u00e3o \u00e9 embalada e est\u00e1 dispon\u00edvel em um balde S3<\/li>\n<li>A classe do manipulador \u00e9 <code>org.sample.twittter.TwitterRequestHandler<\/code> e est\u00e1 em\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/twitter-n1ql\/blob\/master\/twitter-feed\/src\/main\/java\/org\/sample\/twitter\/TwitterRequestHandler.java\">github.com\/arun-gupta\/twitter-n1ql\/blob\/master\/twitter-feed\/src\/main\/java\/org\/sample\/twitter\/TwitterRequestHandler.java<\/a>.<br \/>\nParece que sim:<\/p>\n<pre class=\"lang:default decode:true\">public class TwitterRequestHandler implements RequestHandler&lt;Request, String&gt; {\r\n\r\n    @Override\r\n    public String handleRequest(Request request, Context context) {\r\n        if (request.getName() == null)\r\n            request.setName(\"realDonaldTrump\");\r\n        \r\n        int tweets = new TwitterFeed().readFeed(request.getName());\r\n        \r\n        return \"Updated \" + tweets + \" tweets for \" + request.getName() + \"!\";\r\n    }\r\n    \r\n}<\/pre>\n<p>Por padr\u00e3o, essa classe l\u00ea o identificador do Twitter de <a href=\"https:\/\/twitter.com\/realDonaldTrump\">Donald Trump<\/a>. Mais informa\u00e7\u00f5es sobre isso em um pr\u00f3ximo blog.<\/li>\n<li><code>COUCHBASE_HOST<\/code> e <code>COUCHBASE_BUCKET_PASSWORD<\/code> s\u00e3o vari\u00e1veis de ambiente que fornecem o host do EC2 onde o banco de dados do Couchbase est\u00e1 sendo executado e a senha do bucket.<\/li>\n<li>A fun\u00e7\u00e3o pode ser acionada por diferentes eventos. Em nosso caso, ela \u00e9 acionada a cada tr\u00eas horas. Mais detalhes sobre a express\u00e3o usada aqui est\u00e3o em <a href=\"https:\/\/docs.aws.amazon.com\/lambda\/latest\/dg\/tutorial-scheduled-events-schedule-expressions.html\">Programar express\u00f5es usando Rate ou Cron<\/a>.<\/li>\n<\/ul>\n<h2>Obten\u00e7\u00e3o de tweets usando o Twitter4J<\/h2>\n<p>Os tweets s\u00e3o lidos usando <a href=\"https:\/\/twitter4j.org\/en\/\">Twitter4J<\/a> API. \u00c9 uma API n\u00e3o oficial do Twitter que fornece uma abstra\u00e7\u00e3o Java sobre <a href=\"https:\/\/dev.twitter.com\/rest\/public\">API REST do Twitter<\/a>. Aqui est\u00e1 um exemplo simples:<\/p>\n<pre class=\"lang:default decode:true\">Twitter twitter = getTwitter();\r\nPaging paging = new Paging(page, count, sinceId);\r\nList list = twitter.getUserTimeline(user, paging);\r\n<\/pre>\n<p><a href=\"https:\/\/twitter4j.org\/en\/code-examples.html\">Documentos do Twitter4J<\/a> e <a href=\"https:\/\/twitter4j.org\/en\/javadoc.html\">Javadocs<\/a> s\u00e3o bastante abrangentes. A API do Twitter permite ler apenas os \u00faltimos 200 tweets. A fun\u00e7\u00e3o Lambda \u00e9 chamada a cada 3 horas.<br \/>\nA frequ\u00eancia de tu\u00edtes de\u00a0<a href=\"https:\/\/twitter.com\/realDonaldTrump\">@realDonaldTrump<\/a>\u00a0n\u00e3o \u00e9 de 200 a cada 3 horas, pelo menos por enquanto. Se atingir esse n\u00edvel perigoso, poderemos ajustar a taxa para acionar a fun\u00e7\u00e3o Lambda com mais frequ\u00eancia.<br \/>\nA representa\u00e7\u00e3o JSON de cada tweet \u00e9 armazenada no servidor Couchbase usando <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/java\/start-using-sdk.html\">SDK Java do Couchbase<\/a>. O AWS Lambda \u00e9 compat\u00edvel com Node, Python e C#. E assim<br \/>\nvoc\u00ea pode usar <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/nodejs\/start-using-sdk.html\">SDK do n\u00f3 do Couchbase<\/a>, <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/python\/start-using-sdk.html\">SDK do Couchbase em Python<\/a>\u00a0ou<br \/>\n<a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/dotnet\/start-using-sdk.html\">SDK do Couchbase .NET<\/a> para escrever essas fun\u00e7\u00f5es tamb\u00e9m. A API do Twitter4J permite buscar tweets desde o id de um determinado tweet. Isso permite<br \/>\ngarantir que n\u00e3o sejam buscados tweets duplicados. Para isso, precisamos classificar todos os tweets em uma ordem espec\u00edfica e, em seguida, escolher o ID do tweet mais recente. Isso foi resolvido usando o simples <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/getting-started\/first-n1ql-query.html\">Consulta N1QL<\/a>:<\/p>\n<pre class=\"lang:default decode:true\">SELECT id FROM twitter ORDER BY id DESC LIMIT 1<\/pre>\n<p>A sintaxe \u00e9 muito parecida com a do SQL. Mais informa\u00e7\u00f5es sobre isso em um pr\u00f3ximo blog.<\/p>\n<h2>Armazenar tweets no Couchbase<\/h2>\n<p>O item final \u00e9 armazenar os tweets recuperados no Couchbase. Valor de<code> COUCHABSE_HOST<\/code> \u00e9 usada para se conectar \u00e0 inst\u00e2ncia do Couchbase. O valor de\u00a0<code>COUCHBASE_BUCKET_PASSWORD<\/code> vari\u00e1vel de ambiente<br \/>\n\u00e9 conectar-se ao bucket seguro em que todos os documentos JSON s\u00e3o armazenados. \u00c9 muito importante que o bucket seja protegido por senha e n\u00e3o seja especificado diretamente no c\u00f3digo-fonte. Falaremos mais sobre isso em um pr\u00f3ximo blog. O documento JSON<br \/>\n\u00e9 inserido (inser\u00e7\u00e3o ou atualiza\u00e7\u00e3o) no Couchbase usando a API Java do Couchbase:<\/p>\n<pre class=\"lang:default decode:true\">bucket.upsert(jsonDocument);<\/pre>\n<p>Essa fun\u00e7\u00e3o Lambda est\u00e1 sendo executada h\u00e1 alguns dias e capturou 258 tweets de <a href=\"https:\/\/twitter.com\/realDonaldTrump\">@realDonaldTrump<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2604\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562.png\" alt=\"\" width=\"1024\" height=\"562\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562-300x165.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562-768x422.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562-20x11.png 20w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Uma an\u00e1lise interessante de seus tweets ser\u00e1 publicada em breve!<\/p>\n<p>Fale conosco:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/forums\/\">F\u00f3runs do Couchbase<\/a><\/li>\n<li><a href=\"https:\/\/developer.couchbase.com\/server\">Portal do desenvolvedor do banco de dados Couchbase<\/a><\/li>\n<li><a href=\"https:\/\/twitter.com\/couchbasedev\">@couchbasedev<\/a> e <a href=\"https:\/\/twitter.com\/couchbase\">@couchbase<\/a><\/li>\n<\/ul>\n<p>O c\u00f3digo de amostra completo para este blog est\u00e1 dispon\u00edvel em\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/twitter-n1ql\">github.com\/arun-gupta\/twitter-n1ql<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>This blog has explained a few Serverless concepts with code\u00a0samples: Serverless FaaS with AWS Lambda and Java AWS IoT Button, Lambda and Couchbase Microservice using AWS API Gateway, AWS Lambda and Couchbase Microservice using AWS Serverless Application Model and Couchbase [&hellip;]<\/p>","protected":false},"author":58,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816],"tags":[],"ppma_author":[8933],"class_list":["post-2501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AWS Serverless Lambda to Store Tweets in Couchbase<\/title>\n<meta name=\"description\" content=\"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.\" \/>\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\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase\" \/>\n<meta property=\"og:description\" content=\"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-19T21:36:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-21T12:50:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562.png\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase\",\"datePublished\":\"2017-01-19T21:36:31+00:00\",\"dateModified\":\"2023-06-21T12:50:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\"},\"wordCount\":632,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Server\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\",\"name\":\"AWS Serverless Lambda to Store Tweets in Couchbase\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-01-19T21:36:31+00:00\",\"dateModified\":\"2023-06-21T12:50:24+00:00\",\"description\":\"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#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\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase\"}]},{\"@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\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"AWS Serverless Lambda to Store Tweets in Couchbase","description":"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.","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\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/","og_locale":"pt_BR","og_type":"article","og_title":"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase","og_description":"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-01-19T21:36:31+00:00","article_modified_time":"2023-06-21T12:50:24+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/serverless-lambda-couchbase-twitter-bucket-1024x562.png","type":"","width":"","height":""}],"author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase","datePublished":"2017-01-19T21:36:31+00:00","dateModified":"2023-06-21T12:50:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/"},"wordCount":632,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Server"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/","name":"AWS Serverless Lambda to Store Tweets in Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-01-19T21:36:31+00:00","dateModified":"2023-06-21T12:50:24+00:00","description":"First of all, see how to use AWS serverless Lambda for storing the tweets of the Twitter in Couchbase. Also, learn how to fetch tweets using Twitter4J.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#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\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase"}]},{"@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\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, vice-presidente de defesa do desenvolvedor, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta \u00e9 o vice-presidente de defesa do desenvolvedor na Couchbase. Ele criou e liderou comunidades de desenvolvedores por mais de 10 anos na Sun, Oracle e Red Hat. Ele tem grande experi\u00eancia na lideran\u00e7a de equipes multifuncionais para desenvolver e executar estrat\u00e9gias, planejamento e execu\u00e7\u00e3o de conte\u00fado, campanhas de marketing e programas. Antes disso, liderou equipes de engenharia na Sun e \u00e9 membro fundador da equipe Java EE. Gupta \u00e9 autor de mais de 2.000 postagens em blogs sobre tecnologia. Ele tem uma vasta experi\u00eancia em palestras em mais de 40 pa\u00edses sobre uma infinidade de t\u00f3picos e \u00e9 um JavaOne Rock Star h\u00e1 tr\u00eas anos consecutivos. Gupta tamb\u00e9m fundou o cap\u00edtulo Devoxx4Kids nos EUA e continua a promover a educa\u00e7\u00e3o tecnol\u00f3gica entre as crian\u00e7as. Autor de v\u00e1rios livros sobre tecnologia, corredor \u00e1vido, viajante do mundo inteiro, campe\u00e3o de Java, l\u00edder de JUG, membro do NetBeans Dream Team e capit\u00e3o do Docker, ele pode ser facilmente acessado em @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta \u00e9 o vice-presidente de defesa do desenvolvedor na Couchbase. Ele criou e liderou comunidades de desenvolvedores por mais de 10 anos na Sun, Oracle e Red Hat. Ele tem grande experi\u00eancia na lideran\u00e7a de equipes multifuncionais para desenvolver e executar estrat\u00e9gias, planejamento e execu\u00e7\u00e3o de conte\u00fado, campanhas de marketing e programas. Antes disso, liderou equipes de engenharia na Sun e \u00e9 membro fundador da equipe Java EE.\r\n\r\nGupta \u00e9 autor de mais de 2.000 postagens em blogs sobre tecnologia. Ele tem uma vasta experi\u00eancia em palestras em mais de 40 pa\u00edses sobre diversos t\u00f3picos e \u00e9 um JavaOne Rock Star h\u00e1 tr\u00eas anos consecutivos. Gupta tamb\u00e9m fundou o cap\u00edtulo Devoxx4Kids nos EUA e continua a promover a educa\u00e7\u00e3o tecnol\u00f3gica entre as crian\u00e7as. Autor de v\u00e1rios livros sobre tecnologia, corredor \u00e1vido, viajante do mundo inteiro, campe\u00e3o de Java, l\u00edder de JUG, membro do NetBeans Dream Team e capit\u00e3o do Docker, ele pode ser facilmente acessado em @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2501","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\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=2501"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2501\/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=2501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=2501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=2501"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=2501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}