<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emrah Şamdan on Medium]]></title>
        <description><![CDATA[Stories by Emrah Şamdan on Medium]]></description>
        <link>https://medium.com/@emrahsamdan?source=rss-49ac2964aea9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OG3WgGcca_ftCFluwatsnA.jpeg</url>
            <title>Stories by Emrah Şamdan on Medium</title>
            <link>https://medium.com/@emrahsamdan?source=rss-49ac2964aea9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:50:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emrahsamdan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to send transactional emails with Sendinblue and Serverless Cloud]]></title>
            <link>https://medium.com/serverlesscloud/how-to-send-transactional-emails-with-sendinblue-and-serverless-cloud-f02af4d5a715?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f02af4d5a715</guid>
            <category><![CDATA[sendinblue]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[transactional-emails]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 18:43:15 GMT</pubDate>
            <atom:updated>2022-07-26T18:43:15.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r0eD0o_axyQJrPzR.png" /></figure><p>Every SaaS product today sends transactional emails to customers when a specific action is taken. Examples include adding an item to a cart, abandoning the cart, exceeding subscription limits, and so on. I accidentally discovered <a href="https://www.sendinblue.com/">Sendinblue</a> while searching for tools to send these types of emails, and I was able to get it up and running quickly with Serverless Cloud. In this post, I’ll walk you through setting up a welcome email flow with Serverless Cloud and Sendinblue.</p><h3>Get Started with Serverless Cloud and Sendinblue</h3><p>Both Serverless Cloud and Sendinblue offer generous free tier options that can be beneficial in the early stages of your business. <a href="https://www.sendinblue.com/pricing/">Sendinblue</a> allows you to send 300 transactional emails per day and <a href="https://www.serverless.com/cloud/pricing">Serverless Cloud</a> allows 100K requests per month. You don’t need a credit card to make an account; all you need is a valid email address for both services.</p><p>When you create an account in Sendinblue, you can create a test contact (or import your existing contacts) <a href="https://my.sendinblue.com/users/list">from this menu</a>. Then, <a href="https://account.sendinblue.com/advanced/api">create an API key</a> that we will be using in the following steps while building the automation with Serverless Cloud.</p><p>When you sign up for Serverless Cloud, you’ll be asked to name your organization, and you’ll be able to create your first application. Select “Javascript app” and run the npx command to boot your Serverless Cloud development environment via the CLI in less than a minute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u63n4kMTL20z2G60" /><figcaption>Serverless Cloud Starter Projects</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*CJG0Q9CAOjBcUQpw" /><figcaption>Serverless Cloud — Single Command Instruction to start a JS backend</figcaption></figure><p>Here’s how my terminal looks after I’ve finished creating my first application. Serverless Cloud launched my developer sandbox, which is linked to a live URL ending in “cloud.serverless.com.” More information about developer sandboxes can be found <a href="https://www.serverless.com/cloud/docs/workflows/personal-instances">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BJIZy13T8Ltx4iqm" /></figure><h3>Hello world with Serverless Cloud + Sendinblue</h3><p>After setting up our Serverless Cloud and Sendinblue accounts, we’re ready to send our first email using the Sendinblue API. In order to use Sendinblue programmatically, we need to install their SDK to our project. You can do this without leaving the Cloud Shell with the “install” command. Just type “install sib-api-v3-sdk” and you’ll be ready to start building.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e0d2d6642b82cde6bf3113fd8aefb00/href">https://medium.com/media/0e0d2d6642b82cde6bf3113fd8aefb00/href</a></iframe><p>As you can see above, we import Serverless Cloud’s api and params interfaces to get our Hello World example up and running. We create a “/signup” endpoint that accepts POST requests and sends our first transactional email using the Sendinblue API. To run this code without error, we must save the API key obtained from Sendinblue in the preceding step as a parameter in Serverless Cloud. To do so, navigate to your application’s “Parameters” tab in the Serverless Cloud Dashboard and add a new parameter key named SENDINBLUE_API_KEY and paste the API key you got from Sendinblue. If you need to rotate your API Key in the future, you won’t have to restart or re-deploy the application; it will simply dispatch the new value during runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oKa1K8H7hhaYc05t" /><figcaption>Serverless Cloud Dashboard — Parameters Management</figcaption></figure><p>In order to test our first endpoint, we need to send a POST request to it. You can always do it with curl or a tool like Postman, but Serverless Cloud provides built-in functionality called “Interact”. As the name suggests, it allows you to easily interact with the endpoints you created. Simply navigate to your developer sandbox’s “Interact” tab and make a call to your endpoint from there. As you can see below, I created sample data for our “/signup” endpoint. You can inspect the request payload and parameters, as well as the response body and headers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4A_og4EUVuBW5RCc" /><figcaption>Serverless Cloud Dashboard — Interact with APIs</figcaption></figure><p>Here we are! We’ve sent the first transactional email with Sendinblue API and Serverless Cloud, but we’re not done yet.</p><h3>Sending a better-looking email asynchronously</h3><p>We have successfully sent a transactional email with Sendinblue, but we haven’t achieved our purpose of sending a welcome email to a new user yet. We need to:</p><ul><li>save the user to our DB for the future</li><li>save this user to our CRM</li><li>send a good-looking transactional email that we can track later on in the Sendinblue dashboard.</li></ul><p>Let’s use <a href="https://www.serverless.com/cloud/docs/apps/data">Serverless Data</a> to save our user into the database. Similar to api and params interfaces, data interface gives us a powerful, super fast, automatically and ultimately scalable K/V store with no infrastructure configuration. In our example, we’ll save the user to Serverless Data with a user: prefix so that we can run queries on that later on.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcdc39c6ce52e0766095c5409bd28913/href">https://medium.com/media/bcdc39c6ce52e0766095c5409bd28913/href</a></iframe><p>As seen above, it’s just a .set() command that takes single-digit ms to save a record to Serverless Data. But wait, where did our email code go? I decided to move it to the data change handler because I don’t want our API to fail if Sendinblue has any issues. Also, it’s always wise to use async patterns in order to respond to users faster. This brings us to the event-driven nature of Serverless Cloud. As you can see below, the data handler is defined with the createad:user:* filter. This will dispatch an event when a user record is created. You can define as many data handlers as you want for the “created”, “updated”, and “deleted” data event types. If events fail to process for some reason, Serverless Cloud retries it for you for 24 hours with exponential backoff and then eventually drops the event. You can read more about data events <a href="https://www.serverless.com/cloud/docs/apps/data#reacting-to-changes">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0eb2543d36f3e0675fef11036e7e0f1c/href">https://medium.com/media/0eb2543d36f3e0675fef11036e7e0f1c/href</a></iframe><p>You may have noticed that the above code does not really send an email. It simply adds the user to our CRM on Sendinblue as a contact. We did this because we wanted to use Sendinblue’s email templates with contact properties. But when and how will we finally send the email? If you look at the last line of the data handler, you’ll notice that we’re using the ‘event.publish’ function to publish an event called ‘contact.created’. We wanted to make sure the contact is created and wait 10 seconds before sending our email. This brings us to our fourth and final Serverless Cloud interface: ‘events.’ Serverless Events enables developers to create event-driven workflows in the simplest way possible. We can see that this event will be dispatched 10 seconds after it is published. Serverless Cloud offers a variety of options for delaying the event for up to a year in the future. You can use epoch times, date strings, or relative time, as I do(<a href="https://www.serverless.com/cloud/docs/apps/events#publishing-events-with-eventspublish">see the docs</a>).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b86c03ab14e5d86bbf6faa8ce1fc9b8/href">https://medium.com/media/4b86c03ab14e5d86bbf6faa8ce1fc9b8/href</a></iframe><p>As shown above, we are now sending our transactional email in our event dispatcher defined as events.on. Note that Serverless Events will get retried for 14 days if they fail. Be sure to implement the flow that handles the failure logic.</p><p>Notice that we are using a template with id 1 in the above example. This brings us back to the Sendinblue dashboard where we’ll create an email template for transactional emails. As you can see below, Sendinblue lets us create an email using several design <a href="https://app-smtp.sendinblue.com/templates/">templates</a> and personalization capabilities. They can even design<a href="https://www.sendinblue.com/custom-email-templates/"> a custom email template</a> for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQsa52R80Ub9IHc0" /><figcaption>Serverless Cloud Welcome Email Template on Sendinblue</figcaption></figure><p>The nice thing about transactional emails is that you can track whether or not the email is actually delivered or the links in it are clicked. You can even set up workflows <a href="https://help.sendinblue.com/hc/en-us/articles/360020994839-What-are-the-entry-points-in-Marketing-Automation-#h_01F338ERK19JGPYGH6FE9ASYF5">with respect to the actions taken on transactional emails</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uRNHpLfieYDT9sDJ" /><figcaption>Sendinblue Transactional Email Report</figcaption></figure><h3>Deploying to Production</h3><p>Once you’re sure that everything is working properly in your personal sandbox, you are now ready to deploy to production.. This will deploy your changes to a completely isolated, separate working environment that is unaffected by future changes to your personal sandbox. You can deploy to production by using the cloud shell and running the “deploy production” command, which will return a new url for your production application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/0*Qcn34xx971vifGdC.gif" /></figure><h3>Wrapping up</h3><p>We now have an app that sends transactional emails with Sendinblue. There are hundreds of ways to improve our workflow using Serverless Cloud and Sendinblue, but let’s stop here to keep this short. We’ve built an event-driven application with an endpoint, a data change handler, and events handler. Then, we have deployed this application to production. See the full source code <a href="https://github.com/emrahssamdan/sendinblue-demo">here</a>. If you want to build your own event-driven application with Serverless Cloud, you can <a href="https://cloud.serverless.com/?view=register&amp;utm_source=serverless-blog&amp;utm_medium=medium&amp;utm_campaign=serverless-cloud-sendinblue">sign up and get started for free</a>.</p><p><em>Originally published at </em><a href="https://www.serverless.com/blog/how-to-send-transactional-emails-with-sendinblue-and-serverless-cloud"><em>https://www.serverless.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f02af4d5a715" width="1" height="1" alt=""><hr><p><a href="https://medium.com/serverlesscloud/how-to-send-transactional-emails-with-sendinblue-and-serverless-cloud-f02af4d5a715">How to send transactional emails with Sendinblue and Serverless Cloud</a> was originally published in <a href="https://medium.com/serverlesscloud">Serverless Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prototype faster than ever before with Serverless Cloud]]></title>
            <link>https://medium.com/serverlesscloud/prototype-faster-than-ever-before-with-serverless-cloud-4219ff4f438?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4219ff4f438</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[prototyping]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 19:38:11 GMT</pubDate>
            <atom:updated>2022-02-25T19:38:11.155Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to create fully functional prototypes in no time, all without needing to configure complex cloud infrastructures</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_05fy8eN_6w8Voz7.jpg" /></figure><p>With more and more competition in almost every corner of the startup ecosystem, it has become vital to develop prototypes and collect genuine feedback from users as fast as possible. Deciding how to build the application and what systems to use is often harder than implementing the actual business logic.</p><p>Serverless technologies from cloud giants AWS, Azure, and GCP seem like a logical choice for building prototypes. The focus on pay-per-use billing and managed services make them both economical and relatively fast to implement. However, the learning curve of such technologies is still very steep, and for someone who has limited or no experience with these platforms, that choice becomes less than ideal. This is when Serverless Cloud comes to the rescue as a one-of-a-kind platform that boosts developer productivity when building event-driven mobile and web applications. Let’s take a closer look at the advantages of using Serverless Cloud to build a prototype for your next idea. <strong>‍</strong></p><h3>A Swiss-army Knife for Builders</h3><p>Most apps need an API, a database, file storage, and maybe a CDN to cache and serve files quickly to your users. At least five cloud services are required to build such a system with one of those cloud giants. You’ll need to learn how to provision these services and make sure they’re properly configured for security and reliability. After that, you can finally start building your business logic. With Serverless Cloud’s built-in SDK (Serverless Development Kit) for APIs, databases, storage, schedules, and events, you can just write code and start building without any setup or a deep technical knowledge of the cloud.</p><p>The code below shows how simple it is to create an image-hosting API with Serverless Cloud.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8c7692d073974d5e22f5761235088a0/href">https://medium.com/media/a8c7692d073974d5e22f5761235088a0/href</a></iframe><p>With just 40 lines of code, we’ve created two endpoints to serve and upload files into <a href="https://www.serverless.com/cloud/docs/apps/blob-storage">Serverless Storage</a>. We didn’t have to define an API-Gateway, a computing resource, or a storage bucket. Serverless Cloud automatically provisions the resources that best meet the needs of your application. This is what we call <strong>“infrastructure FROM code”</strong> but you can call it <em>massively boosted productivity to build awesome stuff</em>.</p><p>Brice Carpentier, who’s been developing applications for over a month on Serverless Cloud, had this to say:</p><blockquote><em>“We all know how serverless infrastructures are usually good for new projects because of how cheap and scalable they can be. But never before has the developer experience been so good all the way through like it is with Serverless Cloud.”</em></blockquote><h3>Build, Share, Collect Feedback, Repeat!</h3><p>The entire purpose of building a prototype is to gather honest feedback from potential customers. You’ll incorporate their ideas, iterate on your application, and show it off again to stakeholders and more potential users. Serverless Cloud offers extremely flexible workflows that enable developers to share different versions of the app with a variety of user groups.</p><p>When building an application in your local IDE, you simply save your changes, and it will automatically sync and publish to your personal developer sandbox in the cloud in about a second. Yes, it’s that fast. If you want to see how your API behaves, you can use the <a href="https://www.serverless.com/cloud/docs/dashboard/interacting-with-compute">Interact functionality of Serverless Cloud Dashboard</a> and test your API instantly. Need some sample data in your database? You can seed data from the <strong>data.json</strong> file by typing import in the Serverless Cloud Shell running in your terminal. If you want to reseed whenever something changes in data.json, then add the --reseedflag when you start the Cloud Shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*4FWXemiuiFp59Ybz.gif" /></figure><p>Once you’ve finally finished building the first version of the app, it’s time to share it with others to get their feedback. You can deploy it with a single command, deploy &lt;stage_name&gt;. This creates a “permanent” instance of your app with its own public URL, completely independent from your developer sandbox. If you want to look more professional, you can <a href="https://www.serverless.com/cloud/docs/custom-domains">assign a custom domain to your stage</a> with just a few clicks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GRwxJBb6guHGD_l5.png" /></figure><p>Let’s say you got feedback and you want to test a small tweak to your app. However, you don’t want everyone to see this change just yet. Use your personal developer sandbox to make the change and test it, then <a href="https://www.serverless.com/cloud/docs/workflows/preview-instances">create a preview instance</a> by running share from your <a href="https://www.serverless.com/cloud/docs/cli#cloud-shell">Cloud Shell</a>. You can even feed sample data to this preview instance. You can continue to iterate in your personal developer sandbox without affecting any other version that you’ve shared. Updating the permanent instance with your changes is as easy as typing deploy &lt;stage_name&gt; again. Serverless Cloud provides all of these effective workflows to allow developers to iterate and test their projects faster than ever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E3vQZfPbLqbQSW09.png" /></figure><h3>Hassle-free Frontend Integration</h3><p>Prototypes are typically not just a backend. To make a good first impression on your target market, you’ll need to create appealing user interfaces as well. Fortunately, SPA frameworks allow developers to quickly build good-looking UIs for their ideas. Serverless Cloud makes it easy to connect front-end apps with React, Vue, and others. You’ll just need to define the build directory of your application as a folder in your Serverless Cloud project.</p><p>You can run a separate terminal with your SPA in development mode to quickly test locally, and when you build your SPA, the output files will sync instantly to test in your developer sandbox. We are now working on ways of improving this experience even more and are looking forward to removing the need to run a separate terminal. See <a href="https://github.com/serverless/cloud/tree/main/examples/status">this sample project</a> which is a status-page application with a React frontend as an example of such an integration.</p><h3><strong>Summary</strong></h3><p>In this hyper-competitive market for new startups, reducing time to market has become more crucial than ever. Being able to rapidly deliver a prototype into the hands of potential customers puts you one step ahead of the competition. In this blog post, we’ve explained why Serverless Cloud is the best way to rapidly prototype your idea. Plus, Serverless Cloud can support your actual product as it’s built on top of the cloud giants we’ve mentioned.</p><p>Many of our users come for the prototyping, and then use us to host their actual product once seeing the ease and flexibility of the Serverless Cloud platform. One of our frequent users, James Hammond, describes his Serverless Cloud experience:</p><blockquote><em>“Serverless Cloud strips the complexity away from serverless development, providing the core tools needed to get an app up and running quickly and effectively. No steep learning curve, no AWS management nightmares, and a fantastic, helpful community behind it.”</em></blockquote><p>‍ <a href="https://www.youtube.com/watch?v=0lGNFFQt5No">Watch this video </a>to see the features of Serverless Cloud packed into 3 minutes. And <a href="https://cloud.serverless.com/?view=register&amp;utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=rapid-prototyping">start your Serverless Cloud journey</a> to prototype and build your product faster than ever before. Happy coding!‍</p><p><em>Originally published at </em><a href="https://www.serverless.com/blog/prototype-faster-than-ever-before-with-serverless-cloud"><em>https://www.serverless.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4219ff4f438" width="1" height="1" alt=""><hr><p><a href="https://medium.com/serverlesscloud/prototype-faster-than-ever-before-with-serverless-cloud-4219ff4f438">Prototype faster than ever before with Serverless Cloud</a> was originally published in <a href="https://medium.com/serverlesscloud">Serverless Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the power of serverless for solo developers]]></title>
            <link>https://medium.com/serverlesscloud/unleashing-the-power-of-serverless-for-solo-developers-eba1d9cd7d5e?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba1d9cd7d5e</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[solopreneur]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 19:58:19 GMT</pubDate>
            <atom:updated>2022-01-25T19:58:19.767Z</atom:updated>
            <content:encoded><![CDATA[<h4>Serverless Cloud gives freelancers and solo devs superpowers. 🦸</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bCZObX4I1hrWqFI2.png" /></figure><p>Developing and managing production-ready cloud applications requires knowledge across several technical disciplines. It’s much more than just writing application code and connecting to a couple of APIs. You need to configure a myriad of cloud services and understand how your application interacts with them, what their scale and limits are, and how those architectural choices affect performance, reliability, and resiliency. Most importantly, you need to understand how to secure and maintain your workloads. For most, this often means hiring a team of professionals with the necessary skills, or spending a lot of time retraining your developers (and probably still learning by trial and error).</p><p>However, <a href="https://cloud.serverless.com/?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers"><strong>Serverless Cloud</strong></a> dramatically simplifies this complexity and lets developers focus on what they do best — write code. Whether you’re working on a small side-hustle, building a bot for your co-workers, or trying to build the next Internet unicorn by yourself, Serverless Cloud is the perfect companion for a team of one. In this post, we’ll look at real-life use cases by some of our early users and see how Serverless Cloud can help solo developers be more productive, with or without previous cloud experience.</p><h3>Outsourcing undifferentiated heavy lifting</h3><p>When building applications in the cloud, most people wisely choose an Infrastructure as Code (IaC) framework like <a href="https://www.serverless.com/framework">Serverless Framework</a>, <a href="https://aws.amazon.com/serverless/sam/">SAM</a>, or the<a href="https://aws.amazon.com/cdk/"> AWS CDK</a>. This lets you ensure repeatable infrastructure and code deployments. The problem is that the feedback loop to deploy new environments and test your changes can take several minutes or more, forcing developers to find local solutions to speed this up. There are some excellent solutions like <a href="https://localstack.cloud/">LocalStack</a> that help emulate cloud services locally, but ultimately you end up with a patchwork of tools and mocking libraries that don’t provide parity with your production environment. Even worse, setting up and maintaining these local environments can take a significant amount of time, taking you away from delivering value to your users.</p><p>While Infrastructure as Code frameworks help you codify your infrastructure requirements, building and automating your deployments workflows require a number of configurations and security considerations. There are lots of tools that can help with this, and if you have a team of cloud specialists setting this up for you, then you don’t have to worry about it. But as a solo developer setting this up, this is just more of your time being taken away from building your product. That’s what we call undifferentiated heavy lifting.</p><p>Serverless Cloud takes an entirely new approach to dealing with the operational burden of cloud application development and deployment. Instead of trying to emulate the cloud locally, we give every developer their own “developer sandbox” for every app they work on. You work locally in your favorite IDE, and we instantly sync your code changes on every save (often in less than a second). This gives you your very own live URL to test applications in a truly production-compatible environment.</p><p>Deploying new environments is blazing fast as well. Like <strong>15 seconds</strong> fast. Whether you’re sharing preview builds, running automated tests, or deploying to production, isolated cloud environments (complete with API Gateways, compute resources, databases, and other necessary infrastructure) are automatically provisioned for you. Plus, there are no YAML files or infrastructure configuration options. Serverless Cloud analyzes your code and provisions the necessary infrastructure automatically. This is what we call <strong>Infrastructure<em> from </em>Code</strong>, similar to what Shawn Wang describes as a <a href="https://www.swyx.io/self-provisioning-runtime/">self provisioning runtime</a>. <a href="https://www.linkedin.com/in/%F0%9F%92%AC-michael-bahr-81036177/">‍</a></p><p><a href="https://www.linkedin.com/in/%F0%9F%92%AC-michael-bahr-81036177/">Michael Bahr</a> explains why he loves the Infrastructure <em>from </em>Code paradigm:</p><blockquote><em>“I don’t have to manage infrastructure. I just write some function handlers, and off we go. I also love the blazing fast redeploys when working in my developer sandbox. Instead of minutes it’s just seconds to get a new change up and running.”</em></blockquote><h3>Focusing on what really matters</h3><p>Ben Kehoe defines “ <a href="https://ben11kehoe.medium.com/serverless-is-a-state-of-mind-717ef2088b42">serverless as a state of mind</a> “ and says that the value of serverless is the opportunity it gives developers to focus on value creation for customers. Serverless Cloud dramatically boosts developer productivity by allowing our users to only write the code that matters. By outsourcing operational complexities and infrastructure tedium, developers free up time to focus on value differentiation. Our SDK lets developers create applications using JavaScript or TypeScript, just as they would in a normal Node.js environment, complete with full access to the rich JavaScript package ecosystem.</p><p>You can also create <a href="https://www.serverless.com/cloud/docs/workflows/testing?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers">automated tests</a> and run them live against your developer sandbox or on a completely separate test instance. And when you’re ready to publish your application, you can use our simple, one command workflows, or connect to <a href="https://www.serverless.com/cloud/docs/workflows/cicd?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers">your preferred CI/CD</a> process with the headless CLI option. <a href="https://www.linkedin.com/in/serhii-naydenko-96b47b121/">‍</a></p><p><a href="https://www.linkedin.com/in/serhii-naydenko-96b47b121/">Serhii Naydenko</a>, a freelancer from Ukraine who delivers applications to his clients with Serverless Cloud, explains why Serverless Cloud became his first choice over Heroku:</p><blockquote><em>“A lot of useful functionality is provided out of the box. For example, the Express-like framework, cron tasks, events, static asset hosting, fast data storage, and automated tests. I thought this is what I needed when I first heard about it and I never regretted my decision.”</em></blockquote><h3>Following The Best Practices</h3><p>Learning how to build software is a lifelong journey. Cloud applications introduced a completely new set of best practices for provisioning and configuring infrastructure for performance and scale. A basic example could be tuning the memory setting of a serverless function, whereas a more complex example might be learning single table design for NoSQL databases. And while we encourage you to always be learning, it’s not easy for teams (let alone single developers) to find time to keep up with the latest best practices across all these technical disciplines. Especially if you need to deliver something on time and on budget.</p><p>Serverless Cloud further reduces the cognitive load on developers by automatically applying best practices for APIs, data, storage, CDNs, and more. For example, <a href="https://twitter.com/jeremy_daly">Jeremy Daly</a>, GM of Serverless Cloud, created <a href="http://dynamodbtoolbox.com/">the DynamoDB Toolbox</a> to help developers implement the best practices of single table design for Amazon DynamoDB. Serverless Data bakes in those best practices for you and provides a simple interface to manage your data. Similarly, your API endpoint will automatically have a sufficient amount of computational resources by simply using the `api` interface of our SDK. Serverless Cloud continuously adapts the best configuration for your application, letting you focus on solving business problems, not infrastructure ones.</p><p>Calgan Aygun, who <a href="https://serverless-meme-generator.calgan.cloud/">built a meme generator</a> using Serverless Cloud, shares his thoughts:</p><blockquote><em>“After I started using Serverless Cloud, I never wanted to use another service unless I had to. I was mainly using Cloudflare Workers and Cloud Run before Serverless Cloud. I constantly recommend it in my speeches and casual conversations.”</em></blockquote><h3>Wrapping up</h3><p>The team is excited to see so many solo developers and freelancers rapidly developing production-ready applications with Serverless Cloud. With new features and capabilities being added regularly (like <a href="https://www.serverless.com/blog/introducing-serverless-cloud-storage?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers">Serverless Storage</a> and <a href="https://www.serverless.com/cloud/docs/changelog?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers#data-manager-beta">Data Manager</a>), we continue to make Serverless Cloud more powerful and open new use cases. We’d love for you to <a href="https://cloud.serverless.com/?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=serverless-for-solo-developers">give it a try</a> for your next solo developer project.</p><p>Don’t forget to<a href="https://join.slack.com/t/serverless-contrib/shared_invite/zt-d5qzowja-pnOerTzAIZUrN18hWYUIHA"> join our Slack community</a> to stay up-to-date, get support, and share your feedback!</p><p><em>Originally published at </em><a href="https://www.serverless.com/blog/unleashing-the-power-of-serverless-for-solo-developers"><em>https://www.serverless.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba1d9cd7d5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/serverlesscloud/unleashing-the-power-of-serverless-for-solo-developers-eba1d9cd7d5e">Unleashing the power of serverless for solo developers</a> was originally published in <a href="https://medium.com/serverlesscloud">Serverless Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To the future with Serverless Cloud]]></title>
            <link>https://emrahsamdan.medium.com/to-the-future-with-serverless-cloud-42ad5906eca5?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/42ad5906eca5</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[dynamodb]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Wed, 08 Sep 2021 12:49:56 GMT</pubDate>
            <atom:updated>2021-09-08T12:53:41.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NmxcsVu2ZeLr3RqF4rCVw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@clarktibbs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Clark Tibbs</a> on <a href="https://unsplash.com/s/photos/future?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>It has been a bit less than 4 years since I first heard the term serverless and only around 3 years since I got my hands dirty with it. As a beginner, I agreed that it’s less servers to manage, but anything else was more. It was more complex to build event-driven serverless applications, harder to secure as serverless shifts security responsibilities to developers, and harder to achieve observability as events go in and out between services simultaneously. Since then, many of those problems have been tackled with the innovation of great products. However, one thing remains constant: the learning curve is very steep, and serverless is far from easy.</p><p><strong>Serverless as it’s meant to be</strong></p><p>That’s what made me passionate about the Serverless Cloud when Jeremy first told me about it. We are calling our innovation “serverless as it’s meant to be” and it really is. It gives developers the ability to build Express.js-like APIs with a familiar syntax for accessing built-in data, secrets, and building scheduled tasks. All the infrastructure is automatically spun up and abstracted away. You need to focus on the code and only the code. Our own Doug Moscrop coined this as <em>infrastructure-from-code </em>and very recently, Shawn Wang envisioned a similar vision and called this <a href="https://www.swyx.io/self-provisioning-runtime/">self-provisioning-runtime.</a> Last week, we went out of beta and made into the exclusive launch of the Serverless Cloud. The comments so far are so great that it puts pressure on us to keep the Serverless Cloud as lean and as efficient as possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aA3FkCzXm9W0Y4uc" /><figcaption><a href="https://twitter.com/letslamb/status/1435301800677097484">https://twitter.com/letslamb/status/1435301800677097484</a></figcaption></figure><p><strong>Serverless Data</strong></p><p>Serverless Cloud leads an opinionated paradigm not only for APIs but also for the databases of modern applications. After watching<a href="https://www.youtube.com/watch?v=KYy8X8t4MB8"> Rick Houlihan’s great talk</a> and reading <a href="https://www.dynamodbbook.com/">Alex DeBrie’s great book</a>, I was sold on the single table design for many use cases. However, incorporating best practices into your data layer is easier said than done.The great news is that all of those best practices are already baked in Serverless Data thanks to <a href="https://github.com/jeremydaly/dynamodb-toolbox">Jeremy’s previous experience with his OSS work. </a>You can manipulate Serverless Data simply by using get and set commands. You can define namespaces on the fly for your data and query with conditional operators. You can use labels to pivot and access your data for different views. In this way, you can add another dimension to your K/V storage and retrieve accordingly. <a href="https://serverless.com/cloud/docs/apps/data">See the docs</a> for more information. I strongly recommend watching <a href="https://youtu.be/zFS_teyuR8E?t=3460">the chat between Rick Houlihan and Jeremy</a> about the thought process behind the implementation of Serverless Data.</p><p><strong>The Future of Serverless Cloud</strong></p><p>A continuous flow of feedback from multiple sources is every product manager’s dream, and I’m currently living it. I’m really grateful for the buzz on social media about Serverless Cloud as it helped us look from different angles at our own product. Even before that, early beta users were helping tremendously to shape our features. We are not sticking to a long term roadmap, but there are several features that we’ll definitely add in the near future.</p><p>First of all, Serverless Cloud can’t be without events! We’ll be adding several event types to Serverless Cloud, like triggering functions on a record update and for inter- and intra-service communication. Second, we’ll give our users the ability to assign custom domains so you can share your Serverless Cloud applications with the world. Third, we’ll make the portability of existing Express apps easier so that you can migrate existing app into the Serverless Cloud with minimal effort.</p><p><strong>Wrapping up</strong></p><p>Software means something as long as it serves its business objectives. We want to let developers get rid of anything that distracts them from focusing on the business logic. We are still early, but we envision a world where all the infrastructure can be inferred <em>from</em> code. Serverless Cloud is ready for developers to build applications and deliver value to end users in the fastest way possible. We have granted access for a limited number of users in the scope of our exclusive launch and we’ll start to put newcomers on to the waitlist soon. If you want to be part of this journey, <a href="http://serverless.com/cloud">get your seat in our exclusive launch</a> before it ends.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42ad5906eca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Local Workstation Can’t Mimic the Cloud]]></title>
            <link>https://emrahsamdan.medium.com/why-your-local-workstation-cant-mimic-the-cloud-d868a05d52a8?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d868a05d52a8</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[remote]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Thu, 25 Mar 2021 09:26:30 GMT</pubDate>
            <atom:updated>2021-03-25T09:26:30.249Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*Kjc9_c4IPi2zUCAS" /></figure><p>If there is one thing developers love, it’s the control. This makes sense if you build something as complex as a software system, you need to understand what’s happening at every level. But absolute control can be a liability when it becomes the main goal of the development process.</p><p>Many developers go to great lengths to get the same system replicated locally that they run on a remote server with the hope of catching every error before it’s deployed. This is a pipedream. Getting your local machine to resemble the remote system is nearly impossible and the goal when creating software <em>should </em>be to get fast iteration times between releases. If you lose sight of that goal, it’s easy to get caught up in micromanagement.</p><p>In this article, we’ll discuss why development so often fails in staging environments and the benefits of developing and testing directly on the cloud services you’re running your production on.</p><h3>How the Cloud Differs from Local Environments</h3><p>Cloud providers offer different services. Some services, like virtual machines or containers, might resemble your own machine, while others might be entirely different systems. Understanding how cloud services differ from your local environment can help you improve your development and debugging processes.</p><h3>Multiple Servers</h3><p>First, a local machine is often just that: one machine. And there are cloud services that are also just a single computer. Every cloud provider will offer to rent you a virtual machine (VM), and often you can run the same software on it as you do on your local computer.</p><p>Even if you only build your app on VMs, you can quickly end up with multiple of them-one for your application servers, one for your database, and so on. Working on multiple VMs means you’ll run into distributed system problems you can’t <a href="https://blog.thundra.io/is-it-possible-to-debug-lambdas-locally">accurately model on your one, local machine</a>, because the latency between machines is now considerably greater.</p><h3>Geographically Distributed Deployments</h3><p>You may also find that all of your <a href="https://blog.thundra.io/introducing-observability-for-containers-and-vms">VMs are running in different geographical locations</a>. It’s easier to manage three VMs close to each other in one network than if they are spread across an entire continent. Network problems are more common when deployments are far apart, and you can quickly find yourself running in timeouts.</p><p>To keep latency in your application to a minimum, you’ll want your servers to be close to your clients. But if you have users in the U.S. and Australia, you have no choice but to deploy servers for each continent, making internal communication between these servers harder.</p><p>You can try to run multiple VMs on your own machine, and even simulate potential problems by injecting network issues and latency. But models can only go so far. A real deployment in the cloud will yield more accurate results. If this process is well planned, and you start your application with a cloud-based development process, such a test deployment could be quick and easy.</p><h3>Managed Services</h3><p>The cloud also offers managed services, which are usually built on top of VMs but don’t give you access to them.</p><p>Managed services are higher-level services like authentication or artificial intelligence. They give you an API and keep their inner workings to themselves. This lets you build systems faster than if you had to install everything you need to work on a blank VM.</p><p>If you try to mock managed services on your local machine you will likely end up with an incomplete clone, leaving room for errors from behavior that you forgot to replicate.</p><h3>Shared Services</h3><p>Many cloud services are virtual, meaning you don’t rent physical hardware. Instead you pay for an instance of a system that shares physical hardware with other instances, either of your own or that of other customers of that service.</p><p>This can lead to unexpected behavior if your application expects to have the whole system to itself. The other applications running on the same hardware could be badly optimized and can inadvertently leach resources from your application.</p><h3>Implicit Assumptions</h3><p>Software development is full of implicit assumptions that are rarely consciously considered. These can be related to distributed systems theory or implementation details. For example, if you send a request that is too big the API might time out. If you have too much delay between two requests that belong together, the API may not be able to consolidate them.</p><p>Even if you’ve done everything according to the documentation, and it worked when you tried it locally, it can still fail in the cloud. If you’d tested your assumptions with the real cloud service, however, you would have been able to catch these problems from the start.</p><h3>Debugging Locally Is Only Faster If It Works</h3><p>If you don’t have a cloud development environment at hand, you can lose a lot of time setting up an ad-hoc remote environment. Debugging locally is only faster than reproducing an error in a cloud environment if you can reproduce the error in your local environment.</p><p>If you get to the point where most <a href="https://blog.thundra.io/introducing-thundra-sidekick-intellij-idea-plugin">errors are best reproduced remotely</a>, there won’t be a benefit in continuing to use a local environment. That nice, low latency debugging won’t feel so good once you realize it doesn’t provide great results.</p><h3>Deployment Code Is Part of Your System</h3><p>The deployment process is a part of your software; infrastructure as code and deployment scripts are code after all. Though they’re often executed just once per release, that doesn’t mean they can’t be buggy or lead to bugs inside the deployed code of your software through faulty configured linters, code generators, or other deployment related tools.</p><p>Setting up a remote debugging environment will allow you to debug the deployment part of your software and keep things in line, even for code that doesn’t belong directly to your application.</p><h3>Summary</h3><p>Debugging isn’t easy and working from a local environment can provide a sense of security. But that doesn’t make it the best approach. Sure, running a script locally is quicker than deploying it in the cloud, and setting up ad-hoc environments in the cloud to test and debug your system costs time. But identifying bugs related to cloud-specific behavior may take a much longer time if you can’t catch them before deployment.</p><p>Managed cloud services aren’t cheap because they cost fewer dollars per hour to rent than hardware. They save you time and money in maintenance and setup costs. Debugging in the cloud can be slower in terms of latency and runtime while still giving you faster iterations for new releases.</p><p>Control is good, but controlling irrelevant things won’t help you achieve quick iteration cycles. Instead, these goals can be met with tools like Thundra Sidekick, which integrates with your local IDE to make online debugging second nature. <a href="https://www.thundra.io/thundra-overview?utm_source=adwords&amp;utm_medium=cpc&amp;utm_campaign=PdSrch_Google_Branded_US__18&amp;utm_content=lp_video&amp;utm_term=%2Bthundra&amp;hsa_acc=2925991331&amp;hsa_cam=1613693209&amp;hsa_grp=60589959003&amp;hsa_ad=496490551894&amp;hsa_src=g&amp;hsa_tgt=kwd-543466030072&amp;hsa_kw=%2Bthundra&amp;hsa_mt=b&amp;hsa_net=adwords&amp;hsa_ver=3&amp;gclid=Cj0KCQiAyJOBBhDCARIsAJG2h5eNOOnikBic4IaHnpiRB_IS6tg_qdo5OQpfem70g9XwRAqN4pyzkAwaAmxDEALw_wcB">Get started today.</a></p><p><em>Originally published at </em><a href="https://blog.thundra.io/why-your-local-workstation-cant-mimic-the-cloud"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d868a05d52a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is It Possible to Effectively Debug Your Cloud Applications?]]></title>
            <link>https://emrahsamdan.medium.com/is-it-possible-to-effectively-debug-your-cloud-applications-7de23ec93368?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7de23ec93368</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[remote]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Fri, 12 Feb 2021 11:57:33 GMT</pubDate>
            <atom:updated>2021-02-12T11:57:33.464Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*33JqfuElw-ccSFDZ" /></figure><p>Debugging code is a skill every developer needs to acquire. As developers work on larger and more complex projects, debugging in the cloud before going to production has become crucial. Even debugging your code by mocking all of your cloud resources in your local environment may not prepare you for what will happen when millions of requests are being processed through that code in production.</p><p>To make matters more challenging, modern system architecture, like microservices, can make it more difficult to debug applications on cloud. Microservices help isolate different modules and their functions. This isolation provides many benefits, but it also makes it harder to track bugs and errors.</p><p>This is just one of a few reasons a developer might struggle when debugging code. But, there is hope. Developers can debug, they just need tools or third parties that provide features like observability and non-breaking breakpoints to do so.</p><p>In this article we will discuss some of these features as well as how they can benefit developers.</p><h3>How to Debug Without Breaking Anything</h3><p>Debugging cloud applications is tricky because you can’t just stop running your code to see what is going on. Instead, you need to utilize tools that allow you to track what is occurring without stopping the entire system. These tools should allow you to correlate traces to logs, implement non-breaking breakpoints, and provide clear insights into production logs.</p><h4>Correlating Traces with Logs and Metrics</h4><p>One helpful feature in a debugging tool is the ability to <a href="https://blog.thundra.io/tracking-the-kpis-of-unique-traces">correlate traces with logs</a> and metrics. This means that in your application you can push a request (or trace) and track the variables it touches, how long it takes to flow between different services, and other metrics. All of these features can drastically reduce the time it takes to track the root causes of bugs, bottlenecks, and exceptions.</p><p>It’s especially helpful if the solution provides the ability to drill down into the detail of the logs. With this feature, a developer can get insight into exactly what portion of code was attributed to the specific outputs and variables are inside of the logs.</p><h4>Non-Breaking Breakpoints</h4><p>Breakpoints in development allow a developer to stop their application and see the state of the variables and objects. This is not always necessary.</p><p>Non-breaking breakpoints, however, allow you to view stack traces, global variables, and individual watch variables, all without halting your application as you would with a normal debugger.</p><p>Utilizing non-intrusive breakpoints allow developers to avoid stopping their code or redeploying/restarting their code base to test their assumptions on what bugs and issues might be causing problems.</p><h4>Logging and Log Analyzers</h4><p>Logs by themselves are an old fashion way of tracking bugs. On their own they are time consuming and can be difficult to assess. Thankfully, these days there are many modern software services that can help analyze logs without the need to parse through every line printed out.</p><p>These log analyzers can help track and surface metrics, error rates, and abnormal behaviors. In turn, these tools can help developers quickly pinpoint problems in production without directly accessing logs.</p><h4>Automatic Exception Capture</h4><p>One of the biggest challenges developers face when debugging is knowing if there is a bug in the first place. In order to detect these issues before they become problems, your team can develop systems that automatically capture and track exceptions as they occur.</p><p>Some errors don’t arise often, and these obscure errors can lead to challenges when it comes to tracking down issues. For example, an error may be generated due to the browser version, or because of an anomalous stack overflow that occurs only once every 30 clicks. This can be very difficult to track because the error only happens under very specific circumstances.</p><p>Not only is it important to capture these errors. Your team also needs to be able to replicate errors on their end. Using logs and variable capture systems, many of these automatic exception capture systems such as <a href="https://www.thundra.io/sidekick">Thundra Sidekick</a> can help replicate these errors.</p><p>In addition, systems that automatically track these exceptions can also identify patterns for you. Overall, this can help you debug your cloud applications, regardless of whether or not your system is a microservice.</p><h3>Modern Architectures Benefit from Cloud Debugging</h3><p>A popular design pattern in modern software is microservices. As discussed earlier, microservices provide isolated modules of code that aren’t highly coupled with every other piece of code in an application.</p><p>For example, an e-commerce site might have services for inventory, shipping, and accounts. This makes it easy for developers to update code and push changes because they don’t need to worry about breaking something in the shipping module when they change the inventory module.</p><p>The problem is, this same benefit makes it difficult to assess how variables and requests flow through the entire system.</p><h3>How Thundra Sidekick Can Help</h3><p>Thundra Sidekick helps you debug your cloud applications in development, staging, testing, and even in production by increasing observability into a code base.</p><h4>Debugging Pre-Production Cloud Applications</h4><p>Thundra eases the life of development teams by pinpointing the root cause of issues in distributed modern architectures. To achieve this goal, Thundra is making available non-intrusive options for debugging cloud applications by focusing on pre-production environments.</p><p>Thundra Sidekick enables developers to set non-breaking breakpoints in their applications on the cloud without leaving their IDE. This helps them take snapshots when the code is passing that breakpoint. This is useful for understanding the applications without re-deploying after printing new log lines.</p><p>By integrating Thundra Sidekick with Thundra’s existing distributed tracing capabilities, developers gain context by being able to see detailed snapshots and the whole distributed trace in the same pane. Thundra provides end-to-end visibility into cloud applications.</p><p>In Thundra Sidekick, non-intrusive breakpoints are referred to as “tracepoints,” to salute their unique integration with distributed tracing. Application teams can reduce the time spent on issues in development environments, staging, and production and also improve development cycle times drastically.</p><p>If you’d like to be a beta customer for Thundra Sidekick, you can sign up <a href="https://thundra.io/sign-up">here</a> and we’ll onboard you with our white-glove service.</p><h4>Debugging Is Possible with the Right Tools</h4><p>Debugging cloud applications is not only possible when your team has access to the right tools, it is necessary. The key is to make sure that the tools don’t break anything in your cloud environment as you debug your code.</p><p>Thundra has non-breaking breakpoints, autonomous exception capture, and the ability to correlate traces to logs and metrics. Each of these features alone can drastically improve a developer’s debugging experience. However, when they work together you’ll get the next level of observability and debugging capability for cloud applications.</p><p>Even debugging and tracing in systems using microservice architecture can be made easier, despite a lack of observability, as long as you pick the right tool for the job.</p><p><em>Originally published at </em><a href="https://blog.thundra.io/is-it-possible-to-effectively-debug-your-cloud-applications"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7de23ec93368" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Fine grain” tracing with Thundra]]></title>
            <link>https://emrahsamdan.medium.com/fine-grain-tracing-with-thundra-125e472b5eaf?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/125e472b5eaf</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[distributed-tracing]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[instrumentation]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Wed, 26 Aug 2020 13:26:13 GMT</pubDate>
            <atom:updated>2020-08-26T13:26:13.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*SRoHrRPlFT4iouDE.png" /></figure><p>Thundra provides <a href="https://blog.thundra.io/why-is-end-to-end-tracing-important-for-serverless">rich auto-tracing out of the box</a> to instrument AWS SDKs, infrastructure, and Lambda. Engineers can enhance the traces to provide additional business context. This enhancement is referred to as “logical” or custom spans, which help end users debug and understand performance in the context of business operations. Logical tracing isn’t difficult, but it does require custom instrumentation.</p><p>In this article, you’ll learn how logical spans are instrumented to provide additional business and operation context, when and how to perform the instrumentation, and how fine-grain trace spans are different from span tags. Finally, we’ll see a demonstration of instrumenting an application and observing it using fine-grain traces.</p><h3>Logical Spans</h3><p>Logical spans record notable business events, often performed by businesses for or on behalf of users. Common business events include:</p><ul><li>User logged in</li><li>User changed settings</li><li>Purchase</li><li>Cart action</li></ul><p>Business events are the touchpoint between a business and its customers. The act of capturing, and representing, these events using distributed tracing is called a logical span (or event). Logical tracing is the act of instrumenting code for logical spans, with the logical span representing the business event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/0*oi1sXATXiHv_r3Vp.png" /><figcaption>Figure 1. Traces without and with logical spans</figcaption></figure><p>It isn’t possible for tooling to automatically know which events are important to any given business. This means that logical spans require manual instrumentation (covered later). Logical spans comprise a group of concrete actions. These actions are “how” business value is accomplished, and logical spans represent the “what”: the actions the company is executing on behalf of or for the customer.</p><h3>Why Logical Spans?</h3><p>Logical spans help in both debugging and in understanding the client experience. They connect the business with the client and the “how” with the “what.” Infrastructure, serverless, programming languages, and database technologies are implementation details, and most clients don’t care which technologies are used as long as the product is up and the technologies don’t adversely affect pricing. Clients only care about getting value from your product, and logical spans help companies observe how the implementation details are functioning to deliver that value. Here are some ways that logical spans help businesses to understand their client’s experience and ensure that the client is having a positive experience.</p><h3>Understanding Common User Actions</h3><p>Logical spans help to document current user actions. Engineers translate the original product specifications, the “what,” into the “how.” During this translation, the original “what” is often lost.</p><p>Consider a company that provides authentication for its users; the feature that “logs users in” may have an implementation like this:</p><ol><li>Validate input.</li><li>Check the session store for session.</li><li>Authenticate username/password.</li><li>Save session.</li><li>Set cookie.</li><li>Return to the user.</li></ol><p>Logical spans are explicit instrumentation named after the client event, in this case, login. Logical spans group these “how” events together, name them, document them for a cohesive action on behalf of the user, and measure them.</p><h3>Aiding in Debugging</h3><p>Capturing user events as logical spans aids in debugging. Logical spans can add metadata in the form of trace tags and error results. Instead of “redis” GET failing, the logical trace will display the business action “login error.” By tagging logical spans with errors, an engineer can first check if the user action is working (has an error? Yes or no) and if it’s not working, begin debugging by drilling into the implementation details.</p><p>Logical spans aid in debugging by adding a level of abstraction. They’re a lot like a car dashboard, which shows a handful of lights, including the “check engine” light and the oil light.</p><p>They don’t, however, display every metric that every subsystem generates: temperature, fuel-to-air ratios, etc. Similarly, logical spans operate as top-level “lights” to indicate high-level customer-impacting issues. Once an issue has been surfaced using logical spans, engineers can dive into low-level implementation details to debug it, much like a mechanic debugging low-level car issues.</p><p>Traces that contain logical spans make it easy for engineers to see which end-user actions are impacted.</p><h3>Giving Engineers Contex</h3><p>Logical spans group specific implementation spans, helping to provide context and understanding of the specific actions required to support customers. When implementation details are grouped under a logical identifier, it’s easier to understand the <em>purpose</em> of the individual actions. Backend engineers may not be very familiar with the product or the end user, but this creates a bridge between them and the end user.</p><p>Logical traces also provide context to built-in Thundra features, such as <a href="https://blog.thundra.io/tracking-the-kpis-of-unique-traces">unique traces</a>. Logical spans make it easier to connect traces with the client action they are orchestrating. This context is especially useful for adding meaningful descriptions to <a href="https://blog.thundra.io/tracing-eventbridge-events-with-thundra">EventBridge events</a>. Thundra can ingest <a href="https://aws.amazon.com/eventbridge/">EventBridge events from any AWS-supported source</a>.</p><h3>How Do We Implement Logical Spans?</h3><p>Logical spans are relatively simple to implement:</p><ul><li>Identify — List the important user events.</li><li>Instrument — Modify the code to capture the logical span using a client library.</li><li>Verify — Ensure the instrumentation works as expected.</li></ul><h3>Identify</h3><p>The purpose of the following Lambda, named “Scraper,” is to update a user’s profile with information from social media. Figure 2 lists the code for the Scraper Lambda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*v1DyYSmXCzADxTQW.png" /><figcaption>Figure 2. Scraper Lambda code</figcaption></figure><p>The Lambda has five distinct operations:</p><ul><li>Get the user’s profile.</li><li>Make a request to Twitter.</li><li>Save the results.</li><li>Make a request to Facebook.</li><li>Save the results.</li></ul><p>The Lambda’s purpose is to “update the user profile,” and the trace for this Lambda using Thundra’s auto-instrumentation looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*UKIckJjlhWddygXY.png" /><figcaption>Figure 3. Scraper Lambda trace</figcaption></figure><p>The action the company is providing for the customer is to update the user profile, which we’ll call “update_user_profile.”</p><h3>Instrument</h3><p>The next step is to instrument the logical trace using Thundra’s instrumentation API. This requires you to create a new span, which is the logical span. To instrument a logical span, you must set a parent span that groups each of the concrete operations. This allows the operations to be nested under the logical span.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*UYXfGo3ktzZS1wDh.png" /><figcaption>Figure 4. Instrumenting a logical span</figcaption></figure><p>Thundra also supports <a href="https://docs.thundra.io/debugging/offline-debugging">offline debugging</a>, which can help ensure that instrumentation works and is error-free.</p><h3>Verify</h3><p>The final step is to deploy the newly instrumented code and to verify that the logical span shows up as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*MrTRaKmkTLgP9JFI.png" /><figcaption>Figure 5. Verify logical span</figcaption></figure><p>The code now surfaces the logical span, which represents the client action being executed.</p><h3>An Alternative: Decorating Function Calls</h3><p>Another viable option is instrumenting function calls. Sometimes custom instrumentation is not possible because of time constraints. Thundra offers serverless integrations that <a href="https://docs.thundra.io/python/integration-options#serverless-framework">auto-instrument Lambda function calls</a>. Thundra can instrument Lambdas using Amazon Lambda layers without <strong>any </strong>code changes, allowing you to <a href="https://docs.thundra.io/thundra-web-console/functions-list-page#instrumentation">toggle on Lambda function instrumentation</a> through the Lambda UI.</p><h3>Alternative: Using Tags</h3><p>Instead of creating a logical span, you can tag concrete spans <a href="https://blog.thundra.io/enhancing-distributed-tracing-with-business-context">with important user attributes</a> such as user action, user IDs, and other user-focused metadata. This is a viable option. One benefit to an explicit logical span is that concrete spans will be grouped underneath the logical span. This makes it obvious which concrete spans are involved with orchestrating customer actions.</p><h3>Alternative: Logically Scoped Lambda</h3><p>A logically scoped Lambda has a name that represents the logical operation. In the example above, the Lambda was named “Scraper,” but its purpose was to update a user’s profile. Changing the Lambda’s name to “Update User Profile” better describes the Lambda and generates the default trace from Thundra’s integration.</p><p>Whenever a Lambda performs a single user action, naming the Lambda to represent that action is an easy win and doesn’t require that you add another logical span. If a Lambda doesn’t map one-to-one with a user action or it performs multiple user actions, you should use manually instrumented logical spans.</p><h3>Logical Spans: Monitoring Business Context</h3><p>Logical spans are tools to help connect implementation details (the how) with the customer experience (the what). Logical spans help with debugging by indicating which client actions are impacted and the steps required for orchestrating those actions. Logical spans are easy to add and can provide engineers with important context while aiding in debugging. Thundra provides <a href="https://github.com/thundra-io">open source client libraries</a> which make instrumenting logical spans and understanding your client experience easy!</p><p><em>Originally published at </em><a href="https://blog.thundra.io/fine-grain-tracing-with-thundra"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=125e472b5eaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do you really need Kubernetes?]]></title>
            <link>https://emrahsamdan.medium.com/do-you-really-need-kubernetes-6b6d7006d059?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b6d7006d059</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 10:50:34 GMT</pubDate>
            <atom:updated>2020-06-29T10:50:34.450Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*nUyWUwu3Acf7amOd.png" /></figure><p>When it comes to container orchestration, everyone thinks “Kubernetes!” After all, this is what the cool kids do. But as you guessed from the title of this article, you might want to pause for a moment before jumping on the bandwagon. Indeed, Kubernetes has a (very) steep learning curve, a bewilderingly vast ecosystem, and a seemingly infinite landscape of third-party providers attempting to sell you some kind of “easy Kubernetes” (which in itself is a telltale sign of its complexity). At the end of the day, dealing with Kubernetes can be mind-numbing.</p><p>In this article, we’ll take a look at various use cases where Kubernetes is one solution, but where there are also alternatives that actually might be better.</p><h3>Example of a Three-Tier Website</h3><p>Let’s consider first the archetypal use case of a three-tier website: load balancing, app, database. And let’s assume the app tier can automatically scale out and in, based on traffic. Now, let’s take a look at how different options handle this setup.</p><p><strong>With Kubernetes</strong></p><p>Kubernetes can handle all three tiers and provides solutions for each of them. It can also provide autoscaling, although interestingly this is not native in Kubernetes and requires plug-ins.</p><p>The configuration, however, will be quite complicated, including stateful storage for the database tier. Autoscaling would typically be based on Prometheus alarms as well, meaning you would have one more software to understand, install, and configure…</p><p>It is interesting to note that at the end of the day, Kubernetes will interface with your cloud vendor to provision VMs, storage, load balancers, etc. So whether you use Kubernetes or not, you’ll most likely end up using the same cloud resources either way.</p><p>Importantly, Kubernetes’ worker nodes and control-plane nodes still require <a href="https://blog.gruntwork.io/zero-downtime-server-updates-for-your-kubernetes-cluster-902009df5b33">regular maintenance and patching</a>. So the onus is essentially on you to perform such maintenance activities, and the disruption to the Kubernetes cluster is quite significant. To be blunt, this is actually quite a significant pain point and is technically outside of Kubernetes’ scope since Kubernetes only manages the containers, not the VMs running the containers.</p><h3>Alternative on AWS: Use Managed Services</h3><p>With AWS, all three tiers can be handled by AWS services. The load-balancing tier can be handled with <a href="https://aws.amazon.com/elasticloadbalancing/">Elastic Load Balancing</a>, and such a solution has multiple advantages: high availability, built-in autoscaling, and zero maintenance.</p><p>The app tier can be handled by <a href="https://aws.amazon.com/ecs/">ECS</a>, a container-orchestration system like Kubernetes. Although it’s simpler and offers less features, ECS is much easier to configure and integrates well with other AWS services, such as Parameter Store and IAM. If you’re using <a href="https://aws.amazon.com/fargate/">Fargate</a> as the backend (and you probably should unless you have very specific requirements), you’re also freed from any maintenance operations. Plus, autoscaling uses CloudWatch alarms, so you don’t need to install and configure extra software. Furthermore, AWS Fargate is a step change in container orchestration and relieves you from having to think about worker nodes; e.g., you no longer have to manage two layers of autoscaling (containers and worker nodes).</p><p>You should definitely consider ECS backed by Fargate unless there are specific reasons why you can’t use it, for instance, if you need GPU-equipped instances, which Fargate doesn’t support, yet.</p><p>The database tier will typically be handled by <a href="https://aws.amazon.com/rds/">RDS</a>. In just a few tick boxes, you can configure daily backups, a standby instance in a different <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html">availability zone</a> with automated failover, read replicas, etc. Again, no maintenance is required from you, as this is managed automatically by RDS, and obviously, you don’t have to handle the configuration of stateful storages, etc.</p><h3><strong>Another Alternative on AWS: A Serverless Website</strong></h3><p>If your website is “modern” (i.e., it consists of a set of static files with JavaScript that perform API calls), you can use the API Gateway backed by Lambda functions. This allows for both your web server and app tiers to be easily handled using serverless services.</p><p>Additionally, the database tier can be handled by Aurora Serverless (watch out for the costs, though!) for an entirely serverless solution. With such an architecture, autoscaling and high availability are built in, and you’ll have no hassle with maintenance and patching.</p><h3>Another Use Case: Batch Jobs</h3><p>Let’s take another example: long-running, compute-intensive jobs. Typically, a job queue would enqueue job requests, which would be served by a compute cluster. Let’s again assume that the cluster can automatically scale out and back in, based on the size of the job queue (i.e., how many jobs are pending).</p><p><strong>With Kubernetes</strong></p><p>This use case requires a job queue to store and manage job requests. Unfortunately, Kubernetes <a href="https://kubernetes.io/docs/tasks/job/fine-parallel-processing-work-queue/">doesn’t offer any built-in solution</a>. So once again, you would have to rely on additional software such as RabbitMQ or Redis.</p><p>The autoscaling part would again be tricky, since you would have to extract the required information (number of pending job requests) from that third-party software.</p><p><strong>With AWS</strong></p><p>Such an architecture would typically be based on <a href="https://aws.amazon.com/batch/">AWS Batch</a>, which manages your batch jobs and offers a built-in job queue. It can use either Docker or EC2 instances as its backend, and you can save money by using Fargate or <a href="https://aws.amazon.com/ec2/spot/">Spot Instances</a>.</p><p>Again, the simplicity and efficiency of a managed solution shines through.</p><p><strong>With Docker Swarm</strong></p><p>Docker now offers a “ <a href="https://docs.docker.com/engine/swarm/">Swarm mode</a>.” The main advantage of Docker Swarm is that it’s very easy to set up; your Docker Swarm cluster can be created, configured, and go live in just a couple of hours.</p><p>Unfortunately, Docker Swarm is quite limited and offers no built-in queue, so you need to bring your own solution for that; plus, there’s no easy way to manage autoscaling…</p><h3>The Main Argument: Avoid Vendor Lock-In</h3><p>Many companies choose Kubernetes in order to avoid vendor lock-in. The argument here is that since Kubernetes itself is independent of any cloud vendor, it should be easy to switch vendors at any time. However, this reasoning is usually flawed. The rational decision would be to compare the cost of changing cloud vendors to the cost of creating and maintaining a truly cloud-agnostic Kubernetes cluster.</p><p>Given there are only three major cloud providers ( <a href="https://aws.amazon.com/">Amazon AWS</a>, <a href="https://cloud.google.com/">Google GCP</a>, and <a href="https://azure.microsoft.com/">Microsoft Azure</a>), you don’t have many choices when it comes to switching, anyway. As to smaller providers, they are notoriously less reliable-you might as well jump off a cliff before deciding on one of them. So, the odds of you changing cloud providers for a given workload are quite low; and if you do change, you’d probably do it only once.</p><p>Kubernetes is difficult, and you would typically require a full-time DevOps engineer (maybe part-time after the initial setup phase) for a not-so-complex Kubernetes cluster. You need to take this cost into account when deciding on whether to adopt Kubernetes or not.</p><p>All in all, it can certainly be argued that fears surrounding vendor lock-in are often exaggerated and that the cost of a single move from one cloud provider to another may be less than the cost of setting up and maintaining a truly cloud-agnostic Kubernetes cluster. Remember, if you use a managed solution, such as <a href="https://aws.amazon.com/eks/">Amazon Elastic Kubernetes Service</a> or <a href="https://cloud.google.com/kubernetes-engine/">Google Kubernetes Engine</a>, you are not truly cloud-agnostic.</p><h3>Conclusion</h3><p>The main takeaway here is that you should think twice before following the crowd and going down a path that could be both perilous and costly. Make sure to take into account the costs associated with both you and your team getting familiar with Kubernetes, as this is often overlooked and can actually be quite large.</p><p>If you do decide to go with Kubernetes, you should generally use a managed solution, such as GKE (Google Cloud) or EKS (AWS). These will make your life a lot easier than doing <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">Kubernetes the hard way</a>, and you would only be trading a bit of vendor lock-in for a much simpler life.</p><p>At the end of the day, container orchestration is meant to solve a problem. So first, make sure you are clear on what you want to solve, and then consider other options besides Kubernetes before making a decision.</p><p>Also keep in mind that serverless is growing in popularity and can be used to solve many problems that used to be addressed by either traditional architectures or container-based architectures. Running your code without having to worry about the maintenance, availability, and scaling of the underlying infrastructure is definitely a step change in cloud computing.</p><p>One final note about security: Using Kubernetes (and the additional services typically required to run a Kubernetes cluster, such as Helm and Prometheus), increase the surface attack of your architecture. The infamous <a href="https://www.theregister.co.uk/2018/12/03/kubernetes_flaw_cve_2018_1002105/">CVE-2018–1002105</a> was, after all, a high-profile and very dangerous vulnerability in Kubernetes…</p><p>So, keep your eyes open and your mind sharp. The cool kids’ toys might simply not be the best for you. And if you’re having issues with debugging, tracing, or securing your cloud architecture, Thundra is here to help.</p><p><em>Originally published at </em><a href="https://blog.thundra.io/do-you-really-need-kubernetes"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b6d7006d059" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which database should I choose for my serverless applications?]]></title>
            <link>https://emrahsamdan.medium.com/which-database-should-i-choose-for-my-serverless-applications-a2fb1260ae98?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2fb1260ae98</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 10:51:47 GMT</pubDate>
            <atom:updated>2020-06-01T10:51:47.450Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*AnHyx0MjJXrplHTE.png" /></figure><p>Choosing the right database has one of the most direct effects on the cost and performance of your application. A serverless environment is no exception to this principle. By considering parameters like access patterns, schema (data model), and expected performance, it’s possible to logically arrive at an optimal decision for your database type.</p><p>Databases, in general, have two broad classifications: SQL relational or normalized databases and NoSQL or denormalized databases. A third classification has also arisen for specific use cases like modeling graphs, in-memory caching systems among others.</p><p>But in this article we’ll explore certain aspects of SQL and NoSQL databases and take a look at the services offered by AWS for those respective types of databases.</p><h4>SQL Databases</h4><p>SQL, or relational databases, use Structured Query Language for working with data. It’s a powerful language and one of the most versatile options out there for handling data. You can make complicated queries for retrieval, which comes in quite handy if you are looking to perform data analysis aka OLAP (online analytical processing).</p><p>SQL excels in handling multi-row transactions at scale. This type of database is the right choice if you don’t fully understand the access patterns your application may have over time and don’t expect exponential growth.</p><p>However, SQL databases come with their share of drawbacks. The schema needs to be defined before you can start working with the database, requiring significant preparation and planning. Once the data model has been setup, you’ll need to maintain that structure throughout the existence of your application.</p><p>Scalability can also be problematic as SQL systems have vertical scaling; adding more CPU and RAM to handle the load can become very expensive, and there is a limit to how much you can “scale up”. You can always add more servers, or “scale out,” but that requires extensive effort and comes at a steep cost.</p><h4>NoSQL Databases</h4><p>NoSQL databases unlike SQL don’t have a specific query language and champions the concept of working with denormalized data sets.</p><p>Their types include:</p><ul><li>Document-Based</li><li>Key/Value Pairs</li><li>Graph Data</li><li>Column Oriented Data Structure</li></ul><p>The elimination of complex joins across tables by simply putting everything in one collection with a systematic access pattern is the highlight of NoSQL databases. Their high performance, scalability, and extensibility makes NoSQL a perfect match for serverless development.</p><p>NoSQL databases are known for their ability to scale out to handle tremendous OLTP (online transactional processing) work loads and manage disparate data sets. Also, changing the schema won’t disrupt your currently working application.</p><p>Dynamic schemas + high performance at peak = best database option, right? Not quite so. If you are unsure of what data patterns your application entails then it’s probably best to avoid NoSQL or invest time into learning NoSQL first before shooting yourself in the foot.</p><p>Think of it this way, a startup will probably benefit in getting out an MVP as soon as possible by choosing SQL databases because of the flexibility and general developer familiarity over NoSQL systems, but a NoSQL database can lead to future gains because of its very high scalability. The only hurdle is appropriate data modelling so as to service the future needs of data access effectively.</p><p>Those who start with NoSQL from a SQL background without the proper understanding of access patterns may walk themselves into a corner or use NoSQL as if it was still SQL. This will also impact your application as it grows.</p><p>With that being said, let’s explore Amazon’s managed versions of SQL and NoSQL services: <a href="https://aws.amazon.com/rds/">RDS</a> and <a href="https://aws.amazon.com/dynamodb/">DynamoDB</a>, and their performance with Serverless applications.</p><h4>Amazon RDS vs DynamoDB</h4><h4>Amazon RDS</h4><p>Amazon Relational Database Service (RDS) comes with six engines to pick from, MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and their own implementation, Aurora.</p><p>As explained already, relational databases follow a set pattern of structured data modeling and are governed by the SQL language for data handling. So if your decision is to go with Amazon RDS, here are a few key areas to be aware of.</p><p>Your Lambda functions are pay-per-use but you will pay the hourly pricing for RDS instances unless your choice of engine is <a href="https://aws.amazon.com/rds/aurora/serverless/">Aurora Serverless</a>.</p><p>Managing the connection limits with Lambda is important. Lambda does terminate connections on container expiration but the MAX CONNECTIONS issue still looms when the application comes under stress.</p><p>Utilizing <a href="https://aws.amazon.com/rds/proxy/">RDS Proxy</a>, lowering connection timeouts for RDS, implementing a caching strategy, limiting concurrent connections, etc. are some ways to deal with this problem.</p><p>Amazon’s Aurora database service (either MySQL or PostgreSQL) can prove to be a great option especially in terms of read performance (across regions too) owing to their ability to replicate quicker than RDS counterparts.</p><p>Aurora does have clear differences in terms of performance and high availability when compared to RDS but it comes with an increased cost. Aurora should be chosen if your use case demands it. Aurora Serverless can be the next best thing for a fully serverless system but its performance isn’t quite there yet.</p><p>Its main problem is dealing with <em>cold starts</em>. Aurora Serverless should ideally be chosen for testing or for small and inconsistent workloads.</p><h4>Amazon DynamoDB</h4><p>Now if DynamoDB is the choice for your application storage needs, the following is what you get.</p><p>Unlike most NoSQL databases, DynamoDB is not server-based. It’s pay-per-request pricing and fits in perfectly with the Serverless way of things. This makes the idea of fully distributed serverless systems a close reality.</p><p>DynamoDB can virtually have unlimited concurrent requests as long as the throughput limits have been defined.</p><p>There is an additional model called <strong>PAY_PER_REQUEST </strong>which allows your DynamoDB database to scale to 0.</p><p>With millisecond performance, DynamoDB can handle almost any load you throw at it.</p><p>If you need even better read times, DAX (DynamoDB accelerator) is a fully managed, in-memory cache solution that Amazon offers. So performance and scalability are the least of your worries with DynamoDB.</p><p>DynamoDB with Lambda seems like a great choice from a cost and performance perspective. The only hurdle is designing the table for effectively servicing the varied access patterns your application may have.</p><h4>Monitoring on Thundra</h4><p>Thundra’s platform for serverless observability and monitoring can further improve your costs and performance by giving actionable insights about your application. Traces with detailed information between various services of the application pinpoint areas of inefficiencies, which you can then fix. With regard to databases, especially with RDS instances, having insights about long-running queries tells you exactly which specific part of the application needs to be optimized.</p><p>Let’s take an overview of what Thundra looks like. Once <a href="https://thundra.io/">signed</a> up, Thundra guides you through the onboarding process of instrumenting your Lambda functions. Your architecture and dashboard screens should look something like this.</p><p><em>(Note: Both screens show details based on functions being grouped to a project. Unless specified, all instrumented functions will belong to “default project”)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*m8KFbD2iST99HFFC.png" /></figure><p>The dashboard at a glance will give you direct and important insights that need your attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zcGE-TLk1EDFw6qx.png" /></figure><p>Clicking on the traces between the services in the architecture view will list out every single trace detail which on selecting will navigate to a page with detailed information about that invocation as below.</p><p>As you can see in the image, we are able to gain additional insight into DynamoDB and our PostgreSQL database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SUG2NtJVm5hIVLPE.png" /></figure><p>You can also view the above invocation detail page from a list of <em>Unique traces (traces that perform a specific operation in an application is regarded as a Unique trace)</em> by navigating from the left panel. By filtering out <em>Long-running unique traces </em>you know which specific queries are increasing your cost and slowing down the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F_qosLMuz4aC4wbn.png" /></figure><p>A quick look at Thundra’s navigation panel on the left shows the different ways you can approach application monitoring. Thundra collects every trace between your function and other services to ensure that you have all the data needed for optimizing the application to its fullest potential.</p><h4>Conclusion</h4><p>We have seen how SQL and NoSQL databases work with their strengths and weaknesses. We also took a quick look at Amazon’s database services and how monitoring them with a platform like Thundra can enhance your metric tracking capabilities for serverless optimizations.</p><p>SQL databases will get the job done for most use cases, not to mention their robust data access and manipulation capabilities, provided you are not expecting millisecond performance at scale.</p><p>On the other end, a NoSQL database like DynamoDB can do all the heavy lifting even at peak use without you having to worry about server management or failovers.</p><p>It’s quite possible to achieve a result similar to SQL querying, but DynamoDB requires a learning curve in terms of data modeling and knowing how to index table attributes for efficient access patterns.</p><p><em>Originally published at </em><a href="https://blog.thundra.io/which-database-should-i-choose-for-my-serverless-applications"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2fb1260ae98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Lambda Limits to Keep in Mind When Developing a Serverless Application]]></title>
            <link>https://emrahsamdan.medium.com/aws-lambda-limits-to-keep-in-mind-when-developing-a-serverless-application-7692b0f6e527?source=rss-49ac2964aea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7692b0f6e527</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Emrah Şamdan]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 10:33:11 GMT</pubDate>
            <atom:updated>2020-06-01T10:33:11.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*2vgh_ZPsSahX-G-4.png" /></figure><p>Serverless is great, it helps companies focus on product and application development without having to worry about the application’s infrastructure and scaling under various conditions.</p><p>However, there are some soft and hard limits for every AWS service you should need to keep in mind when developing a serverless application. These limits are meant to protect the customer as well as the provider against any unintentional use. As well as provide guardrails to ensure you are following best practices.</p><p>In this article, we will take a closer look at AWS Lambda limits and explain how to avoid them.</p><h4>Deployment Package Limits</h4><p>There is a hard limit of 50MB for compressed deployment package with AWS Lambda and an uncompressed AWS Lambda hard limit of 250MB.</p><h4>How do we avoid these limits?</h4><h4>Advanced Packaging</h4><p>Use an IAC (Infrastructure as Code) framework that supports advanced packaging such as include/exclude patterns.</p><p>Use <a href="https://webpack.js.org/">Webpack</a>, a well-known tool that will create bundles of assets (code and files). Webpack helps to reduce and optimize the packaging size by:</p><ul><li>Include only the code used by your function</li><li>Optimize your <strong>npm</strong> dependencies</li><li>Use a single file for your source code</li></ul><h4>Set a Max deployment package size for your team</h4><p>Meet with your development team and set a max package size for every AWS Lambda deploying into your account. Then add this check to each deployment. If the deployment package size is above the threshold (e.g. greater than 10mb), break the deployment.</p><h4>Stop reaching 3rd party dependencies</h4><p>Use less third party packages. Too often we reach for simple dependencies when there are native libraries we can take advantage of instead. In a non-serverless world, this is fine. In a serverless world, this is going to be costly.</p><p>If we can’t get away from using large dependencies or binaries like FFMPEG or ML/AI libraries like <strong>scikit-learn</strong> or <strong>ntlk</strong> with AWS Lambda, then we have to be more creative.</p><h4>AWS Lambda Layers</h4><p>Sometimes people will recommend AWS Lambda Layers as a solution to this problem, Unfortunately, even if we put these large binaries into an AWS Lambda Layer and attach it to our AWS Lambda function. We still can’t escape the 250mb hard limit.</p><p>Using an AWS Lambda Layer does have other benefits though, such as reducing deployment time as you will stop deploying your large binary with each code change and you are also isolating reusable dependencies which can be shared across services.</p><h4>Hacky Workarounds</h4><p>The other option we have if we really need to pack more dependencies into our AWS Lambda function is to put our large binary or dependency into an AWS S3 bucket. Then add a few lines of code to download that AWS S3 file when the function is executed.</p><p>This will lead to a long cold start, but subsequent requests will be quick. It’s not recommended as a production architecture as it’s brittle, but if you need to get around the deployment size limit you can make use of this strategy for development.</p><h4>Total Size of All Deployment Packages</h4><p>In your AWS account, you will have a region-wide soft limit of 75GB for all AWS Lambda functions that have been deployed. That sounds like a lot, but it really isn’t. Most people learn this the hard way when their deployments stop working.</p><p>If you hit this soft limit you can have the value increased by creating a support ticket with a service quota limit increase. However, that may just be masking the problem similar to the “Hacky Workarounds” section above.</p><p>Just because we can do something, doesn’t mean we should. Instead, let’s talk about why this limit gets hit and catches teams off guard.</p><p>A lot of IAC (Infrastructure as Code) frameworks will version your AWS Lambda functions as you make additional deployments and these same frameworks don’t typically have built-in versioning clean up.</p><p>This means if we make 50 deployments over the span of a couple weeks without cleaning up our versions. We will have 50 versions of our AWS Lambda code and all the dependencies that were packaged up with that AWS Lambda function.</p><h4>How do we avoid this limit?</h4><p>We can avoid this limit by being cognisant that the limit even exists and taking steps to make sure we don’t keep every old version of our AWS Lambda function.</p><p>Versioning is an important concept and we are not recommending that you don’t version at all, but rather recommending that you keep the number of versions for each AWS Lambda function down to less than three.</p><h4>Storing data inside the AWS Lambda Instance</h4><p>In the previous section “Hacky Workarounds” we talked about pulling in a file from AWS S3 which is too large to be included in our AWS Lambda deployment package.</p><p>In this section, we are talking about the limit on AWS Lambda when it comes to storing things on the underlying instance itself. When people first begin working with AWS Lambda they often get hung up when their code won’t write to the filesystem.</p><p>This is a common concern because the very same code that worked previously either locally on their laptop or on a virtual machine now throws weird errors on AWS Lambda.</p><p>To resolve this issue, developers will need to write any files to the <strong>/tmp </strong>directory which is dedicated for data storage on AWS Lambda with a hard limit of 512 MB.</p><p>An important note, the <strong>/tmp </strong>directory as you may have surmised is only for temporary storage. Once the underlying instance supporting your AWS Lambda function dies off so will your <strong>/tmp </strong>storage.</p><p>This is commonly referred to as stateless computing as your state or data is kept off the server itself. Typically, we will keep this data in other fully managed AWS resources such as Amazon DynamoDB, AWS S3, and so on.</p><p>Then during the next invocation, our AWS Lambda function can pull in our needed state or data from these external resources and we should be all set.</p><h4>How do we avoid this limit?</h4><p>Most of the time developers familiar with AWS Lambda will not hit this limit because it’s often thought of as an anti-pattern.</p><p>As we talked about earlier, just because you can doesn’t mean you should.</p><p>If you do need to manipulate files you can use the<a href="https://nodejs.org/dist/latest-v10.x/docs/api/stream.html"> <strong>Nodejs Stream</strong></a> method to read, process, and write files without loading the whole file into our AWS Lambda file system.</p><p>This method works really well when manipulating a file and storing it on AWS S3.</p><h4>Lambda Payload Limit</h4><p>There is a hard limit of 6mb when it comes to AWS Lambda payload size. This means we cannot send more than 6mb of data to AWS Lambda in a single request.</p><p>Developers will typically run into this limit if their application was using AWS Lambda as the middle man between their client and their AWS S3 asset storage.</p><p>For example, if our application needs to upload an image or video, we will easily run over this limit when we send the image to our AWS Lambda function for upload.</p><h4>How do we avoid this limit?</h4><p>However, we can get around this limit by using an AWS S3 pre-signed url for uploads. This allows our AWS Lambda function to instead generate a pre-signed URL and return it to our client, then our client can use that temporary pre-signed URL to upload directly to our AWS S3 bucket.</p><p>Pre-signed URLs are a great solution to get past this limit and make our applications more efficient overall.</p><h4>Conclusion</h4><p>In this article, we talked about a few of the common AWS Lambda limits which we are likely to encounter when building serverless applications.</p><p>Remember to frequently review and optimize the number of packages your AWS Lambda functions require as this will help reduce cold starts, decrease deployment time, and lower your AWS Lambda cost.</p><p>Don’t fight against how AWS Lambda was built, all though it’s fun to build some of these “Hacky Workarounds” they are very brittle.</p><p>Finally, the limits we discussed may not be an issue for you at first, but as time goes on these limits can be problematic and will slowly creep up on you until you’re swimming in technical debt.</p><p><em>Originally published at </em><a href="https://blog.thundra.io/aws-lambda-limits-to-keep-in-mind-when-developing-a-serverless-application"><em>https://blog.thundra.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7692b0f6e527" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>