<?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[Think Serverless - Medium]]></title>
        <description><![CDATA[A deep insight to the future of application development - Medium]]></description>
        <link>https://medium.com/think-serverless?source=rss----8cd36f886911---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Think Serverless - Medium</title>
            <link>https://medium.com/think-serverless?source=rss----8cd36f886911---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 12 Nov 2026 14:42:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/think-serverless" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Serverless Architecture: Learn it, Perfect it and Evolve with it]]></title>
            <link>https://medium.com/think-serverless/serverless-architecture-learn-it-perfect-it-and-evolve-with-it-5209e17467cd?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/5209e17467cd</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[faa]]></category>
            <dc:creator><![CDATA[Andun Kannangara]]></dc:creator>
            <pubDate>Tue, 09 Apr 2019 06:13:49 GMT</pubDate>
            <atom:updated>2019-04-09T06:13:49.700Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIpg-kS0ZbdJ9XxThTp4kw.jpeg" /></figure><h3>The Road to Serverless</h3><p>It would not be wrong if I tell you the next awakening step of cloud computing is serverless. The evolution to serverless architecture from physical servers has not been an easy journey. In early years software was installed in mainframe type server computers and used their own data stores. With the time these physical servers were replaced by the virtual machines where it became possible to make copies of an entire physical machine.</p><p>And the next big thing in this journey was containerization. With the uprise of containers developer needed not to worry about the operating system and environment. As a result, they could focus more on the software, application code and dependencies.</p><h3>Serverless, The New Buzzword</h3><p>With the new serverless architecture, you just need to focus on the applications’ business logic, and should not need to worry about any infrastructure needs. And this leads to many more advantages which we will discuss later in this article.<br> Serverless architecture, the new buzzword has been around for the past few years and now it has been a reality. The adaptation rate for this tech is slower than any other new technologies. But with the time number has been increased with the awareness of the benefits of serverless architecture.</p><p>The term, Serverless Architecture may be confusing. Someone may think we are building an application which runs completely on the client side or probably distributed within different clients, without any serverside operation.</p><p>But is that a reasonable definition for an application builds on serverless architecture. No… Cloud Architecture specialists define this in <a href="https://martinfowler.com/articles/serverless.html">another way</a>.</p><p><em>Serverless architectures are application designs that incorporate third-party “Backend as a Service” (BaaS) services, and/or that include custom code run in managed, ephemeral containers on a “Functions as a Service” (FaaS) platform.</em></p><p>As he explains more on serverless architecture, it denies the need of an always-on, pre-purchased compute capacity behind the application, unlike the traditional architecture. The containers which server-side logic has been written are stateless, and they are event triggered. With these facts its clear to us there is a server component in somewhere connected to these serverless applications.</p><p>There are many cloud vendors who provide these hosted services. And these companies have hugely invested in serverless. Amazon Web Services(AWS), Google Cloud Platform(GCP), Microsoft Azure, IBM OpenWhisk, Auth0 Webtask, Oracle Fn Project could be named as the giants in the serverless industry.</p><h3>FaaS &amp; BaaS</h3><p>Two main components of the serverless architecture are FaaS and BaaS. As in the definition of serverless architecture describes the part of applications that are fully or significantly incorporated third-party, cloud-hosted services that are capable of managing server-side logic and state is known as BaaS. For an example, the developer gets unified lean access to services like database services like firebase, authentication services like Auth0, AWS Cognito. As a benefit with these services, developers can bring <a href="https://www.techopedia.com/definition/16012/rich-client">rich client</a>, fully functional application to the market in a very short period of time.</p><p>For some scenarios in application development, the developer needs to declare logics that needs much more computational power, unlike authentication or data querying. And also if these logics are more complex and time-consuming, it will not fit in the client side as well. To fulfill this kind of requirement serverless has introduced FaaS. So the developer could write and upload the backend logic and well-defined interface to invoke the backend logic with certain inputs. These functions run in stateless compute containers which are event triggered. Once these functions are implemented and deployed, cloud providers take care of the rest, which is where to run it and scale it up necessarily.</p><p>One of the most popular FaaS in the present serverless universe is AWS Lambda. And there are many more. As serverless become more and more popular cloud providers have given the capability to write these functions in several languages like Node js, Python, Java, and .NET.</p><p>Some could think that FaaS is the same as Platform as a Service(PaaS). Well, although there are some similarities between these two, there is a huge concept difference. FaaS takes PaaS concept into a next level. One of the main difference between FaaS and PaaS is when an application deployed as PaaS, it typically runs on the server all the time, but in FaaS it provides the capability to deploy single function or a part of an application. And it won’t be running at all until the function needs to be executed.</p><h3>Pros &amp; Cons</h3><p>Serverless is not scary. There are many benefits when programmers develop with serverless architecture. As there is nothing perfect in this world, serverless is also has its own dark side. Although serverless has many pros than cons when getting into consideration.</p><p><strong>Pros of serverless</strong></p><ul><li>Scalable services — It is the ideal designing architecture for a scalable application. It automatically scales endlessly as it takes separate functions on your FaaS and runs them in separate containers</li><li>Billing per invocations — Not like in traditional architecture models you ain’t paying for constant server availability. You just pay for the number of invocation made to your lambda. Thus your cost depends on the traffic on your serverless application</li><li>Lower cost on human resource and hardware resource — As there is no much expensive hardware, no need of a human taskforce to maintain this hardware</li><li>Focus much more on user experience — As there are lots of serverside services are provided with serverless computing, hence the engineering team could more focus on user experience features</li><li>Fast delivery to market — Achieved by deploying smaller units of functions as features to end user</li></ul><p><strong>Cons of serverless</strong></p><ul><li>Vendor lock-in — It’s not easy to migrate from one vendor to another, or you aren’t independent in choosing the coding language.</li><li>Architectural complexity — Developer need to go through a learning curve and follow best practices to understand and develop flawless applications</li><li>Lack of operation tools — Developer depends on different third-party vendors for monitoring and debugging, and still difficult in debugging distributed system and requires a significant amount of relevant metrics to identify the root cause</li></ul><p><em>Originally published at </em><a href="https://slappforge.com/blog/serverless-architecture"><em>slappforge.com</em></a><em> on November 1, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5209e17467cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/serverless-architecture-learn-it-perfect-it-and-evolve-with-it-5209e17467cd">Serverless Architecture: Learn it, Perfect it and Evolve with it</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless message queues and how to leverage the best]]></title>
            <link>https://medium.com/think-serverless/serverless-message-queues-and-how-to-leverage-the-best-1f5b7c790b1?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/1f5b7c790b1</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Udith Gunaratna]]></dc:creator>
            <pubDate>Fri, 05 Apr 2019 09:32:42 GMT</pubDate>
            <atom:updated>2019-04-05T09:32:42.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGTIbeNJEGemn9Gck8FR4A.jpeg" /></figure><p>Even long before serverless was born, message queues had been a popular weapon in the arsenal of software developers and architects to integrate software systems. First, when there were large software systems which were incompatible with each other, message queues acted as the intermediary communication channels between them. Then the world moved into distributed systems and message queues became more and more popular as an integration medium due to some of their inherent capabilities such as message broadcasting, guaranteed delivery, in-order delivery and so on. Now, in an era where almost all the software systems are <a href="https://hackernoon.com/why-serverless-why-now-f09ce43c4767">moving into the serverless landscape</a>, where do the serverless message queues fit-in?</p><h3>Serverless Message Queues</h3><p>Not surprisingly, <strong>they are EVERYWHERE!</strong> Why? Because naturally, a complete serverless system is a combination of several smaller moving parts that processes messages and integrate with other resources. And these parts are required to pass messages and events between them. For example, such a system may contain multiple AWS Lambdas, Google Cloud Functions, Microsoft Azure Functions or any combination of them. Each one of these smaller execution parts operates with its own latency, own throughput and even scales up and down by its own. So when you have to move messages between such volatile subparts, one of the best and easiest approach is the use of message queues.</p><p>All the serverless service providers such as AWS, Azure, and GCP provide several queuing solutions to choose from. Therefore the next problem will be which is the best and optimal queue service for your application. So the only approach to select the correct service would be to analyze the requirements of your application and choose a solution that meets them. Therefore this article discusses some of the main aspects of serverless queuing services that should be taken into consideration when choosing the optimal service.</p><h3>Things to consider when selecting a Queuing Solution</h3><h4>Maximum Message Size</h4><p>Maximum Message Size is the maximum size of the payload a single message on a queue can hold. Most of the serverless queues such as AWS SQS, AWS SNS, Azure Queues allow only up to several hundred kilobytes per message. But some of them such as AWS Kinesis allow up to a couple of megabytes as well. Generally, serverless systems deal with smaller sized messages that can be processed within a limited time period. Therefore this size limitations would not be an issue in most use cases. But if the size of messages generated by the source system exceeds approximately 1MB, it is important to select a queue that is capable of accepting such messages.</p><h4>Maximum Throughput</h4><p>Maximum Throughput is the maximum number of <strong>message related operations</strong> that can be handled by a queue per second. Although some of the queuing solutions such as AWS SQS (standard queues) and AWS SNS do not impose any limitation on the throughput, most of the other queuing solutions do. And the definition of this limit varies from one solution to another as well. For example, an AWS SQS FIFO queue supports up to 300 message operations, i.e. the total number of read, write or delete operations per second. In contrast, an AWS Kinesis shard can support up to 1,000 put record operations per second. Because of these limitations, it is better to estimate the expected throughput of your application (message enqueuing rate as well as dequeuing rate) beforehand and choose a queuing solution which can cater to that throughput level.</p><h4>Retention period</h4><p>The retention period is the maximum time duration that the queue storage will keep a message until the next processing stage consumes it. This next processing stage most probably can be a serverless function such as AWS Lambda or an Azure function. Most, if not all message queues have a defined retention period to prevent unconsumed and obsolete messages from piling up on the queue storage. Otherwise, such a pile-up will make it impossible for the publishers to enqueue new messages to the queue due to the shortage of storage capacity. This aspect is very important especially in the serverless landscape because most serverless systems are a combination of multiple independent processing stages.</p><p>So if the processing stage which is responsible for retrieving messages from the queue has gone down, the queue should be able to retain the messages for a reasonable time period until that system becomes available again. On the other hand, what if your system is dealing with time-sensitive messages i.e. messages that become obsolete unless they are processed within a certain time period? In such a case, the queue should be able to discard them or send them to a Dead-Letter-Queue without handing them over to the next processing stage.</p><h4>Guaranteed Ordering</h4><p>Guaranteed Ordering means that a subscriber of a queue will receive the messages in the exact same order that the publisher had published them to the queue. Some applications require this capability when it is important to preserve the message order between each processing stage. Although some queuing solutions such as AWS SQS Standard Queues and Azure Queue Storage do not guarantee this behavior, there are many solutions such as AWS SQS FIFO Queues and AWS SNS that do provide this guarantee.</p><h4>Delivery Method</h4><p>Most of the serverless queuing solutions fall into one of the two categories based on the message delivery method. When there are multiple subscribers for a queue, some queuing solutions such as AWS SQS deliver a particular message to only one of those subscribers. In contrast, other solutions such as AQS SNS deliver a copy of the same message to each and every subscriber aka broadcasting. Therefore based on the requirement of the serverless application, it is vital to select a queue which supports the correct delivery method.</p><h3>Summary of Operational Limits on Popular Serverless Queuing Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyhHX7MxNmYnOPp0zrqmlg.png" /><figcaption>Operational Limits on Popular Serverless Queuing Services</figcaption></figure><p>In conclusion, we can see that all of these services provide exceptional performance and reliability guarantees for very reasonable pricing, but only the behavior will differ. Therefore it is the developer’s responsibility to choose the correct service or service based on the requirements of the application.</p><h3>Call To Action</h3><ul><li><strong>Clap.</strong> Appreciate and let others find this article.</li><li><strong>Comment.</strong> Share your views on this article.</li><li><strong>Follow me. </strong><a href="https://medium.com/@uditharosha">Udith Gunaratna</a><strong> </strong>to receive updates on articles like this.</li><li><strong>Keep in touch. </strong><a href="https://www.linkedin.com/in/udithg/">LinkedIn</a>, <a href="https://twitter.com/UdithArosha">Twitter</a></li></ul><p><em>Originally published at </em><a href="https://slappforge.com/blog/serverless-queues"><em>slappforge.com</em></a><em> on March 18, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f5b7c790b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/serverless-message-queues-and-how-to-leverage-the-best-1f5b7c790b1">Serverless message queues and how to leverage the best</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What makes a Storage Service Truly Serverless?]]></title>
            <link>https://medium.com/think-serverless/what-makes-a-storage-service-truly-serverless-93987826039e?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/93987826039e</guid>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[storage]]></category>
            <dc:creator><![CDATA[Rajind Ruparathna]]></dc:creator>
            <pubDate>Fri, 05 Apr 2019 06:57:38 GMT</pubDate>
            <atom:updated>2025-01-11T05:55:10.828Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQ9QA3Sy1kX7XdmZmFwlYg.jpeg" /></figure><p>Can every storage service or database service be called a serverless storage or a serverless database? What makes one storage service being put into the serverless category and others drop out? This article will cover the basic properties a persistence service should have, for it to be called a serverless storage or a serverless persistence service. Next up, we’ll give examples of different serverless storage and serverless database categories along with a few sample use cases of them in serverless computing. Lastly, we’ll go on to discuss the serverless storage categories which are yet to emerge and look towards the future of serverless storage.</p><p><em>Originally published at </em><a href="https://rajind.dev/2019/01/01/serverless-storage-persistence/"><em>notebookbft.wordpress.com</em></a><em> on January 1, 2019.</em></p><h3>Serverless — no servers at all?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*gw9Jxh2rqVZf_HWa.png" /></figure><p>Source — <a href="http://www.commitstrip.com/en/2017/04/26/servers-there-are-no-servers-here/">http://www.commitstrip.com/en/2017/04/26/servers-there-are-no-servers-here/</a></p><p>The term serverless is a misnomer. Serverless does not mean that servers are no longer required and it basically goes with the concept of abstracting technology away from the user. The users no longer have to worry about servers and someone else (the cloud provider) is taking care of all that for the user.</p><h3>Serverless Computing</h3><p>Serverless is quite a buzz word these days. Even though the term serverless has been there for some time, the major reason for it becoming such a buzz word was the launch of <a href="https://aws.amazon.com/lambda/">AWS Lambda</a> in 2014. The term further gained popularity with the launch of Amazon’s <a href="https://aws.amazon.com/api-gateway/">API Gateway</a> in July 2015. In general, the term serverless — or rather serverless computing — refer the applications where server-side logic written by the application developer is run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a third party. This is also called Function as a Service (FaaS). Read more about <a href="https://slappforge.com/blog/serverless-architecture/">serverless architecture</a> in one of our previous articles.</p><h3>The statelessness of Serverless Computing and the need for Storage/Persistence</h3><p>One of the features of serverless computing or FaaS is that it is <strong>stateless</strong>. Therefore persisting state between two executions of the same function is not possible in the general design. This is where serverless storage/persistence comes into the picture. In cases where the state needs to be persisted between two FaaS function executions, it should be stored externally in a storage/persistence service.</p><h3>The Problem with Traditional Storage</h3><p>Traditional storage solutions are designed to run continuously on a fixed set of servers at a single geographic location. To use these storage solutions properly, application developers need to know a lot about configuration specifics. In the worst cases, high availability and performance are dependent on developer knowledge of database internals. Developers need to figure out and configure things like regions, zones, volumes, memory, compute capacity, and software versions. Teams have to spend hours after hours thinking about capacity planning, provisioning, sharding, backups, performance tuning, and monitoring. When you spend 80% of your time setting up and operating databases just to support serverless functions, you know something is amiss. While serverless computing adds elasticity to the compute layer, you cannot fully absorb its advantage when your persistence layer does not offer a comparable level of elasticity.</p><h3>A Truly Serverless Storage</h3><p>A truly serverless storage should ideally have the following properties.</p><ul><li><strong>No provisioning</strong></li><li><strong>Truly elastic</strong> (scale up and scale down without operator intervention)</li><li><strong>Pay-as-you-go</strong></li></ul><p>When using a serverless storage, developers should not need to worry about any infrastructure details, like node size, memory, or storage size. In the same way that AWS Lambda charges per single-function invocation, consumption in a serverless storage should be measured by the amount of compute and storage used by different workloads. This is the essence of a serverless database. Users are never charged for idle capacity. Storage usage reflects function invocation and workload.</p><p>With traditional storage offerings, over-provisioning is the only strategy available to prepare for traffic spikes. A serverless storage’s elasticity prevents over-provisioning, which can be wasteful. Since a serverless storage has the capability to scale elastically without user intervention, developers can launch with no capacity planning and the applications will always have enough capacity. Further, the pay-as-you-go pricing model would ensure that no idle resources drain the user’s bank account. The cost of using serverless storage simply scales with usage. You never pay for unused capacity.</p><h3>Serverless Storage/Persistence Options</h3><p>Nowadays, there are various serverless storage categories; often, more or less the same service is provided by multiple cloud vendors. In this section we’ll go through those different serverless persistence categories, examples for each category, and some use cases of them as well.</p><h3>Serverless Object Storage</h3><p>Object storage is a hierarchy-free method of storing data, typically used in the cloud. Unlike other data storage methods, object-based storage does not use a directory tree. Discrete units of data (objects) exist at the same level in a storage pool. Each object has a unique, identifying name that an application uses to retrieve it. Additionally, each object may have metadata that is retrieved with it. Some common examples of serverless object storages are Amazon S3, Google Cloud Storage, Azure Storage and IBM Cloud Storage. One common example of the use of serverless object storage in the context of serverless computing would be the <a href="https://github.com/slappforge/s3-thumbnail-generator">thumbnail generation</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*qvdowPzrSCeLqHDG.png" /></figure><ol><li>The mobile application uploads an image to an object store.</li><li>Serverless object storage fires a change event after the image was uploaded, resulting in an execution of a serverless function.</li><li>The serverless function creates a thumbnail based on the uploaded image.</li><li>After uploading the thumbnail on to the serverless storage, the serverless function sends a push notification to the mobile application.</li><li>Mobile application downloads the thumbnail and updates the user interface accordingly.</li></ol><h3>Serverless Relational Databases</h3><p>An example of a serverless relational database is <a href="https://aws.amazon.com/rds/aurora/serverless/">Amazon Aurora Serverless</a> which was launched in the last quarter of 2017. It comes in two different editions compatible with both MySQL and PostgreSQL, but it is also compatible with other known systems like MariaDB, Oracle, etc. Amazon Aurora Serverless is an on-demand, auto-scaling database service, where the database will automatically start up, shut down, and scale capacity up or down based on the application’s needs. It enables users to run their databases in the cloud without actually managing any database instances. It’s a simple, cost-effective option for infrequent, intermittent, or unpredictable workloads, and hence is ideal for serverless computing.</p><h3>Serverless NoSQL Databases</h3><h4>Serverless Key-value and Document Stores</h4><p>There are different kinds of serverless NoSQL databases available today. The most common ones are key-value stores and document stores. A key-value database, or key-value store, is a data storage paradigm designed for storing, retrieving, and managing associative arrays, a data structure more commonly known today as a dictionary or hash table. Dictionaries contain a collection of objects, or records, which in turn have many different fields within them, each containing data. These records are stored and retrieved using a key that uniquely identifies the record, and is used to quickly find the data within the database. A document-oriented database or document store is a storage designed for storing, retrieving and managing document-oriented information, also known as semi-structured data. A few examples of serverless key-value and document stores are <a href="https://aws.amazon.com/dynamodb/">Amazon DynamoDB</a>, <a href="https://cloud.google.com/datastore/docs/">Google Cloud Datastore</a> and <a href="https://www.ibm.com/cloud/cloudant">IBM Cloudant</a> NoSQL DB. Recently Amazon <a href="https://aws.amazon.com/blogs/aws/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/">announced</a> DynamoDB on-demand which provides the option for on-demand read/write capacity for DynamoDB with the pay-for-request model. There are various uses of such serverless key-value and document stores; out of those a simple <a href="https://github.com/slappforge/simple-contact-us-handler">use case</a> is handling a contact us form with a serverless function.</p><h4>Serverless Time Series Database</h4><p>A time series database (TSDB) is a software system that is optimized for handling time series data, arrays of numbers indexed by time (a datetime or a datetime range). Time-series data has specific characteristics such as typically arriving in the time order form, data is append-only, and queries are always over a time interval. While relational databases can store this data, they are inefficient at processing this data as they lack optimizations such as storing and retrieving data by time intervals. An example of a serverless time series database is the recently announced <a href="https://aws.amazon.com/timestream/">Amazon Timestream</a> which is a purpose-built time series database that efficiently stores and processes records by time intervals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4MWaiBTiwlEprbhH.png" /></figure><p>Source — <a href="https://aws.amazon.com/timestream/">https://aws.amazon.com/timestream/</a></p><h4>Serverless Graph Databases</h4><p>Very simply, a graph database is a database designed to treat the relationships between data as equally important as the data itself. It is intended to hold data without constricting it to a predefined model. Instead, the data is stored like we first draw it out — showing how each individual entity connects with or is related to others. When it comes to a serverless graph database, we have <a href="https://fauna.com/serverless-cloud">FaunaDB</a> which is a general purpose, transactional, temporal, geographically distributed, strongly consistent and relational database. FaunaDB also supports document store and time series database features.</p><h3>What is Missing?</h3><h3>Serverless In-Memory Data Stores/Caches?</h3><p>One of the storage types which are not yet available in the serverless flavour is in-memory data stores. One of the options we have at the moment for caching is <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">caching at the API Gateway level</a>. Then we have Amazon DynamoDB with single digit millisecond latencies. If a user needs to reduce the latency a bit more, then even though not yet fully serverless, <a href="https://aws.amazon.com/dynamodb/dax/">DynamoDB Accelerator (DAX)</a> can be used. Further, we do have <a href="https://aws.amazon.com/elasticache/">AWS ElastiCache</a> which offers Redis and Memcached but they do not yet offer them as fully managed services. Then from Google App Engine, we have <a href="https://cloud.google.com/appengine/docs/standard/python/memcache/">Memcache</a> as an in-memory caching service, however, this can only be accessed within the App Engine itself.</p><h3>Conclusion</h3><p>Serverless storage support is growing rapidly along with the growth and high adaption of serverless computing in the IT industry. We expect these services to grow, allowing a truly serverless application development.</p><h3>Call To Action</h3><ul><li><strong>Clap.</strong> Appreciate and let others find this article.</li><li><strong>Comment.</strong> Share your views on this article.</li><li><strong>Follow me. </strong><a href="https://medium.com/@rajind">Rajind Ruparathna</a> to receive updates on articles like this.</li><li><strong>Keep in touch. </strong><a href="http://lk.linkedin.com/in/rajind">LinkedIn</a>, <a href="https://twitter.com/rajindrj">Twitter</a>, <a href="https://rajind.dev/about/">Personal Blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93987826039e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/what-makes-a-storage-service-truly-serverless-93987826039e">What makes a Storage Service Truly Serverless?</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Security: Putting it on Autopilot]]></title>
            <link>https://medium.com/think-serverless/serverless-security-putting-it-on-autopilot-74198bf686d2?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/74198bf686d2</guid>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Thu, 29 Nov 2018 09:00:39 GMT</pubDate>
            <atom:updated>2018-11-29T09:00:39.112Z</atom:updated>
            <content:encoded><![CDATA[<h4>How serverless security can go wrong, and what we can do about it</h4><p><strong>Ack</strong>: This article is a remix of stuff learned from personal experience as well as from multiple other sources on serverless security. I cannot list down or acknowledge all of them here; nevertheless, special thanks should go to <a href="https://www.theregister.co.uk/2018/05/15/stale_serverless_functions/">The Register</a>, <a href="https://hackernoon.com/many-faced-threats-to-serverless-security-519e94d19dba">Hacker Noon</a>, <a href="https://www.puresec.io/blog/serverless-top-10-released">PureSec</a>, and the <a href="https://serverless.email/">Serverless Status</a> and <a href="https://serverless.curated.co/">Serverless (Cron)icle</a> newsletters.</p><p>We all love to imagine that our systems are secure. And then…</p><h3>BREACH!!!</h3><p>A <em>very</em> common nightmare shared by every developer, sysadmin and, ultimately, CISO.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*UiY_acWscYoH567Q.jpg" /><figcaption>You’d better inform the boss…</figcaption></figure><h4>Inevitable?</h4><p>One basic principle of computer security states that <a href="https://www.techrepublic.com/article/an-absolutely-secure-network-is-not-possible-but-the-risk-can-be-managed/">no system can attain absolute security</a>. Just like people: <a href="https://www.goodreads.com/quotes/508462-no-one-is-perfect-that-s-why-pencils-have-erasers">nobody is perfect</a>. Not unless it is fully isolated from the outside; which, by today’s standards, is next to impossible — besides, what’s the point of having a system that cannot take inputs and provide outputs?</p><p>Whatever advanced security precaution you take, attackers will eventually find a way around. Even if you use the most stringent encryption algorithm with the longest possible key size, attackers will eventually brute-force their way through; although it could be time-wise infeasible at present, who can guarantee that a bizarre technical leap would render it possible tomorrow, or the next day?</p><p>But it’s not the brute-force that you should really be worried about: <a href="https://www.itgovernance.co.uk/blog/50-of-the-worst-breaches-caused-by-inadvertent-human-error/">human errors</a> are way more common, and can have devastating effects on systems security; much more so than a brute-forced passkey. Just <a href="https://qz.com/445233/inside-the-irss-massive-data-breach/">have a peek at this story</a> where some guys just walked into the U.S. IRS building and siphoned out millions of dollars, without using a single so-called “hacking” technique.</p><p>As long as systems are made and operated by people — who are error-prone by nature — they will never be truly secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*YvAvYQOuvR0MyyIE.jpg" /><figcaption>Remember those old slides from college days?</figcaption></figure><h3>So, are we doomed?</h3><p>No!</p><p>Ever seen the insides of a ship?</p><p>How its hull is divided into compartments — so that one leaking compartment does not cause the whole ship to sink?</p><p>People often apply a similar concept in designing software: multiple modules so that one compromised module doesn’t bring the whole system down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/0*q-BnIQxIIrGN6FGK.jpg" /><figcaption>A ship’s watertight hull compartments</figcaption></figure><p>Combined with the <a href="https://en.m.wikipedia.org/wiki/Principle_of_least_privilege">principle of least privilege</a>, this means that a component will compromise the least possible degree of security — ideally the attacker will only be able to wreak havoc within the bounds of the module’s security scope, never beyond.</p><p>Reducing the <a href="https://thenewstack.io/six-security-considerations-for-serverless-environments/"><em>blast radius</em></a> of the component, and consequently the <a href="https://theburningmonk.com/2017/08/many-faced-threats-to-serverless-security/"><em>attack surface</em></a> that it exposes for the overall system.</p><p>A security <em>sandbox</em>, you could say.</p><p>And a pretty good one at that.</p><h3>PoLP: The Principle of Least Privilege</h3><blockquote>Never give someone — or something — more freedom than they need.</blockquote><p>More formally,</p><blockquote>Every module must be able to access only the information and resources that are necessary for its legitimate purpose.</blockquote><blockquote>— <a href="https://en.m.wikipedia.org/wiki/Principle_of_least_privilege">Wikipedia</a></blockquote><p>This way, if the module misbehaves (or is forced to misbehave, by an entity with malicious intent — a <em>hacker</em>, in English), the potential harm it can cause is minimized; without any preventive “action” being taken, and even before the “breach” is identified!</p><h4>It never gets old</h4><p>While the principle was initially brought up in the context of legacy systems, it is even more so applicable for “modern” architectures; SOA (well, maybe not so “modern”), microservices, and FaaS (serverless functions, hence serverless security) as well.</p><p>The concept is pretty simple: use the underlying access control mechanisms to restrict the permissions available for your “unit of execution”; may it be a simple HTTP server/proxy, web service backend, microservice, container, or serverless function.</p><h3>Meanwhile, in the land of no servers…</h3><p>With <a href="https://thenewstack.io/why-serverless-is-being-adopted-at-a-faster-rate-than-expected/">increased worldwide adoption</a> of serverless technologies, the significance of serverless security, and the value of our PoLP, is becoming <a href="https://www.puresec.io/blog/musings-on-serverless-application-security-with-simon-wardley">more obvious than ever</a>.</p><h4>Server-less = effort-less</h4><p>Not having to provision and manage the server (environment) means that serverless DevOps can proceed at an insanely rapid pace. With CI/CD in place, it’s just a matter of code, commit and push; everything would be up and running within minutes, if not seconds. No SSH logins, file uploads, config syncs, service restarts, routing shifts, or any of the other pesky DevOps chores associated with a traditional deployment.</p><h4>“Let’s fix the permissions later.”</h4><p>Alas, that’s a common thing to hear among those “ops-free” devs (like myself). You’re in a haste to push the latest updates to staging, and the “easy path” to avoid a plethora of “permission denied” errors is to relax the permissions on your FaaS entity (<a href="https://aws.amazon.com/lambda/">AWS Lambda</a>, <a href="https://azure.microsoft.com/en-us/overview/serverless-computing/">Azure Function</a>, whatever).</p><p>Staging will soon migrate to prod. And so will your “over-permissioned” function.</p><p>And it will stay there. <a href="https://www.theregister.co.uk/2018/05/15/stale_serverless_functions/">Far longer than you think.</a> You will eventually shift your traffic to updated versions, leaving behind the old one untouched; in fear of breaking some other dependent component in case you step on it.</p><p>And then come the sands of time, covering the old function from everybody’s memories.</p><p>An obsolete function with unpatched dependencies and possibly flawed logic, having full access to your cloud resources.</p><p>A <em>serverless time bomb</em>, if there ever was one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/0*8jsCvKVzaH33Da8g" /><figcaption>Waiting for the perfect time… to explode</figcaption></figure><h4>Yes, blast radius; again!</h4><p>If we adhere to the least privilege principle, right from the staging deployment, it would greatly reduce the blast radius: by limiting what the function is allowed to do, we automatically limit the “extent of exploitation” upon the rest of the system if its control ever falls into the wrong hands.</p><h3>Nailing serverless security: on public cloud platforms</h3><p>These things are easier said than done.</p><p>At the moment, among the leaders of public-cloud FaaS technology, only AWS has a sufficiently flexible serverless security model. <a href="https://cloud.google.com/functions/docs/concepts/iam#runtime_service_account">GCP automatically assigns a default project-level Cloud Platform service account</a> to all its functions in a given project, meaning that all your functions will be in one basket in terms of security and access control. Azure’s IAM model <a href="https://www.twistlock.com/2018/09/25/iam-roundup-aws-vs-azure-vs-gcp/">looks more promising</a>, but it still lacks the cool stuff like <a href="https://stackoverflow.com/questions/40838619/azure-function-role-like-permissions-to-stop-azure-virtual-machines#comment-68899907">automatic role-based runtime credential assignments</a> available in both AWS and GCP.</p><p>AWS has applied its own <a href="https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html">IAM role-based permissions model</a> for its Lambda functions, granting users the flexibility to define a custom IAM role — with fully customizable permissions — for every single Lambda function if so desired. It has an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html">impressive array of predefined roles</a> that you can extend upon and has <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html">well-defined strategies</a> for scoping permission to categories of resources or principals; merging rules that refer to the same set of resources or operations; and so forth.</p><p>This whole hierarchy finally boils down to a set of permissions, each of which takes a rather <a href="https://aws.amazon.com/blogs/security/back-to-school-understanding-the-iam-policy-grammar/">straightforward format</a>:</p><pre>{<br>    &quot;Effect&quot;: &quot;Allow|Deny&quot;,<br>    &quot;Action&quot;: &quot;API operation matcher (pattern), or array of them&quot;,<br>    &quot;Resource&quot;: &quot;entity matcher (pattern), or array of them&quot;<br>}</pre><p>In English, this simply means:</p><p><strong>Allow</strong> (or <strong>deny</strong>) an entity (user, EC2 instance, lambda; whatever) that possesses this permission, to perform the matching API operation(s) against the matching resource(s).</p><p>(There are non-mandatory fields Principal and Condition as well, but we&#39;ll skip them here for the sake of brevity.)</p><h4>Okay, okay! Time for some examples.</h4><pre>{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: &quot;s3:PutObject&quot;,<br>    &quot;Resource&quot;: &quot;arn:aws:s3:::my-awesome-bucket/*&quot;<br>}</pre><p>This allows the assignee to put an object (s3:PutObject) into the bucket named my-awesome-bucket.</p><pre>{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: &quot;s3:PutObject&quot;,<br>    &quot;Resource&quot;: &quot;arn:aws:s3:::my-awesome-*&quot;<br>}</pre><p>This is similar, but allows the put to be performed on any bucket whose name begins with my-awesome-.</p><pre>{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: &quot;s3:*&quot;,<br>    &quot;Resource&quot;: &quot;*&quot;<br>}</pre><p>This allows the assignee to do <strong>any</strong> S3 operation (get/put object, delete object, or even <em>delete bucket</em>) against <strong>any</strong> bucket in its owning AWS account.</p><p>And now the <em>silver bullet</em>:</p><pre>{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: &quot;*&quot;,<br>    &quot;Resource&quot;: &quot;*&quot;<br>}</pre><p>Yup, that one allows oneself to <strong>do anything</strong> on <strong>anything</strong> in the AWS account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*s7CXbdWPc4wwUzqO.jpg" /><figcaption>The silver bullet</figcaption></figure><p>Kind of like the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator">AdministratorAccess</a> managed policy.</p><p>And if your principal (say, lambda) gets compromised, the attacker effectively has admin access to your AWS account!</p><p>A serverless security nightmare. Needless to say.</p><p>To be avoided at all cost.</p><p>Period.</p><p>In that sense, the best option would be a series of permissions of the first kind; ones that are the least permissive (most restrictive) and cover a narrow, well-defined scope.</p><h3>How hard can that be?</h3><p>The caveat is that you have to do this for every single operation within that computation unit — say lambda. <em>Every single one.</em></p><p>And it gets worse when you need to configure <a href="https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html">event sources</a> for triggering those units.</p><p>Say, for an <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-with-lambda-integration.html">API Gateway-triggered</a> lambda, where the <em>API Gateway service</em> must be granted permission to invoke your lambda in the scope of a specific APIG endpoint (in <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html">CloudFormation syntax</a>):</p><pre>{<br>  &quot;Type&quot;: &quot;AWS::Lambda::Permission&quot;,<br>  &quot;Properties&quot;: {<br>    &quot;Action&quot;: &quot;lambda:InvokeFunction&quot;,<br>    &quot;FunctionName&quot;: {<br>      &quot;Ref&quot;: &quot;LambdaFunction&quot;<br>    },<br>    &quot;SourceArn&quot;: {<br>      &quot;Fn::Sub&quot;: [<br>        &quot;arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/*/${__Method__}${__Path__}&quot;,<br>        {<br>          &quot;__Method__&quot;: &quot;POST&quot;,<br>          &quot;__Path__&quot;: &quot;/API/resource/path&quot;,<br>          &quot;__ApiId__&quot;: {<br>            &quot;Ref&quot;: &quot;RestApi&quot;<br>          }<br>        }<br>      ]<br>    },<br>    &quot;Principal&quot;: &quot;apigateway.amazonaws.com&quot;<br>  }<br>}</pre><p>Or for a <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis-example.html">Kinesis stream-powered</a> lambda, in which case things get more complicated: the <em>Lambda function</em> requires access to <em>watch</em> and <em>pull from</em> the stream, while the <em>Kinesis service</em> also needs permission to <em>trigger</em> the lambda:</p><pre>  &quot;LambdaFunctionExecutionRole&quot;: {<br>    &quot;Type&quot;: &quot;AWS::IAM::Role&quot;,<br>    &quot;Properties&quot;: {<br>      &quot;ManagedPolicyArns&quot;: [<br>        &quot;arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole&quot;<br>      ],<br>      &quot;AssumeRolePolicyDocument&quot;: {<br>        &quot;Version&quot;: &quot;2012-10-17&quot;,<br>        &quot;Statement&quot;: [<br>          {<br>            &quot;Action&quot;: [<br>              &quot;sts:AssumeRole&quot;<br>            ],<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>              &quot;Service&quot;: [<br>                &quot;lambda.amazonaws.com&quot;<br>              ]<br>            }<br>          }<br>        ]<br>      },<br>      &quot;Policies&quot;: [<br>        {<br>          &quot;PolicyName&quot;: &quot;LambdaPolicy&quot;,<br>          &quot;PolicyDocument&quot;: {<br>            &quot;Statement&quot;: [<br>              {<br>                &quot;Effect&quot;: &quot;Allow&quot;,<br>                &quot;Action&quot;: [<br>                  &quot;kinesis:GetRecords&quot;,<br>                  &quot;kinesis:GetShardIterator&quot;,<br>                  &quot;kinesis:DescribeStream&quot;,<br>                  &quot;kinesis:ListStreams&quot;<br>                ],<br>                &quot;Resource&quot;: {<br>                  &quot;Fn::GetAtt&quot;: [<br>                    &quot;KinesisStream&quot;,<br>                    &quot;Arn&quot;<br>                  ]<br>                }<br>              }<br>            ]<br>          }<br>        }<br>      ]<br>    }<br>  },<br>  &quot;LambdaFunctionKinesisTrigger&quot;: {<br>    &quot;Type&quot;: &quot;AWS::Lambda::EventSourceMapping&quot;,<br>    &quot;Properties&quot;: {<br>      &quot;BatchSize&quot;: 100,<br>      &quot;EventSourceArn&quot;: {<br>        &quot;Fn::GetAtt&quot;: [<br>          &quot;KinesisStream&quot;,<br>          &quot;Arn&quot;<br>        ]<br>      },<br>      &quot;StartingPosition&quot;: &quot;TRIM_HORIZON&quot;,<br>      &quot;FunctionName&quot;: {<br>        &quot;Ref&quot;: &quot;LambdaFunction&quot;<br>      }<br>    }<br>  },<br>  &quot;KinesisStreamPermission&quot;: {<br>    &quot;Type&quot;: &quot;AWS::Lambda::Permission&quot;,<br>    &quot;Properties&quot;: {<br>      &quot;Action&quot;: &quot;lambda:InvokeFunction&quot;,<br>      &quot;FunctionName&quot;: {<br>        &quot;Ref&quot;: &quot;LambdaFunction&quot;<br>      },<br>      &quot;SourceArn&quot;: {<br>        &quot;Fn::GetAtt&quot;: [<br>          &quot;KinesisStream&quot;,<br>          &quot;Arn&quot;<br>        ]<br>      },<br>      &quot;Principal&quot;: &quot;kinesis.amazonaws.com&quot;<br>    }<br>  }</pre><p>So you see, with this granularity, comes great <strong>power</strong> as well as great <strong>responsibility</strong>. One missing permission — heck, one mistyped letter — and it’s <a href="https://medium.freecodecamp.org/running-around-the-block-a-beginner-meets-aws-lambda-560a1f2849ae">403 AccessDeniedException</a>.</p><p>No easy way; you just have to track down every AWS resource triggering or accessed by your function, look up the docs, pull out your hair, and come up with the necessary permissions.</p><h3>But… but… that’s too much work!</h3><p>Yup, it is. If you’re doing it <em>manually</em>.</p><p>But <a href="https://cars.usnews.com/cars-trucks/best-cars-blog/2016/09/why-are-manual-transmissions-disappearing">who drives manual these days?</a> :)</p><p>Fortunately there are quite a few options, if you’re already into automating stuff:</p><h4>serverless-puresec-cli: thanks PureSec!</h4><p>If you’re using the famous <a href="https://serverless.com/framework/docs/providers/aws/guide/iam/">Serverless Framework</a> — which means you’re already covered on the trigger permissions front — there’s the <a href="https://www.puresec.io/blog/generating-least-privileged-iam-roles-for-aws-lambda-functions-the-easy-way">serverless-puresec-cli</a> plugin from <a href="https://www.puresec.io/blog/author/puresec-team">Puresec</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/0*OoKFEDbBJrQfNaMX" /><figcaption>Puresec</figcaption></figure><p>The plugin can statically analyze your lambda code and generate a least-privilege role. Looks really cool, but the caveat is that you have to run the serverless puresec gen-roles command before every deployment with code changes; I couldn&#39;t yet find a way to run it automatically - during serverless deploy, for example. Worse, it just prints the generated roles into stdout; so you have to manually copy-paste it into serverless.yml, or use some other voodoo to actually inject it into the deployment configuration (hopefully things would improve in the future :))</p><h4>AWS Chalice: from the Gods</h4><p>If you’re a Python fan, <a href="https://github.com/aws/chalice/blob/master/docs/source/topics/configfile.rst">Chalice</a> is capable of auto-generating permissions for you, natively. Chalice is awesome in many aspects; super-fast deployments, annotation-driven triggers, little or no configurations to take care of, and so forth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/0*GaXXbAQatAx7mxZb" /><figcaption>AWS Chalice</figcaption></figure><p>However, despite being a direct hand-down from the AWS gods, it seems to have missed the word “minimal” when it comes to permissions; if you have the code to <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.list_objects">list the contents</a> of some bucket foo, it will generate permissions for listing content of <em>all buckets in the AWS account</em> (&quot;Resource&quot;: &quot;*&quot; instead of &quot;Resource&quot;: &quot;arn:aws:s3:::foo/*&quot;), not just the bucket you are interested in. Not cool!</p><h4>No CLI? go for SLAppForge Sigma</h4><p>If you’re a beginner, or not that fond of CLI tooling, there’s <a href="https://www.slappforge.com/sigma/?utm_medium=blog&amp;utm_source=generic&amp;utm_campaign=feature">Sigma from SLAppForge</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/0*fNcNtW_Kbp2Z75_I.png" /><figcaption>SLAppForge Sigma</figcaption></figure><p>Being a fully-fledged browser IDE, Sigma will automatically analyze your code as you compose (type or <a href="https://www.youtube.com/watch?v=cDGY1D6Chp0">drag-n-drop</a>) it, and derive the necessary permissions — for the Lambda runtime <em>as well as for the triggers</em> — so you are fully covered. The recently introduced <em>Permission Manager</em> also allows you to modify these auto-generated permissions if you desire; for example, if you are integrating a new AWS service/operation that Sigma doesn’t yet know about.</p><p>Plus, with Sigma, you never have to worry about any other configurations; resource configs, trigger mappings, entity interrelations and so forth — the IDE takes care of it all.</p><p>The caveat is that Sigma only supports NodeJS at the moment; but Python, Java and other cool languages are on their way!</p><p>(Feel free to comment below, if you have other cool serverless security policy generation tools in mind! And no, <a href="https://awspolicygen.s3.amazonaws.com/policygen.html">AWS Policy Generator</a> doesn’t count.)</p><h3>In closing</h3><p>Least privilege principle is crucial for serverless security, and software design in general; sooner or later, it <em>will</em> save your day.</p><p>Lambda’s highly granular IAM permission model is ideal for the PoLP.</p><p>Tools like the <em>Puresec CLI plugin</em>, all-in-one <em>Sigma IDE</em> and <em>AWS Chalice</em> can automate security policy generation; making your life easier, and still keeping the PoLP promise.</p><p><em>Originally published at </em><a href="http://randomizd.blogspot.com/2018/11/serverless-security-putting-it-on.html?m=1"><em>randomizd.blogspot.com</em></a><em> on November 14, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74198bf686d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/serverless-security-putting-it-on-autopilot-74198bf686d2">Serverless Security: Putting it on Autopilot</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google, Here We Come!]]></title>
            <link>https://medium.com/think-serverless/google-here-we-come-4bc3443d143e?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/4bc3443d143e</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[sigma-ide]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[slappforge]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Wed, 18 Jul 2018 05:28:40 GMT</pubDate>
            <atom:updated>2018-07-18T06:05:26.261Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<h4>Sigma IDE now supports Google Cloud Platform</h4><p>Google is <a href="https://data-economy.com/aws-vs-google-vs-microsoft-how-cloud-giants-are-battling-it-out-in-the-serverless-arena/">catching up fast</a> on the <a href="https://hackernoon.com/why-serverless-why-now-f09ce43c4767">serverless race</a>.</p><p>And we are, too.</p><p>That’s how <a href="https://medium.com/think-serverless/sigma-the-new-kid-on-the-serverless-block-48b0fa02ad2b">our serverless IDE Sigma</a> recently started supporting integration with <a href="https://cloud.google.com/">Google Cloud Platform</a>, pet-named GCP.</p><h3>What the heck does that mean?</h3><p>To be extra honest, there’s <em>nothing</em> new so far. Sigma could interact with GCP (and any other cloud service, for that matter) right from the beginning; we just didn’t have the scaffolding to make things easy and fun — the nice drag-n-drops and UI pop-ups, and the boilerplate code for handling credentials.</p><p>Now, with the bits ’n’ pieces in place, you can drag, drop and operate on your GCP stuff right inside your Sigma project!</p><h3>(*) Conditions apply</h3><p>Of course, there are some important <em>points</em> (well, let’s face it, <em>limitations</em>):</p><ul><li>GCP access is confined to one project, meaning that all cloud resources accessed in a Sigma project should come from a single GCP project. You can, of course, work around this by writing custom authorization logic on your own, but drag-n-drop stuff will still work only for the first project you configured.</li><li>You can only interact with <a href="https://slappforge.com/docs/sigma/concepts/resources.html#new-resources-vs-existing-resources"><em>existing</em> resources</a>, and just as <a href="https://slappforge.com/docs/sigma/concepts/resources.html#using-resources-as-triggers-and-operations">operations</a> (no <a href="https://slappforge.com/docs/sigma/concepts/triggers.html">trigger</a> support). New resource creation and trigger configurations require deeper integration with GCP, which will become available soon (fingers crossed).</li><li>Only a handful of resource types are currently supported — including <a href="https://cloud.google.com/storage/">Storage</a>, <a href="https://cloud.google.com/pubsub/">Pub/Sub</a>, <a href="https://cloud.google.com/datastore/">Datastore</a>, and <a href="https://cloud.google.com/sql/">SQL</a>. These should, however, cover most of the common scenarios; we are hoping to give more attention to big data and machine learning stuff in the immediate future — which <a href="https://www.marketwatch.com/story/ai-in-2018-google-seeks-to-turn-early-focus-on-ai-into-cash-2017-12-28">Google also seems to be thriving upon</a> — but feel free to <a href="https://launchpass.com/slappforge">shout out</a> so we can reconsider our strategy!</li></ul><h3>So, where can I get this thing?</h3><ul><li><a href="https://slappforge.com/docs/sigma/getting_started.html#loading-a-project">Open up your Sigma project</a> (or <a href="https://slappforge.com/docs/sigma/first_project.html#create-new-project">create a new one</a>, if you haven’t already).</li><li>You’ll notice a new set of buttons at the top of the <a href="https://slappforge.com/docs/sigma/basic_functionalities.html#resources-pane">Resources pane</a>; click on <strong>GCP Resources</strong> (the second one, with the GCP logo).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/0*GHV02vIZy9gdCBGl.png" /><figcaption>‘GCP Resources’ button on the Resources pane</figcaption></figure><ul><li>Now you can provide a <a href="https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount">service account key</a> from the desired <a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects">GCP project</a> to access its resources via Sigma. Click <strong>Authorize</strong>, paste the JSON service account key, and press <strong>Save</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/0*oCaKmehvBco7FDjo.png" /><figcaption>GCP Resources pane with ‘Authorize’ button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*Ni7JMjTa0gseK5N_.png" /><figcaption>GCP Service Account Key pop-up</figcaption></figure><ul><li>The Resources pane will now display the available GCP resource types. You can drag-n-drop them into your code, configure new operations and edit existing ones, just like you would do with <a href="https://slappforge.com/docs/sigma/components/aws/">AWS resources</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/0*JXd0VrbX8bWAxwxh.png" /><figcaption>Resources pane displaying available GCP resource types</figcaption></figure><p>(<strong>Disclaimer</strong>: The list you see may differ, depending on how old this post is.)</p><h3>But you said there’s nothing new!</h3><p>How could I have done this earlier?</p><p>Well, if you look closely, you’ll see what we do behind the scenes:</p><ul><li>We have two environment variables, GCP_SERVICE_TOKEN and GCP_PROJECT_ID, which expose the GCP project identity and access to your Sigma app.</li><li>Sigma has an Authorizer file that reads this content and configures the <a href="https://www.npmjs.com/package/googleapis">googleapis NodeJS client library</a>, using them as credentials.</li><li>Your code imports Authorizer (which runs the abovementioned configuration stuff), and invokes operations via googleapis, effectively operating on the resources in your GCP project.</li></ul><p>See? No voodoo.</p><p>Of course, back in those days, you won’t have seen the cool UI pop-ups or the drag ’n’ drop capability; so we’ve had to do a bit of work, after all.</p><h3>Not cool! I want more!!</h3><p>Relax, the <em>really</em> cool stuff is already on the way:</p><ul><li>Ability to define <strong>new</strong> GCP resources, right within the IDE (drag-drop-configure, of course!)</li><li>Ability to use GCP resources as <strong>triggers</strong> (say, fire a cloud function via a Cloud Storage bucket or a Pub/Sub topic)</li></ul><p>And, saving the best for the last,</p><ul><li>Complete application <strong>deployments</strong> on Google Cloud Platform!</li></ul><p>And…</p><ul><li>A complete <strong>cross-cloud</strong> experience: operating on AWS from within GCP, and vice versa!</li><li>With other players (<a href="https://azure.microsoft.com/en-us/overview/serverless-computing/">MS Azure</a>, <a href="https://topic.alibabacloud.com/Serverless.html">Alibaba Cloud</a> and so forth) joining the game, pretty soon!</li></ul><p>So, <a href="https://medium.com/think-serverless">stay tuned!</a></p><p><em>Originally published at </em><a href="http://randomizd.blogspot.com/2018/07/google-here-we-come.html"><em>randomizd.blogspot.com</em></a><em> on July 16, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bc3443d143e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/google-here-we-come-4bc3443d143e">Google, Here We Come!</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to rob a bank: no servers - just a ballpoint pen!]]></title>
            <link>https://medium.com/think-serverless/how-to-rob-a-bank-no-servers-just-a-ballpoint-pen-194dae564fa3?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/194dae564fa3</guid>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[slappforge]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[gossip]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Tue, 15 May 2018 04:43:44 GMT</pubDate>
            <atom:updated>2018-05-15T05:02:37.011Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>How to rob a bank: no servers — just a ballpoint pen!</h3><h4>Yep, it’s not what the title says it is.</h4><p>Okay, let’s face it: this article has nothing to do with robbery, banks or, heck, ballpoint pens; but it’s a good attention grabber (hopefully!), thanks to <a href="https://www.youtube.com/watch?v=iZfyV8vYWug">Chef Horst of Gusteau’s</a>. (Apologies if that broke your heart!)</p><p>Rather, this is about getting your own gossip feed — sending you the latest and the hottest, within minutes they become public — with just an AWS account and a web browser!</p><p>Maybe not as exciting as a bank robbery, but still worth reading on — especially if you’re a gossip fan and like to always have an edge over the rest of your buddies.</p><p><strong><em>TL,DR;:</em></strong><em> It’s all </em><a href="https://github.com/janakaud/gossiphunter"><em>right here</em></a><em>, ready for action.</em></p><h3>Kicking out the server</h3><p>Going with the <a href="https://hackernoon.com/why-serverless-why-now-f09ce43c4767">recent hype</a>, we will be using <em>serverless technologies</em> for our mission. You guessed it, there’s no server involved. (But, psst, <a href="https://medium.com/@PaulDJohnston/why-aws-lambda-and-zip-is-a-recipe-for-serverless-success-4f547a6e87c3#f479">there <em>is</em> one!</a>)</p><p>Let’s go with AWS, which offers an <a href="https://medium.com/@janaka_bandara/serverless-zipchamp-update-your-zip-files-in-s3-almost-in-place-6cfd8d32675e#3956">attractive Free Tier</a> in addition to a myriad of rich serverless utilties: <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html">CloudWatch scheduled events</a> to trigger our gossip seek, <a href="https://aws.amazon.com/dynamodb/">DynamoDB</a> to store gossips and track changes, and <a href="https://docs.aws.amazon.com/sns/latest/dg/SMSMessages.html">SNS-based SMS</a> to dispatch new gossips right into your mobile!</p><p>And the best part is: you will be doing everything — from defining entities and composing lambdas to building, packaging and deploying the whole set-up — right inside your own web browser, without ever having to open up a single <a href="https://hackernoon.com/an-application-developers-perspective-of-aws-codestar-938e05ebf9fc#28f7">tedious AWS console</a>!</p><p>All of it made possible thanks to <a href="https://sigma.slappforge.com/">Sigma</a>, the brand new truly serverless IDE from <a href="https://slappforge.com/">SLAppForge</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/0*atiy--RP770BCoMx.png" /><figcaption>Sigma: Think Serverless!</figcaption></figure><h3>The grocery list</h3><p>First things first: <a href="https://sigma.slappforge.com/#/signup">sign up</a> for a Sigma account, if you haven’t already. All it takes is an email address, <a href="https://console.aws.amazon.com/">AWS account</a> (comes with that cool <a href="https://aws.amazon.com/free/">free tier</a>, if you’re a new user!), <a href="https://github.com/">GitHub account</a> (also free) and a <a href="https://www.digitaltrends.com/computing/best-browser-internet-explorer-vs-chrome-vs-firefox-vs-safari-vs-edge/">good web browser</a>. We have a <a href="https://docs.slappforge.com/getting_started.html">short-and-sweet writeup</a> to get you started within minutes; and will probably come up with a nice video as well, pretty soon!</p><h3>A project is born</h3><p>Once you are in, create a <a href="https://docs.slappforge.com/first_project.html">new project</a> (with a catchy name to impress your buddies — how about GossipHunter?). The Sigma editor will create a template lambda for you, and we can start right away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*ocs1ApQturI68Nu8.png" /><figcaption>GossipHunter at <em>t</em> = 0</figcaption></figure><h3>Nurtured with ❤ by NewsAPI</h3><p>As my gossip source, I picked the <a href="https://newsapi.org/s/entertainment-weekly-api"><em>Entertainment Weekly API</em> by <strong>newsapi.org</strong></a>. Their API is quite simple and straightforward, and a <a href="https://newsapi.org/register">free signup with just an email address</a> gets you an API key with <a href="https://newsapi.org/pricing">1000 requests per day</a>! In case you have your own love, feel free to switch just the API request part of the code (coming up soon!), and the rest should work just fine!</p><h3>The recipe</h3><p>Our lambda will be periodically pulling data from this API, comparing the results with what we already know (stored in DynamoDB) and sending out SMS notifications (via SNS) to your phone number (or email, or whatever other preferred <a href="https://aws.amazon.com/blogs/compute/simplify-pubsub-messaging-with-amazon-sns-message-filtering/">medium</a> that SNS offers) for any already unknown (hence “hot”) results. We will store any newly seen topics in DynamoDB, so that we can prevent ourselves from sending out the same gossip repeatedly.</p><p>(By the way, if you have access to a gossip API that actually emits/notifies you of latest updates (e.g. via <a href="https://hackernoon.com/webhook-vs-api-whats-the-difference-8d41e6661652">webhooks</a>) rather than us having to poll for and filter them, you can use a different, more efficient approach such as configuring an <a href="https://docs.slappforge.com/components/aws/apig.html">API Gateway trigger</a> and pointing the API webhook to the trigger endpoint.)</p><p><strong>Okay, let’s chop away!</strong></p><h3>The wake-up call(s)</h3><p>First, let’s drag a <a href="https://docs.slappforge.com/components/aws/cloudwatch.html">CloudWatch</a> entry from the left <strong>Resources</strong> pane and configure it to fire our lambda; to prevent distractions during working hours, we will configure it to run every 15 minutes, only from 7 PM (when you are back from work) to midnight, and from 5AM to 8 AM (when you are on your way back to work). This can be easily achieved through a <strong>New</strong>, <a href="https://docs.slappforge.com/components/aws/cloudwatch.html#schedule-based-rules"><strong>Schedule</strong>-type</a> trigger that uses a <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">cron expression</a> such as 5-7,19-23 0/15 ? * MON-FRI *. (Simply paste 0/15 , 5-7,19-23 (no spaces) and MON-FRI into the <strong>Minutes</strong>, <strong>Hours</strong> and <strong>Day of Week</strong> fields, and type a ? under <strong>Day of Month</strong>.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/0*knQkhI2O3hfeydqb.png" /><figcaption>CloudWatch Events trigger: weekdays</figcaption></figure><p>But wait! The real value of gossip is certainly in the weekend! So let’s add (drag, drop, configure) another trigger to run GossipHunter all day (5 AM — midnight!) over the weekend; just another cron with 0/10 (every ten minutes this time! we need to be quick!) in <strong>Minutes</strong>, 5-23 in <strong>Hours</strong>, ? in <strong>Day of Month</strong> and SAT,SUN in <strong>Day of Week</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/0*40ItXN9W3QwUZLD9.png" /><figcaption>CloudWatch Events trigger: weekends</figcaption></figure><p>Okay, time to start coding!</p><h3>Grabbing the smoking hot stuff</h3><p>Let’s first fetch the latest gossips from the API. The requests module could do this for us in a heartbeat, so we&#39;ll go get it: click the <strong>Add Dependency</strong> button on the toolbar, type in requests and click <strong>Add</strong> once our subject appears in the list:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/0*PUWVFnLkB4mAYpr4.png" /><figcaption>‘Add Dependency’ button</figcaption></figure><p>Now for the easy part:</p><pre>request.get(`https://newsapi.org/v2/top-headlines?sources=entertainment-weekly&amp;apiKey=your-api-key`,<br>  (error, response, body) =&gt; {<br><br>    callback(null,&#39;Successfully executed&#39;);<br>  })</pre><h4>Gotta hide some secrets?</h4><p>Wait! The apiKey parameter: do I have to specify the value in the code? Since you probably would be saving all this in GitHub (yup, you guessed right!) won&#39;t that compromise my token?</p><p>We also had the same question; and that’s exactly why, just a few weeks ago, we introduced the <strong>environment variables</strong> feature!</p><p>Go ahead, click the <strong>Environment Variables</strong> (<em>(x)</em>) button, and define a KEY variable (associated with our lambda) holding your API key. This value will be available for your lambda at runtime, but it will not be committed into your source; you can simply provide the value during your first deployment after opening the project. And so can any of your colleagues (with their own API keys, of course!) when they get jealous and want to try out their own copy of your GossipHunter!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*dEQdAeVueOHjb6ZS.png" /><figcaption>Defining the ‘KEY’ environment variable</figcaption></figure><p>(Did I mention that your friends can simply grab your GossipHunter’s GitHub repo URL — once you have saved your project — and <a href="https://docs.slappforge.com/getting_started.html#loading-a-project">open it in Sigma right away</a>, and deploy it on their own AWS account? Oh yeah, it’s that easy!)</p><p>Cool! Okay, back to business.</p><p>Before we forget it, let’s append process.env.KEY to our NewsAPI URL:</p><pre>request.get(`https://newsapi.org/v2/top-headlines?sources=entertainment-weekly&amp;apiKey=${process.env.KEY}`,</pre><p>And extract out the gossips list, with a few sanity checks:</p><pre>  (error, response, body) =&gt; {<br>    let result = JSON.parse(body);<br>    if (result.status !== &quot;ok&quot;) {<br>      return callback(&#39;NewsAPI call failed!&#39;);<br>    }<br>    result.articles.forEach(article =&gt; {<br><br>    });<br><br>    callback(null,&#39;Successfully executed&#39;);<br>  })</pre><h3>Sifting out the not-so-hot</h3><p>Now the tricky part: we have to compare these with the most recent gossips that we have dispatched, to detect whether they are truly “new” ones, i.e. filter the ones that have not already been dispatched.</p><p>For starters, we shall maintain a <a href="https://docs.slappforge.com/components/aws/dynamodb.html">DynamoDB table</a> gossips to retain the gossips that we have dispatched, serving as our GossipHunter&#39;s &quot;memory&quot;. Whenever a &quot;new&quot; gossip (i.e. one that is not already available in our table) is encountered, we shall send it out via <a href="https://docs.slappforge.com/components/aws/sns.html">SNS, the Simple Notification Service</a> and add it to our table so that we will not send it out again. (Later on we can improve our &quot;memory&quot; to &quot;forget&quot; (delete) old entries so that it would not keep on growing indefinitely, but for the moment, let&#39;s not worry about it.)</p><h4>What’s thaat, Dynamo-DB?</h4><p>For the DynamoDB table, simply drag a <strong>DynamoDB</strong> entry from the resources pane into the editor, right into the forEach callback. Sigma will show you a pop-up where you can define your table (without a round trip to the DynamoDB dashboard!) and the operation you intend to perform on it. Right now we need to query the table for the gossip in the current iteration, so we can zip it by</p><ul><li>entering gossips into the <strong>Table Name</strong> field and url for the <strong>Partition Key</strong>,</li><li>selecting the <strong>Get Document</strong> operation, and</li><li>entering @{article.url} (note the familiar, ${}-like syntax?) in the <strong>Partition Key</strong> field.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/0*yt5RhJKEKnYGvkO_.png" /><figcaption>Your brand new DynamoDB table ‘gossips’ with a ‘Get Document’ operation</figcaption></figure><pre>      result.articles.forEach(article =&gt; {<br>        ddb.get({<br>          TableName: &#39;gossips&#39;,<br>          Key: { &#39;url&#39;: article.url }<br>        }, function (err, data) {<br>          if (err) {<br>            //handle error<br>          } else {<br>            //your logic goes here<br>          }<br>        });<br><br>      });</pre><p>In the callback, let’s check if DynamoDB found a match (ignoring any failed queries):</p><pre>        }, function (err, data) {<br>          if (err) {<br>            console.log(`Failed to check for ${article.url}`, err);<br>          } else {<br>            if (data.Item) {  // match found, meaning we have<br>                              // already saved it<br>              console.log(`Gossip already dispatched: ${<br>                article.url}`);<br>            } else {<br><br>            }<br>          }<br>        });</pre><h3>Compose (160 characters remaining)</h3><p>In the nested else block (when we cannot find a matching gossip), we prepare an SMS-friendly gossip text (including the title, and optionally the description and URL if we can stuff them in; remember the <a href="http://latimesblogs.latimes.com/technology/2009/05/invented-text-messaging.html">160-character limit</a>?). (Later you can tidy things up by throwing in a URL-shortener logic and so on, but for the sake of simplicity, I&#39;ll pass.)</p><pre>            } else {<br>              let titleLen = article.title.length;<br>              let descrLen = article.description.length;<br>              let urlLen = article.url.length;<br><br>              let gossipText = article.title;<br>              if (gossipText.length + descrLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.description;<br>              }<br>              if (gossipText.length + urlLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.url;<br>              }</pre><h3>Hitting “Send”</h3><p>Now we can send out our gossip as an SNS SMS. For this,</p><ul><li>drag an <a href="https://docs.slappforge.com/components/aws/sns.html"><strong>SNS</strong> entry</a> from the left pane into the editor, right after the last if block,</li><li><a href="https://docs.slappforge.com/components/aws/sns.html#sns-direct-sms-resource">select <strong>Direct SMS</strong> as the <strong>Resource Type</strong></a>,</li><li>enter your mobile number into the <strong>Mobile Number</strong> field,</li><li>populate the SMS text field with @{gossipText},</li><li>type in GossipHuntr as the <strong>Sender ID</strong> (unfortunately the sender ID cannot be longer than 11 characters, but it doesn&#39;t really matter since it is just the text message sender&#39;s name; besides, GossipHuntr is more catchy, right? :)), and</li><li>click <strong>Inject</strong>.</li></ul><h4>But…</h4><p>Wait! What would happen if your best buddy grabs your repo and deploys it; his gossips would also start flowing into your phone!</p><p>Perhaps a clever trick would be to extract out the phone number into another environment variable, so that you and your best buddy can pick your own numbers (and part ways, still as friends) at deployment time. So click the <em>(x)</em> again and add a new PHONE variable (with your phone number), and use it in the <strong>Mobile Number</strong> field instead as (you guessed it!) @{process.env.PHONE}:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/0*WtRcYYwzcAXIWt4h.png" /><figcaption>Behold: gossip SMSs are on their way!</figcaption></figure><pre>            } else {<br>              let titleLen = article.title.length;<br>              let descrLen = article.description.length;<br>              let urlLen = article.url.length;<br><br>              let gossipText = article.title;<br>              if (gossipText.length + descrLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.description;<br>              }<br>              if (gossipText.length + urlLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.url;<br>              }<br><br>              sns.publish({<br>                Message: gossipText,<br>                MessageAttributes: {<br>                  &#39;AWS.SNS.SMS.SMSType&#39;: {<br>                    DataType: &#39;String&#39;,<br>                    StringValue: &#39;Promotional&#39;<br>                  },<br>                  &#39;AWS.SNS.SMS.SenderID&#39;: {<br>                    DataType: &#39;String&#39;,<br>                    StringValue: &#39;GossipHuntr&#39;<br>                  },<br>                },<br>                PhoneNumber: process.env.PHONE<br>              }).promise()<br>                .then(data =&gt; {<br>                  // your code goes here<br>                })<br>                .catch(err =&gt; {<br>                  // error handling goes here<br>                });<br>            }</pre><p>(In case you got overexcited and clicked <strong>Inject</strong> before reading the <em>but…</em> part, chill out! Dive right into the code, and change the PhoneNumber parameter under the sns.publish(...) call; ta da!)</p><h3>Tick it off, and be done with it!</h3><p>One last thing: for this whole contraption to work properly, we also need to save the “new” gossip in our table. Since you have already defined the table during the query operation, you can simply drag it from under the <strong>DynamoDB</strong> list on the resources pane (click the down arrow on the <strong>DynamoDB</strong> entry to see the table definition entry); drop it right under the SNS SDK call, select <strong>Put Document</strong> as the operation, and configure the new entry as url = ${article.url} (by clicking the <strong>Add</strong> button under <strong>Values</strong> and entering url as the key and @{article.url} as the value).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*Y5bnUcXeroB_TxGt.png" /><figcaption>Dragging the existing DynamoDB table in, for our last mission</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*J9IKXSjmPtVXqHd4.png" /><figcaption>Adding a ‘sent’ marker for the ‘hot’ gossip that we just texted out</figcaption></figure><pre>                .then(data =&gt; {<br>                  ddb.put({<br>                    TableName: &#39;gossips&#39;,<br>                    Item: { &#39;url&#39;: article.url }<br>                  }, function (err, data) {<br>                    if (err) {<br>                      console.log(`Failed to save marker for ${<br>                        article.url}`, err);<br>                    } else {<br>                      console.log(`Saved marker for ${<br>                        article.url}`);<br>                    }<br>                  });<br>                })<br>                .catch(err =&gt; {<br>                  console.log(`Failed to dispatch SMS for ${<br>                    article.url}`, err);<br>                });</pre><h3>Time to polish it up!</h3><p>Since we’d be committing this code to GitHub, let’s clean it up a bit (all your buddies would see this, remember?) and throw in some comments:</p><pre>let AWS = require(&#39;aws-sdk&#39;);<br>const sns = new AWS.SNS();<br>const ddb = new AWS.DynamoDB.DocumentClient();<br>let request = require(&#39;request&#39;);<br><br>exports.handler = function (event, context, callback) {<br><br>  // fetch the latest headlines<br>  request.get(`https://newsapi.org/v2/top-headlines?sources=entertainment-weekly&amp;apiKey=${process.env.KEY}`,<br>    (error, response, body) =&gt; {<br><br>      // early exit on failure<br>      let result = JSON.parse(body);<br>      if (result.status !== &quot;ok&quot;) {<br>        return callback(&#39;NewsAPI call failed!&#39;);<br>      }<br><br>      // check each article, processing if it hasn&#39;t been already<br>      result.articles.forEach(article =&gt; {<br>        ddb.get({<br>          TableName: &#39;gossips&#39;,<br>          Key: { &#39;url&#39;: article.url }<br>        }, function (err, data) {<br>          if (err) {<br>            console.log(`Failed to check for ${article.url}`, err);<br>          } else {<br>            if (data.Item) {  // we&#39;ve seen this before; ignore it<br>              console.log(`Gossip already dispatched: ${<br>                article.url}`);<br><br>            } else {<br>              let titleLen = article.title.length;<br>              let descrLen = article.description.length;<br>              let urlLen = article.url.length;<br><br>              // stuff as much content into the text as possible<br>              let gossipText = article.title;<br>              if (gossipText.length + descrLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.description;<br>              }<br>              if (gossipText.length + urlLen &lt; 160) {<br>                gossipText += &quot;\n&quot; + article.url;<br>              }<br><br>              // send out the SMS<br>              sns.publish({<br>                Message: gossipText,<br>                MessageAttributes: {<br>                  &#39;AWS.SNS.SMS.SMSType&#39;: {<br>                    DataType: &#39;String&#39;,<br>                    StringValue: &#39;Promotional&#39;<br>                  },<br>                  &#39;AWS.SNS.SMS.SenderID&#39;: {<br>                    DataType: &#39;String&#39;,<br>                    StringValue: &#39;GossipHuntr&#39;<br>                  },<br>                },<br>                PhoneNumber: process.env.PHONE<br>              }).promise()<br>                .then(data =&gt; {<br>                  // save the URL so we won&#39;t send this out again<br>                  ddb.put({<br>                    TableName: &#39;gossips&#39;,<br>                    Item: { &#39;url&#39;: article.url }<br>                  }, function (err, data) {<br>                    if (err) {<br>                      console.log(`Failed to save marker for ${<br>                        article.url}`, err);<br>                    } else {<br>                      console.log(`Saved marker for ${<br>                        article.url}`);<br>                    }<br>                  });<br>                })<br>                .catch(err =&gt; {<br>                  console.log(`Failed to dispatch SMS for ${<br>                    article.url}`, err);<br>                });<br>            }<br>          }<br>        });<br>      });<br><br>      // notify AWS that we&#39;re good<br>      // (no need to track/notify errors at this stage)<br>      callback(null, &#39;Successfully executed&#39;);<br>    })<br>}</pre><p>All done!</p><h3>3, 2, 1, ignition!</h3><p>Click <strong>Deploy</strong> on the toolbar, which will set a chain of actions in motion: first the project will be saved (committed to your own GitHub repo, with a commit message of your choosing), then built and packaged (fully automated!) and finally deployed into your AWS account (giving you a chance to review the deployment summary before it is executed).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*siU2D6kbxGfZrTP-.png" /><figcaption>Deployment progress</figcaption></figure><p>Once the progress bar hits the end and the deployment status says CREATE_COMPLETE (or UPDATE_COMPLETE in case you missed a spot and had to redeploy), GossipHunter is ready for action!</p><h3>Houston, we’re GO!</h3><p>Until your DynamoDB table is primed up (populated with enough gossips to start waiting for updates), you would receive a trail of gossip texts. After that, whenever a new gossip comes up, you will receive it on your mobile within a matter of minutes!</p><p>All thanks to the <a href="https://dzone.com/articles/revolutionizing-application-development-in-small-a">awesomeness</a> of serverless and AWS, and Sigma that brings it all right into your web browser.</p><p><em>Originally published at </em><a href="http://randomizd.blogspot.com/2018/05/how-to-rob-bank-no-servers-just.html"><em>randomizd.blogspot.com</em></a><em> on May 15, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=194dae564fa3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/how-to-rob-a-bank-no-servers-just-a-ballpoint-pen-194dae564fa3">How to rob a bank: no servers - just a ballpoint pen!</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sigma, the first Truly Serverless DevKit!]]></title>
            <link>https://medium.com/think-serverless/sigma-the-first-truly-serverless-devkit-9459255b9d78?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/9459255b9d78</guid>
            <category><![CDATA[slappforge]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sigma-ide]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Sun, 22 Apr 2018 13:03:54 GMT</pubDate>
            <atom:updated>2018-04-26T04:26:24.574Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>Sigma, the Truly Serverless DevKit!</h3><h4>Resources, triggers, and heck, operations</h4><p>With <a href="https://hackernoon.com/serverless-revolution-the-good-the-bad-and-the-ugly-e76c671cb628">serverless</a>, you <a href="https://medium.com/@PaulDJohnston/serverless-initial-learnings-part-1-fa0dca6c189a">stopped caring about the server</a>.</p><p>With <a href="https://medium.com/think-serverless/sigma-the-new-kid-on-the-serverless-block-48b0fa02ad2b">Sigma</a>, you stopped (or <em>will</em> stop, if not already) about the <em>platform</em>.</p><p>Now all you care about is your <em>code</em> — the bliss of every programmer.</p><p>Or is it?</p><h3>I hold her (the code) in my arms.</h3><p>If you have done time with <a href="http://www.nkode.io/2017/09/12/serverless-frameworks.html#provider-agnostic-serverless-frameworks">serverless frameworks</a>, you would already know how they take away your <em>platform-phobia</em>, abstracting out the platform-specific bits of your serverless app.</p><p>And if you have already <a href="https://medium.com/think-serverless/serverless-getting-started-with-slappforge-sigma-ad2ff8950bd4">tried out Sigma</a>, you would have noticed how it takes things further, relieving you of the burden of the configuration and deployment aspects as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*TRfrdX0Lck_-my60hkiGGg.png" /><figcaption>Sigma for a healthier dev life! (<a href="https://slappforge.com/static/assets/images/sigma-services.svg">https://slappforge.com/static/assets/images/sigma-services.svg</a>)</figcaption></figure><p>Leaving behind just the code.</p><p>Just the <em>beautiful, raw code</em>.</p><h3>So, what’s the catch?</h3><p>Okay. Now for the untold, unspoken, not-so-popular part.</p><p>You see, my friend, <a href="https://www.quora.com/Why-does-every-good-thing-come-with-a-price-metaphorical-price-and-not-the-price-tag">every good thing comes at a price</a>.</p><p>Lucky for you, with Sigma, the price is <em>very</em> affordable.</p><p>Just a matter of sticking to a few ground rules while you develop your app. That’s all.</p><h3>Resources, resources.</h3><p>All of Sigma’s voodoo depends on one key thing: <a href="https://docs.slappforge.com/concepts/resources.html"><em>resources</em></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*aVr_9zDHrfF2emTG.jpg" /><figcaption>Resources, resources! (<a href="http://www.thinkebiz.net/wp-content/uploads/2017/07/cloud-services.jpg">http://www.thinkebiz.net/wp-content/uploads/2017/07/cloud-services.jpg</a>)</figcaption></figure><p>The concept is quite simple: every piece of your serverless app — may it be a <a href="https://docs.slappforge.com/components/aws/dynamodb.html">DynamoDB table</a>, <a href="https://docs.slappforge.com/components/aws/s3.html">S3 bucket</a> or <a href="https://docs.slappforge.com/components/aws/sns.html">SNS topic</a> — is a <em>resource</em> from Sigma’s point of view.</p><p>If you remember the <a href="https://docs.slappforge.com/basic_functionalities.html">Sigma UI</a>, the <strong>Resources</strong> pane on the left contains different resource types that you can have in your serverless app. (True, it’s pretty short; but we’re working on it :))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/0*ifvNbLPkFx9nPm0p.png" /><figcaption>Resources pane in Sigma UI</figcaption></figure><h3>Behind the scenes</h3><p>When you drag a resource from this pane, into your code, Sigma secretly creates a resource (which it would later deploy into your serverless provider) to track the configurations of the actual service entity (say, the <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html">S3 bucket</a> that should exist in AWS by the time your function is running) and all its usages within your code. The tracking is fully automated; frankly, you didn’t even want to know about that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*pwW1UqNcw3Q3Lfac.png" /><figcaption>Sigma tracks resources in your app, and deploys them into the underlying platform! (<a href="https://1.bp.blogspot.com/-MWrikkgPuOk/Wk4SJfLxqAI/AAAAAAAAvYw/sPCXIrCBxvQfuUBFg-v_yJvD1wllXdTcgCLcBGAs/s1600-e20/gps-location-tracking-device.png">https://1.bp.blogspot.com/-MWrikkgPuOk/Wk4SJfLxqAI/AAAAAAAAvYw/sPCXIrCBxvQfuUBFg-v_yJvD1wllXdTcgCLcBGAs/s1600-e20/gps-location-tracking-device.png</a>)</figcaption></figure><h3>“New” or “existing”?</h3><p>On almost all of Sigma’s resource configuration pop-ups, you may have noticed two options: “new” vs “existing”. “New” resources are the ones that would be (or have already been) created <em>as a result of your project</em>, whereas “existing” ones are those which have been created <em>outside of your project</em>.</p><p>Now that’s a tad bit strange because we would usually use “existing” to denote things that “exist”, regardless of their origin — even if they <a href="https://www.lpi.usra.edu/lpi/meteorites/The_Meteorite.shtml">came from Mars</a>.</p><p>Better brace yourself, because this also gives rise to a weirder notion: once you have deployed your project, the created resources (which now “exist” in your account) are still treated by Sigma as “new” resources!</p><p>And, as if that wasn’t enough, this makes the resources lists in Sigma behave in totally unexpected ways; after you define a “new” resource, whenever you want to reuse that resource somewhere else, you would have to look for it under the “existing” tab of the resource pop-up; but it will be marked with a “ (new)” prefix because, although it is already defined, it remains “new” from Sigma’s point of view.</p><p>Perhaps we should have called them “Sigma” resources; or perhaps even better, “project” resources; while we scratch our heads, feel free to <a href="https://github.com/slappforge/sigma/issues">chip in</a> and help us with a better name!</p><h3>Rule o’ thumb</h3><p>Until this awkwardness is settled, the easiest way to get through this mess is to stick to this <strong>rule of thumb</strong>:</p><p><em>If you added a resource to your current Sigma project, Sigma would treat it as a “new” resource till the end of eternity.</em></p><h3>Bottom line: no worries!</h3><p>Being able to use existing resources is sometimes cool, but it means that your project would be much less portable. Sigma will always assume that the resources referenced by your project are already in existence, regardless of whatever AWS account you attempt to deploy it. At least until (if) we (ever) come up with a different resource management mechanism.</p><p>If you want <strong>portability</strong>, always stick to <strong>new</strong> resources. That way, even if a complete stranger gets hold of your project and deploys it in his own, alien, unheard-of AWS account, the project would still work.</p><p>If you are integrating with an <strong>already existing</strong> set of resources (e.g. the set of S3 bucket in your already-running dev/test/prod environment), using <strong>existing</strong> resources is the obvious (and the most convenient) choice.</p><p>Anyways, back to our discussion:</p><p>Where were we?</p><p>Ah, yes. <em>Resources.</em></p><h3>The secret life of resources</h3><p>In a serverless app, you basically use resources for two things:</p><ul><li>for <em>triggering</em> the app (as an <a href="https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html">event source</a>, a.k.a. <em>trigger</em>)</li><li>for performing work <em>inside</em> the app, such as invoking external services</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*DW47hRGYTiHbS_l8.png" /><figcaption>Triggers and operations</figcaption></figure><h3>Resources? Triggers?? Operations???</h3><p>Sigma also associates its resources with your serverless app in a similar fashion:</p><p>In Sigma, a function can have several triggers (as long as the application itself is aware of tackling different trigger event types!), and can contain several operations (obviously).</p><h3>Yet, they’re different.</h3><p>It is noteworthy that a resource itself is not a trigger or an operation; triggers and operations are <em>associated with</em> resources (they kind of “bridge” functions and resources) but a resource has its own independent life. As a result, a resource can power many triggers (to be precise, <em>zero or more</em>) and get involved in many operations, across many (again, zero or more) functions.</p><p>A good example is <a href="https://docs.slappforge.com/components/aws/s3.html">S3</a>. If you want to write an <a href="https://github.com/slappforge/s3-thumbnail-generator">image resizer</a> function that would pick and process images dropped into a S3 bucket, you would configure a <a href="https://docs.slappforge.com/components/aws/s3.html#s3-as-a-trigger">S3 <em>trigger</em></a> to invoke the function upon the file drop, and a <a href="https://docs.slappforge.com/components/aws/s3.html#get-object">S3 </a><a href="https://docs.slappforge.com/components/aws/s3.html#get-object">GetObject <em>operation</em></a> to retrieve and process the file; however, both will point to the same S3 <em>resource</em>, namely the bucket where images are being dropped into and fetched from.</p><h3>Launch time!</h3><p>At deployment, Sigma will take care of putting the pieces together — trigger configs, runtime permissions and whatnot — based on which function is associated with which resources, and in which ways (trigger-mode vs operation-mode). You can simply drag, drop and configure your buckets, queues and stuff, write your code, and totally forget about the rest!</p><p>That’s the <em>beauty</em> of Sigma.</p><p>When a resource is “abandoned” (meaning that it is not used in any trigger or operation), it shows up in the “unused resources” list (remember the dustbin button on the toolbar?) and can be removed from the project; remember that if you do this, provided that the resource is a “new” one (rule of thumb: one created in Sigma), it will be automatically removed from your serverless provider account (for example, AWS) during your next deployment!</p><p>So there!</p><p>if Sigma’s resource model (the whole purpose of this article) looks like a total mess-up to you, feel free to raise your voice on <a href="https://stackoverflow.com/questions/tagged/adroitlogic">StackOverflow</a> — or better still, our <a href="https://github.com/slappforge/sigma/issues">GitHub</a> space, <a href="https://mobile.facebook.com/SLAppForge">FB page</a> or <a href="https://mobile.twitter.com/SLAppForge">Twitter feed</a>; we would appreciate it very much!</p><p>Of course, Sigma has nothing to hide; if you check your AWS account after a few Sigma deployments, you would realize the things we have been doing under the hood.</p><p>All of it, to make your serverless journey as smooth as possible.</p><p>And easy.</p><p>And fun. :)</p><p>Welcome to <a href="https://sigma.slappforge.com/#/signup">the world of Sigma</a>!</p><p><em>Originally published at </em><a href="http://randomizd.blogspot.com/2018/04/sigma-serverless-ide-resources-triggers.html"><em>randomizd.blogspot.com</em></a><em> on April 22, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9459255b9d78" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/sigma-the-first-truly-serverless-devkit-9459255b9d78">Sigma, the first Truly Serverless DevKit!</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless: a no-brainer!]]></title>
            <link>https://medium.com/think-serverless/serverless-a-no-brainer-6dc53c5bd5fb?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/6dc53c5bd5fb</guid>
            <category><![CDATA[paradigm-shift]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[slappforge]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Sun, 22 Apr 2018 13:03:32 GMT</pubDate>
            <atom:updated>2018-04-22T13:03:31.878Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>Serverless</h3><h4>A no-brainer!</h4><p>Few years ago, <a href="https://linuxcontainers.org/lxc/introduction/">containers</a> swept through the dev and devops lands like a <a href="http://time.com/4946730/hurricane-categories/">category-6 hurricane</a>.</p><p><a href="https://docs.docker.com/">Docker</a>. <a href="https://coreos.com/rkt/">Rkt</a>. <a href="https://coreos.com/rkt/docs/latest/rkt-vs-other-projects.html">others</a>.</p><p><a href="https://docs.docker.com/engine/swarm/">Docker Swarm</a>.</p><p><a href="https://kubernetes.io/">K8s</a>.</p><p><a href="https://www.openshift.com/container-platform/index.html">OpenShift</a>.</p><p>Right now we are literally at the epicenter, but when we glimpse at the horizon we see another one coming!</p><p><a href="https://en.m.wikipedia.org/wiki/Serverless_computing">Serverless</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*k1OSZbBPg1SI64l-.jpg" /><figcaption>It’s just a matter of time! (<a href="https://image.slidesharecdn.com/apigeemicroservices-160803034916/95/whats-better-than-microservices-serverless-microservices-13-638.jpg">https://image.slidesharecdn.com/apigeemicroservices-160803034916/95/whats-better-than-microservices-serverless-microservices-13-638.jpg</a>)</figcaption></figure><p>The funny thing is, <a href="https://hackernoon.com/why-serverless-why-now-f09ce43c4767">“serverless” itself is a misnomer</a>.</p><p>Of course there are servers. There are <em>always</em> servers. How can programs execute themselves in thin air, without the support of the underlying hardware and utility modules? So, there <em>are</em> servers.</p><p>Just not <a href="http://insightaas.com/serverless-computing-no-servers-really/"><em>where</em></a> you would expect them to be.</p><p>Traversing the timeline of computing, we see the turbulent track record?? of servers: birth in secret dungeons of vaccum tubes and <a href="http://www.pbs.org/wgbh/aso/databank/entries/dt45en.html">city-scale power supplies</a>; multi-ton boxes; networks; clusters; cloud datacenters and server <em>farms</em> (agriculture just lost its royalty!); containers.</p><p>Over time, we see servers losing their significance. Gradually, but steadily.</p><p>And now, suddenly, <em>puff</em>! They are gone.</p><p><em>Invisible</em>, to be precise.</p><p>With <em>serverless</em>, you <a href="https://medium.com/@PaulDJohnston/what-is-serverless-architecture-43b9ea4babca">no longer care</a> about the server. It may be a physical machine, a cloud VM, a <a href="https://coreos.com/kubernetes/docs/latest/pods.html">K8s pod</a>, an <a href="https://aws.amazon.com/containers/">ECS container</a>… heck, even an <a href="https://medium.com/@JockDaRock/serverless-at-the-edge-up-and-running-w-openfaas-docker-on-a-raspberry-pi-multi-node-cluster-e0957f4d8a49">IoT rig</a>.</p><p>Nobody cares, as long as the job gets done.</p><p>In this sense, we realize that serverless is nothing new; the concept, and even some pracical implementations, have been there since as far back as <a href="https://en.m.wikipedia.org/wiki/Serverless_computing#Serverless_runtimes">2006</a>. You yourself may have benefited from serverless (or conceptually serverless) architectures; while one may argue them to be PaaSes, <a href="https://cloud.google.com/appengine/">Google App Engine</a> and <a href="https://developers.google.com/apps-script/">Google Apps Script</a> (especially) are good examples.</p><figure><img alt="https://cdn-images-1.medium.com/max/650/1*EGiHey9K3fO5qXHcFOwxrQ.jpeg" src="https://cdn-images-1.medium.com/proxy/1*EGiHey9K3fO5qXHcFOwxrQ.jpeg" /><figcaption>Didn’t they use to call this stuff…? (<a href="https://cdn-images-1.medium.com/max/650/1*EGiHey9K3fO5qXHcFOwxrQ.jpeg">https://cdn-images-1.medium.com/max/650/1*EGiHey9K3fO5qXHcFOwxrQ.jpeg</a>)</figcaption></figure><p>Just like <a href="https://www.thoughtco.com/who-invented-touch-screen-technology-1992535">touchscreens</a>, serverless resemblances had always been there, but never has the marketing hype been this intense — obviously it is growing, and we’ll surely see more of it as time flies by.</p><p>AWS had an <a href="https://read.acloud.guru/aws-lambda-vs-google-cloud-functions-vs-azure-functions-who-has-the-serverless-advantage-f6c2535e72f4">early entry</a> to the arena and currently owns a huge market share, bigger than all the others combined; Azure is behind, but <a href="https://www.azurefromthetrenches.com/azure-functions-significant-improvements-in-http-trigger-scaling/">catching up fast</a>; and Google still seems to be more focused on <a href="https://cloud.google.com/containers/">Kubernetes and related containerization stuff</a> although they too are on the track with <a href="https://cloud.google.com/functions/">Cloud Functions</a> and <a href="https://firebase.google.com/">Firebase</a>.</p><p><a href="https://mapr.com/ebooks/streaming-architecture/">Streaming</a> and <a href="https://martinfowler.com/articles/201701-event-driven.html">event-driven</a> architectures are playing their part in bringing value to serverless. We should also not forget the <a href="https://www.computerweekly.com/news/4500244277/Cloud-hype-leads-to-enterprise-dissatisfaction-with-off-premise-investments">cloud hype</a> that made people go <a href="https://www.chargify.com/blog/xaas-everything-as-a-service/">every-friggin-thing-as-a-service</a> and later left them wondering how they could <a href="https://community.hpe.com/t5/Grounded-in-the-Cloud/What-really-is-pay-per-use-in-cloud/ba-p/2407093">pay only for what they <em>really</em> use, only <em>while</em> they use it</a>.</p><p>All ramblings aside, <a href="https://news.ycombinator.com/item?id=12274715">serverless is growing in popularity</a>. Platforms are evolving to support more <a href="https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html">event sources</a>, better <a href="https://www.opsgenie.com/blog/2017/11/customizing-opsgenie-zendesk-integration-with-aws-lambda">integration support for other services</a> and richer <a href="https://hackernoon.com/how-we-monitor-serverless-apps-with-hundreds-of-functions-d0f1fa938d1e">monitoring and statistics</a>. Frameworks like <a href="https://serverless.com/">Serverless</a> are striving to provide a unified and generifier serverless development experience while <a href="https://slappforge.com/">IDEs like Sigma</a> are doing their part in helping newbies (and sometimes even professionals) get going with serverless with minimum hassle and maximum speed.</p><p>Being new and shiny <a href="https://hackernoon.com/serverless-revolution-the-good-the-bad-and-the-ugly-e76c671cb628">does not necessarily mean</a> that serverless is the <a href="https://read.acloud.guru/debunking-serverless-myths-cc329460d061">silver bullet</a> for all your dev issues; in fact, right now it fits into only a few enterprise use cases (primarily due to the lack of strong guarantees, which are quite commonplace in the bureaucratic enterprise atmosphere). Nevertheless, providers are <a href="https://aws.amazon.com/compliance/services-in-scope/">already working on this</a>, and we can expect some disruptive — if not revolutionary — changes in the not-too-distant future. However it is always best to re-iterate your requirements before officially stepping into the serverless world, because serverless demands quite a shift in your application architecture, devops, as well as the very core of your developer mindset.</p><p>And, of course, the best way to pick the cake is to <a href="https://slappforge.com/">taste it yourself</a>.</p><p><em>Originally published at </em><a href="http://randomizd.blogspot.com/2018/04/serverless-no-brainer.html"><em>randomizd.blogspot.com</em></a><em> on April 22, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dc53c5bd5fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/serverless-a-no-brainer-6dc53c5bd5fb">Serverless: a no-brainer!</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sigma QuickBuild: Towards a Faster Serverless IDE]]></title>
            <link>https://medium.com/think-serverless/sigma-quickbuild-towards-a-faster-serverless-ide-23c5d7eea841?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/23c5d7eea841</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[faa]]></category>
            <category><![CDATA[slappforge]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 07:33:41 GMT</pubDate>
            <atom:updated>2018-04-26T04:24:46.393Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>Sigma QuickBuild</h3><h4>Towards a Faster Serverless IDE</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olBYZZp9amUFcMfvaCXY0A.jpeg" /><figcaption><a href="http://www.evolutionarydesigns.net/blog/wp-content/uploads/2012/01/building-traffic.jpg">http://www.evolutionarydesigns.net/blog/wp-content/uploads/2012/01/building-traffic.jpg</a></figcaption></figure><blockquote><strong>TL;DR:</strong> The <em>QuickBuild/QuickDeploy</em> feature described here is pretty much obsoleted by the <a href="https://hackernoon.com/how-we-streamlined-serverless-testing-8f5e0bbdc7e5"><strong>test framework</strong></a> (ingeniously hacked together by <a href="https://medium.com/@cwidanage">@CWidanage</a>), that gives you a much more streamlined dev-test experience with much better response time!</blockquote><p>In case you hadn’t noticed, we have recently been <a href="https://mobile.twitter.com/SLAppForge">chanting about</a> a new <a href="https://medium.com/think-serverless/sigma-the-new-kid-on-the-serverless-block-48b0fa02ad2b">Serverless IDE</a>, the mighty <a href="https://slappforge.com/">SLAppForge Sigma</a>.</p><p>With Sigma, developing a serverless app becomes as easy as <a href="http://rnavagamuwa.com/cool-stuff/improve-your-aws-lambda-development-with-sigma/">drag-drop</a>, code, and <a href="https://docs.slappforge.com/basic_functionalities.html#toolbar">one-click-Deploy</a>; no getting lost among <a href="https://news.ycombinator.com/item?id=11884507">overcomplicated dashboards</a>, no <a href="https://medium.freecodecamp.org/running-around-the-block-a-beginner-meets-aws-lambda-560a1f2849ae">eternal struggles</a> with service entities and their permissions, no sailing through oceans of docs and tutorials — above all that, nothing to install (just a web browser — which you already have!).</p><h3>So, how does Sigma do it all?</h3><p>In case you already tried Sigma and dug a bit deeper than just deploying an app, you may have noticed that it uses <a href="https://aws.amazon.com/codebuild/">AWS CodeBuild</a> under the hood for the build phase. While CodeBuild gives us a fairly simple and convenient way of configuring and running builds, it has its own set of perks:</p><ul><li>CodeBuild takes a significant time to complete (sometimes close to a minute). This may not be a problem if you just deploy a few sample apps, but it can severely impair your productivity — especially when you begin developing your own solution, and need to reflect your code updates every time you make a change.</li><li>The AWS <a href="https://aws.amazon.com/free/">Free Tier</a> only includes <a href="https://aws.amazon.com/codebuild/pricing/#Pricing">100 minutes</a> of CodeBuild time per month. While this sounds like a generous amount, it can expire much faster than you think — especially when developing your own app, in your usual trial-and-error cycles ;) True, CodeBuild doesn’t cost much either (<a href="https://aws.amazon.com/codebuild/pricing/">$0.005 per minute of </a><a href="https://aws.amazon.com/codebuild/pricing/">build.general1.small</a>), but why not go free while you can? :)</li></ul><h3>Options, people?</h3><p><a href="https://aws.amazon.com/lambda/pricing/">Lambda</a>, on the other hand, has a rather impressive free quota of <strong>1 million</strong> executions and <strong>3.2 million</strong> seconds of execution time per month. Moreover, <a href="https://aws.amazon.com/s3/pricing/#Data_Transfer_Pricing">traffic between S3 and Lambda is free</a> as far as we are concerned!</p><p>Oh, and S3 has a free quota of <a href="https://aws.amazon.com/s3/pricing/#AWS_Free_Usage_Tier*">20000 reads and 2000 writes</a> per month — which, with some optimizations on the reads, is quite sufficient for what we are about to do.</p><h3>2 + 2 = …</h3><p>So, guess <em>what</em> we <em>are about to do</em>?</p><p>Yup, we’re going to <a href="https://medium.freecodecamp.org/serverless-zipchamp-update-your-zip-files-in-s3-almost-in-place-6cfd8d32675e">update our Lambda source artifacts in S3, via Lambda itself</a>, instead of CodeBuild!</p><p>Of course, replicating the full CodeBuild functionality via a lambda would need a fair deal of effort, but we can get away with a much simpler subset; read on!</p><h3>The Big Picture</h3><p>First, let’s see what Sigma does when it builds a project:</p><ul><li>prepare the infra for the build, such as a <em>role</em> and an <em>S3 bucket</em>, skipping any that already exist</li><li>create a CodeBuild <em>project</em> (or, if one already exists, update it to match the latest Sigma project spec)</li><li>invoke the project, which will:</li></ul><ol><li>download the Sigma project source from your GitHub repo,</li><li>run an npm install to populate its dependencies,</li><li>package everything into a zip file, and</li><li>upload the zip artifact to the S3 bucket created above</li></ol><ul><li>monitor the project progress, and retrieve the URL of the uploaded S3 file when done.</li></ul><p>And usually every build has to be followed by a deployment; to update the lambdas of the project to point to the newly generated source archive; and that means a whole load of additional steps!</p><ul><li>create a <a href="https://aws.amazon.com/cloudformation/">CloudFormation</a> <em>stack</em> (if one does not exist)</li><li>create a <em>changeset</em> that contains the latest updates to be published</li><li>execute the changeset, which will, at the least, have to:</li></ul><ol><li>update each of the lambdas in the project to point to the new source zip file generated by the build, and</li><li>in some cases, update the triggers associated with the modified lambdas as well</li></ol><ul><li>monitor the stack progress until it gets through with the update.</li></ul><p>All in all, well over 60–90 seconds of your precious time — all to accommodate perhaps just one line (or how about one word, or one letter?) of change!</p><h3>Can we do better?</h3><p>At first glance, we see quite a few redundancies and possible improvements:</p><ul><li>Cloning the whole project source from scratch is overkill, especially when only a few lines/files have changed.</li><li>Every build will download and populate the NPM dependencies from scratch, consuming bandwidth, CPU cycles and build time.</li><li>The whole zip file is now being prepared from scratch after each build.</li><li>Since we’re still in dev, running a costly CF update for every single code change doesn’t make much sense.</li></ul><p>But since <a href="https://stackoverflow.com/questions/43220180/how-to-avoid-repeatedly-cloning-a-3rd-party-git-repo-in-ci-builds">CodeBuild invocations are stateless</a> and CloudFormation’s resource update logic is mostly out of our hands, we don’t have the freedom to meddle with many of the above; other than simple improvements like <a href="https://aws.amazon.com/blogs/devops/how-to-enable-caching-for-aws-codebuild/">enabling dependency caching</a>.</p><h3>Trimming down the fat</h3><p>However, if we have a lambda, we have full control over how we can simplify the build!</p><p>If we think about <a href="https://en.m.wikipedia.org/wiki/Pareto_principle">80% — or maybe even 90%</a> — of the cases for running a build, we see that they merely involve changes to application logic (code); you don’t add new dependencies, move your files around or change your repo URL all the time, but you sure as heck would go through an awful lot of code edits until your code starts behaving as you expect it to!</p><p>And what does this mean for our build?</p><p>80% — or even 90% — of the time, we can get away by updating just the modified files in the lambda source zip, and updating the lambda functions themselves to point to the updated file!</p><h3>Behold, here comes QuickDeploy!</h3><p>And <em>that’s</em> exactly what we do, with the <em>QuickBuild/QuickDeploy</em> feature!</p><h3>Lambda to the rescue!</h3><p><em>QuickBuild</em> uses a lambda (deployed in your own account, to eliminate the need for cross-account resource access) to:</p><ul><li>fetch the latest CodeBuild zip artifact from S3,</li><li><a href="https://dzone.com/articles/serverless-zipchamp-update-your-zip-files-in-s3-al">patch the zip file</a> to accommodate the latest code-level changes, and</li><li>upload the updated file back to S3, overriding the original zip artifact</li></ul><p>Once this is done, we can run a <em>QuickDeploy</em> which simply sends an <a href="https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionCode.html">UpdateFunctionCode</a> Lambda API call to each of the affected lambda functions in your project, so that they can scoop up the latest and greatest of your serverless code!</p><p>And the whole thing does not take more than 15 seconds (give or take the network delays): a raw <strong>4x</strong> improvement in your serverless dev workflow!</p><h3>A sneak peek</h3><p>First of all, we need a lambda that can <a href="https://github.com/janakaud/zipchamp">modify an S3-hosted zip file</a> based on a given set of input files. While it’s easy to make with NodeJS, it’s even easier with Python, and requires zero external dependencies as well:</p><h4>Here we go… Pythonic!</h4><pre>import boto3</pre><pre>from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED</pre><pre>s3_client = boto3.client(&#39;s3&#39;)</pre><pre>def handler(event, context):<br>  src = event[&quot;src&quot;]<br>  if src.find(&quot;s3://&quot;) &gt; -1:<br>    src = src[5:]<br>  <br>  bucket, key = src.split(&quot;/&quot;, 1)<br>  src_name = &quot;/tmp/&quot; + key[(key.rfind(&quot;/&quot;) + 1):]<br>  dst_name = src_name + &quot;_modified&quot;<br>  <br>  s3_client.download_file(bucket, key, src_name)<br>  zin = ZipFile(src_name, &#39;r&#39;)<br>  <br>  diff = event[&quot;changes&quot;]<br>  zout = ZipFile(dst_name, &#39;w&#39;, ZIP_DEFLATED)<br>  <br>  added = 0<br>  modified = 0<br>  <br>  # files that already exist in the archive<br>  for info in zin.infolist():<br>    name = info.filename<br>    if (name in diff):<br>      modified += 1<br>      zout.writestr(info, diff.pop(name))<br>    else:<br>      zout.writestr(info, zin.read(info))<br>  <br>  # files in the diff, that are not on the archive<br>  # (i.e. newly added files)<br>  for name in diff:<br>    info = ZipInfo(name)<br>    info.external_attr = 0755 &lt;&lt; 16L<br>    added += 1<br>    zout.writestr(info, diff[name])<br>  <br>  zout.close()<br>  zin.close()<br>  <br>  s3_client.upload_file(dst_name, bucket, key)<br>  return {<br>    &#39;added&#39;: added,<br>    &#39;modified&#39;: modified<br>  }</pre><p>We can directly invoke the lambda using the <a href="https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html">Invoke API</a>, hence we don&#39;t need to define a trigger for the function; just a role with S3 full access permissions would do. (We use full access here because we would be reading from/writing to different buckets at different times.)</p><h4>CloudFormation, you beauty.</h4><p>From what I see, the coolest thing about this contraption is that you can stuff it all into a single <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html">CloudFormation template</a> (remember the <a href="https://www.javacodegeeks.com/2018/02/inside-lambda-runtime-peek-serverless-lair.html">lambda command shell?</a>) that can be deployed (and undeployed) in one go:</p><pre>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Resources:<br>  zipedit:<br>    Type: AWS::Lambda::Function<br>    Properties:<br>      FunctionName: zipedit<br>      Handler: index.handler<br>      Runtime: python2.7<br>      Code:<br>        ZipFile: &gt;<br>          import boto3<br>          <br>          from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED<br>          <br>          s3_client = boto3.client(&#39;s3&#39;)<br>          <br>          def handler(event, context):<br>            src = event[&quot;src&quot;]<br>            if src.find(&quot;s3://&quot;) &gt; -1:<br>              src = src[5:]<br>            <br>            bucket, key = src.split(&quot;/&quot;, 1)<br>            src_name = &quot;/tmp/&quot; + key[(key.rfind(&quot;/&quot;) + 1):]<br>            dst_name = src_name + &quot;_modified&quot;<br>            <br>            s3_client.download_file(bucket, key, src_name)<br>            zin = ZipFile(src_name, &#39;r&#39;)<br>            <br>            diff = event[&quot;changes&quot;]<br>            zout = ZipFile(dst_name, &#39;w&#39;, ZIP_DEFLATED)<br>            <br>            added = 0<br>            modified = 0<br>            <br>            # files that already exist in the archive<br>            for info in zin.infolist():<br>              name = info.filename<br>              if (name in diff):<br>                modified += 1<br>                zout.writestr(info, diff.pop(name))<br>              else:<br>                zout.writestr(info, zin.read(info))<br>            <br>            # files in the diff, that are not on the archive<br>            # (i.e. newly added files)<br>            for name in diff:<br>              info = ZipInfo(name)<br>              info.external_attr = 0755 &lt;&lt; 16L<br>              added += 1<br>              zout.writestr(info, diff[name])<br>            <br>            zout.close()<br>            zin.close()<br>            <br>            s3_client.upload_file(dst_name, bucket, key)<br>            return {<br>              &#39;added&#39;: added,<br>              &#39;modified&#39;: modified<br>            }<br>      Timeout: 60<br>      MemorySize: 256<br>      Role:<br>        Fn::GetAtt:<br>        - role<br>        - Arn<br>  role:<br>    Type: AWS::IAM::Role<br>    Properties:<br>      ManagedPolicyArns:<br>      - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole<br>      - arn:aws:iam::aws:policy/AmazonS3FullAccess<br>      AssumeRolePolicyDocument:<br>        Version: 2012-10-17<br>        Statement:<br>        - Action: sts:AssumeRole<br>          Effect: Allow<br>          Principal:<br>            Service: lambda.amazonaws.com</pre><h3>Moment of truth</h3><p>Once the stack is ready, we can start submitting our QuickBuild requests to the lambda!</p><pre>// assuming auth stuff is already done<br>let lambda = new AWS.Lambda({region: &quot;us-east-1&quot;});</pre><pre>// ...</pre><pre>lambda.invoke({<br>  FunctionName: &quot;zipedit&quot;,<br>  Payload: JSON.stringify({<br>    src: &quot;s3://bucket/path/to/archive.zip&quot;,<br>    changes: {<br>      &quot;path/to/file1/inside/archive&quot;: &quot;new content of file1&quot;,<br>      &quot;path/to/file2/inside/archive&quot;: &quot;new content of file2&quot;,<br>      // ...<br>    }<br>  })<br>}, (err, data) =&gt; {<br>  let result = JSON.parse(data.Payload);<br>  let totalChanges = result.added + result.modified;<br>  if (totalChanges === expected_no_of_files_from_changes_list) {<br>    // all izz well!<br>  } else {<br>    // too bad, we missed a spot :(<br>  }<br>});</pre><p>Once QuickBuild has completed updating the artifact, it’s simply a matter of calling UpdateFunctionCode on the affected lambdas, with the S3 URL of the artifact:</p><pre>lambda.updateFunctionCode({<br>  FunctionName: &quot;original_function_name&quot;,<br>  S3Bucket: &quot;bucket&quot;,<br>  S3Key: &quot;path/to/archive.zip&quot;<br>})<br>.promise()<br>.then(() =&gt; { /* done! */ })<br>.catch(err =&gt; { /* something went wrong :( */ });</pre><p>(In our case the S3 URL remains unchanged (because our lambda simply overwrites the original file), but it still works because <a href="https://stackoverflow.com/questions/41876036/how-to-get-the-composition-of-a-lambda-aws#41876273">the Lambda service makes a copy of the code artifact when updating the target lambda</a>.)</p><p>To speed up the QuickDeploy for multiple lambdas, we can even <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/all">parallelize</a> the UpdateFunctionCode calls:</p><pre>Promise.all(<br>  lambdaNames.map(name =&gt;<br>    lambda.updateFunctionCode({ /* params */ })<br>    .promise()<br>    .then(() =&gt; { /* done! */ }))</pre><pre>.then(() =&gt; { /* all good! */ })<br>.catch(err =&gt; { /* failures; handle them! */ });</pre><p>And that’s how we gained an initial <em>4x</em> improvement in our lambda deployment cycle, sometimes <em>even faster than the native AWS Lambda console</em>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23c5d7eea841" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/sigma-quickbuild-towards-a-faster-serverless-ide-23c5d7eea841">Sigma QuickBuild: Towards a Faster Serverless IDE</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sigma: The New Kid on the Serverless Block]]></title>
            <link>https://medium.com/think-serverless/sigma-the-new-kid-on-the-serverless-block-48b0fa02ad2b?source=rss----8cd36f886911---4</link>
            <guid isPermaLink="false">https://medium.com/p/48b0fa02ad2b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Janaka Bandara]]></dc:creator>
            <pubDate>Tue, 27 Mar 2018 11:51:08 GMT</pubDate>
            <atom:updated>2018-02-13T17:38:27.529Z</atom:updated>
            <content:encoded><![CDATA[<p>Despite its young age (barely <a href="https://plato.stanford.edu/entries/computing-history/#ENIAC">73 years</a>; in comparison to, say, <a href="https://en.m.wikipedia.org/wiki/History_of_the_automobile">automobiles (200+)</a>, digital computing is growing and flourishing rapidly; and so are the associated tools and utilities. Today’s “hot” topic or tech is no longer hot tomorrow, “legacy” in a week and “deprecated” in a month.</p><p>Application deployment and orchestration is no exception: in just three decades we have gone from legacy monoliths to modular systems, P2P integration, middleware, SOA, microservices, and the latest, functions or FaaS. The deployment paradigm has shifted to comply, with in-house servers and data centers, enterprise networks, VMs, containers, and now, “serverless”.</p><p>Keeping up with things was easy so far, but the serverless paradigm demands quite a shift in the developer mindset (not to mention the programming paradigm). This, combined with the lack of intuitive tooling, has fairly hindered the adoption of serverless application development, even among the cutting-edge developers.</p><p>And (you guessed it), that’s where _____ comes into play.</p><h3>Missing something?</h3><p>Yup.</p><p>A way to glue stuff together.</p><p>A way to compose a serverless application care-free. Without having to worry — and to read tons of documentation, watch reels of tutorials, or trial-and-error till your head is on fire — about all the bells and whistles of the underlying framework and related services.</p><p>Essentially, a sum-up of all that is serverless.</p><p>Sum.</p><p>Sigma.</p><p>Σ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*CPypwgue25WCwC-epU519A.png" /></figure><h3>What’s in a name?</h3><p>As the name implies, (quoted from the <a href="https://www.slappforge.com/">official website</a>)</p><blockquote>The Sigma editor is a hybrid between the simplicity of drag-and-drop style development, and the full and unlimited power of raw code.</blockquote><blockquote>The drag-and-drop events generate sample or usage snippets to quickly get started, and introduce a powerful, uniform and intuitive library with auto-completion, which allow users to quickly become productive in developing Serverless applications that integrate with a myriad of AWS based services.</blockquote><h3>Making of…</h3><p>Before Sigma, a bit of background of its origins.</p><p>As a first-time user of <a href="https://aws.amazon.com/lambda/">AWS Lambda</a>, one of our team members brought up an impressive series of questions: if serverless is so cool, why is it so complicated to get an application up and running in Lambda?</p><p>And we ourselves started trying out the same thing. Guess what, we got the same questions as well.</p><p>So we set out to devise something that could bypass all those tedious steps: something where we could just write our code, save it, and deploy it as a working serverless application, without having to wander from dashboard to dashboard, or sift through heaps of documentation or reels of video tutorials.</p><p>And we ended up with Sigma!</p><h3>Yet another IDE?</h3><p>At first glance, Sigma looks like another cloud IDE that additionally supports deploying an application directly into a serverless provider environment (AWS so far).</p><p>However, there are a few not-to-be-missed distinctions:</p><ul><li>Unlike many of the <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment.html">existing cloud IDEs</a>, Sigma itself is <strong>truly serverless</strong>; it runs completely inside your browser, using backend services only for user authentication and analytics, and requires no dedicated server/VM/container to be running in the background. Just fire up your browser, log in, and start coding your dream away.</li><li>Sigma <strong>directly interacts</strong> with and configures the serverless platform on your behalf, using the credentials that you provide, saving hours of configuration and troubleshooting time. No more back-and-forth between <a href="https://hackernoon.com/an-application-developers-perspective-of-aws-codestar-938e05ebf9fc#28f7">overcomplicated dashboards</a> and dizzying configurations.</li><li>Sigma <strong>encapsulates the complexities</strong> of the serverless platform, such as service entities, access policies, invocation trigger configurations and associated permissions, and even some API invocation syntaxes, saving you the trouble of having to delve into piles of documentation.</li><li>All of this comes in a fairly <strong>simple, intuitive</strong> environment, with easy, drag-and-drop composition combined with the full power of written code. Drag and drop a DynamoDB table into the UI, pick your operation and just write your logic, and Sigma will do the magic of automatically creating, configuring and managing the DynamoDB table on your AWS account.</li></ul><p>Now, I won’t say that’s “just another IDE”; what say you?</p><h3>A serverless platform?</h3><p>Based on the extent of its capabilities, you may also be inclined to classify Sigma as a serverless platform. This is true to a great extent; after all, Sigma facilitates all of it — composing, building and deploying the application! However…</p><h3>Hybrid! It’s a hybrid!</h3><p>Yup, Sigma is a hybrid.</p><p>Fusion of a cloud IDE (which in itself is a hybrid of graphical composition and granular coding) and a serverless development framework (which automatically deploys and manages the resources, permissions, wiring and other bells and whistles of your serverless application).</p><p>One of a kind.</p><p>To be precise, the <strong>first</strong> of its kind.</p><h3>A new beginning</h3><p>With Sigma, we hope to redefine serverless development.</p><p>Yup. Seriously.</p><p>From here onwards, developers shall simply focus on what they need to achieve: workflow, business logic, algorithm, whatever.</p><p>Not about all the gears and crankshafts of the platform on which they would deploy the whole thing.</p><p>Not about the syntax of, or permissions required by, platform-specific API or service calls.</p><p>Not about the deployment, configurations and lifecycle of all the tables, buckets, streams, schedulers, REST endpoints, queues and so forth, that they want to use within their application.</p><p>Because Sigma will take care of it all.</p><p>And we believe our initiative would</p><ul><li>make it easy for newcomers to get started with serverless development,</li><li>improve the productivity of devs that are already familiar with — or even experts of — serverless development,</li><li>speed up the adoption of serverless development among the not-yet-serverless community,</li><li>allow y’all to “think serverless”, and</li><li>make serverless way much fun!</li></ul><h3>We have proof!</h3><p>While developing Sigma, we also wanted to verify that we were doing the right thing, and doing it right. So we bestowed upon two of our fellows, the responsibility to develop two showcase applications using Sigma: a serverless accounting webapp, and a location-based mobile dating app.</p><p>To our great joy, both experiments were successful!</p><p>The accounting app <a href="https://github.com/slappforge/slappbooks">SLAppBook</a> is now <a href="https://slappbooks.slappforge.com/">live for public access</a>. By default it runs against one of our test serverless backends, but you can always <a href="https://github.com/slappforge/slappbooks/blob/master/README.md">deploy the serverless backend project on your own AWS account via Sigma</a> and <a href="https://slappbooks.slappforge.com/settings">point the frontend to your brand new backend</a>, after which you can use it for your own personal use!</p><p>The dating app <a href="https://hotspaces.dating/">HotSpaces</a> is currently undergoing some rad improvements (see, now it’s the frontend that takes time to develop!) and will be out pretty soon!</p><p>So, once again, we have proof that Sigma really rocks it!</p><h3>Far from perfection, but getting there; fast!</h3><p>Needless to say, Sigma is pretty much an infant. It needs quite a lot more — more built-in services, better code suggestions, smarter resource handling, faster builds and deployments, support for other cloud platforms, you name it — before it can be considered “mature”.</p><p>But we are getting there. And we <strong>will</strong> get there. Fast.</p><p>We will publish our roadmap pretty soon, which would include (among other things) adding more AWS services, supporting integration with external APIs/services and, most importantly, expanding to other cloud providers like GCP and MS Azure.</p><p>That’s where we need your help.</p><h3>We need you!</h3><p>Needless to say, you are most welcome to try out Sigma. <a href="https://sigma.slappforge.com/#/signin">Sign up here</a>, if you haven’t already, and start playing around with <a href="https://github.com/slappforge/">our samples</a> (once you are signed in to Sigma, you can directly open them via the <a href="https://sigma.slappforge.com/#/project">projects page</a>). Or, if you feel adventurous, start off with a clean slate, and start building your own serverless application.</p><p>We are continually smoothening the ride, but you may hit a few bumps here and there. Possibly even hard ones. Sometimes even impassable. Maybe none, if you are really lucky.</p><p>Either way, we are eagerly waiting for your feedback. Just write us about anything that came to your mind: a missing functionality, a popular AWS service that you really missed in Sigma (there are hundreds, no doubt!), the next cloud platform you would like Sigma to support; a failed build, a faulty deployment, a nasty error that hogged your browser; or even the slightest of improvements that you would like to see, like a misaligned button, a hard-to-scroll pop-up or a badly-named text label.</p><p>You can either use our <a href="https://www.slappforge.com/contact/">official feedback form</a> or the “Report an Issue” option on the IDE Help menu, post your feedback in our <a href="https://github.com/slappforge/sigma">GitHub issue tracker</a>, or send us a direct email at <a href="/service/mailto:info@slappforge.com">info@slappforge.com</a>.</p><p>If you would like to join hands with us in our forward march, towards a “think serverless” future, drop us an email at <a href="/service/mailto:info@slappforge.com">info@slappforge.com</a> right away.</p><h3>Welcome to Sigma!</h3><p>That’s it; time to <a href="https://sigma.slappforge.com/#/signin">start your journey with Sigma</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48b0fa02ad2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-serverless/sigma-the-new-kid-on-the-serverless-block-48b0fa02ad2b">Sigma: The New Kid on the Serverless Block</a> was originally published in <a href="https://medium.com/think-serverless">Think Serverless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>