<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dror Gensler on Medium]]></title>
        <description><![CDATA[Stories by Dror Gensler on Medium]]></description>
        <link>https://medium.com/@dror_76194?source=rss-3b30128923cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KY_iPKwOoU1Duy_aypbnGg.jpeg</url>
            <title>Stories by Dror Gensler on Medium</title>
            <link>https://medium.com/@dror_76194?source=rss-3b30128923cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:37:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dror_76194/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Digital Birds Fly at Night — Part I: AI Simulation Environment]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/digital-birds-fly-at-night-part-i-ai-simulation-environment-242fac9d67d8?source=rss-3b30128923cb------2"><img src="https://cdn-images-1.medium.com/max/1521/1*YFJUkXCqDqsjWsCdlGlRiw.png" width="1521"></a></p><p class="medium-feed-snippet">In this series, I&#x2019;ll cover my efforts to create an AI piloted fixed-wing aircraft.</p><p class="medium-feed-link"><a href="https://medium.com/data-science/digital-birds-fly-at-night-part-i-ai-simulation-environment-242fac9d67d8?source=rss-3b30128923cb------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/digital-birds-fly-at-night-part-i-ai-simulation-environment-242fac9d67d8?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/242fac9d67d8</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[drones]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[tensorflow]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 08:27:53 GMT</pubDate>
            <atom:updated>2019-08-19T14:06:24.869Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Cracking Bitcoin with Google AutoML Tables & Tensorflow]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/cracking-bitcoin-with-google-automl-tables-tensorflow-fbe3f16ce9b2?source=rss-3b30128923cb------2"><img src="https://cdn-images-1.medium.com/max/901/1*KF15ZJ24cC2vWiIf_WlYBQ.jpeg" width="901"></a></p><p class="medium-feed-snippet">Could Machine Learning mine valid blocks faster than existing methods, and how does Google&#x2019;s AutoML Tables compare to Tensorflow?</p><p class="medium-feed-link"><a href="https://medium.com/data-science/cracking-bitcoin-with-google-automl-tables-tensorflow-fbe3f16ce9b2?source=rss-3b30128923cb------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/cracking-bitcoin-with-google-automl-tables-tensorflow-fbe3f16ce9b2?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbe3f16ce9b2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[tensorflow]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Thu, 13 Jun 2019 06:58:57 GMT</pubDate>
            <atom:updated>2019-06-14T13:22:43.467Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Serverless contact form — Send email with minimal code]]></title>
            <link>https://medium.com/@dror_76194/serverless-contact-form-send-email-with-one-click-and-minimal-code-8020b98004a2?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8020b98004a2</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Thu, 26 Jul 2018 10:09:48 GMT</pubDate>
            <atom:updated>2018-07-26T11:02:44.789Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless is a great way to host back-end functions without the need to deploy and maintain an environment. But sometimes it can be hard to get started and define all required permission.</p><p>Today I’ll show you how to email a contact form using pre-made serverless components from the <a href="https://functionfactory.io/home?ref=med6">FunctionFactory.io</a> library — <br>All it takes is a few clicks and very little code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmZn6RY_X6GInO2zzYjhyQ.png" /></figure><p>We start by creating a new serverless function.<br>Click on the name of the current function we’re editing at the top left to open the editor file selection dropdown (“tutorial” if this is your first time using FF), and select “New”. <br>Now give your function a name, let call it “sendMail”, and select the programming language you’d like to use (we’ll use Python for this tutorial).</p><p>Now lets search the FunctionFactory library for “send email”.<br>The first result is a question which was already answered with an attached serverless component — “drors/aws-SES-send-0.0.2”</p><p>According to the description, this component uses AWS SES to send the email, and requires some parameters be passed to it in order to work, like SES key and password, destination, email subject etc.</p><p>To pass these parameters we will store our secret parameters in our new function and call the “aws-SES-send” from it.</p><p>You can click “Add” next to the “aws-SES-send” component to add the call to our code. If you click “Inspect” you can see which parameters it requires,</p><p>For convenience you can paste the following code into the editor. It define the parameters and calls SES-send :</p><pre>from ff import ffCall</pre><pre>def main(params):</pre><pre># Define AWS SES secrets<br>    params[&#39;ses_user&#39;] = &#39;ABIAJGKJRBR5LXASDADA&#39;<br>    params[&#39;ses_password&#39;] = &#39;AZC3cqHqglP25pFXRmxyDqKFsv97WSDFSVCS&#39;<br>    params[&#39;ses_region&#39;] = &#39;us-east-1&#39;</pre><pre># Define message parameters<br>    params[&#39;ses_from&#39;] = &#39;form@yoursite.com&#39;<br>    params[&#39;ses_to&#39;] = [&#39;<a href="/service/mailto:info@functionfactory.io">info@</a>yoursite.com&#39;]<br>    params[&#39;ses_subject&#39;] = params[&#39;subject&#39;]<br>    params[&#39;ses_body&#39;] = params[&#39;body&#39;]<br>   </pre><pre># use ffCall to invoke a library function, passing it the <br># &quot;params&quot; array we just defined<br>    <br>    params = ffCall(&#39;aws-SES-send&#39;, params)<br>    <br>    return {&#39;result&#39;: &#39;sent&#39;}</pre><p>To be able to execute this function from our website we must make it public.<br>Click “Publish” at the top of the screen and click “Expose”. <br>This will generate a world-facing URL:</p><pre>https://functionfactory.io/api/v1/web/&lt;username&gt;/private/sendMail</pre><p>Now we need a form for the visitor to fill in a “subject” and “body” which will be emailed to us, using our public function URL as the “action”:</p><pre>&lt;form action=&quot;<a href="https://functionfactory.io/api/v1/web/drors/private/sendMail">https://functionfactory.io/api/v1/web/&lt;username&gt;/private/</a>sendMail&quot;<br>method=&quot;POST&quot;&gt;<br>    &lt;label&gt;Subject&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; name=&quot;subject&quot;&gt;&lt;br/&gt;<br>    &lt;label&gt;Body&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; name=&quot;body&quot;&gt;&lt;br/&gt;<br>    &lt;input type=&quot;submit&quot; value=&quot;Send&quot;&gt;<br>    &lt;/form&gt;</pre><p>That’s it! <br>Now when a user clicks “Submit” the subject and body fields he entered will be passed to our “sendMail” function as params,<br>And “sendMail” will add our secret SES key and call “aws-SES-send” to actually send the email.</p><p>In fact, you can even host the form itself as a serverless function:</p><pre>def main(params):<br>      <br>    form = &quot;&quot;&quot;&lt;form action=&quot;<a href="https://functionfactory.io/api/v1/web/drors/private/sendMail">https://functionfactory.io/api/v1/web/drors/private/sendMail</a>&quot;<br>    method=&quot;POST&quot;&gt;<br>    &lt;label&gt;Subject&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; name=&quot;subject&quot;&gt;&lt;br/&gt;<br>    &lt;label&gt;Body&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; name=&quot;body&quot;&gt;&lt;br/&gt;<br>    &lt;input type=&quot;submit&quot; value=&quot;Send&quot;&gt;<br>    &lt;/form&gt;&quot;&quot;&quot;<br>    <br>    return {&#39;body&#39;: form}</pre><p>Save the above code as a new function, then expose it to the world in the “Publish” screen. <br>Now if you browse to the exposed URL you will be presented with the form, no hosting required!</p><p>Hope you enjoyed this read, and check out <a href="https://functionfactory.io/?ref=med6">FunctionFactory.io</a> !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8020b98004a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serving faster, agile serverless web pages]]></title>
            <link>https://medium.com/@dror_76194/serving-faster-agile-serverless-web-pages-9eb2475c4fbd?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eb2475c4fbd</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[functions-as-a-service]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Tue, 10 Jul 2018 21:54:11 GMT</pubDate>
            <atom:updated>2018-07-10T21:54:11.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*JTgZx7eZXwthsDC94Xn9zA.png" /></figure><p>Beyond acting as API endpoints or gluing together back-end services, serverless (FaaS) functions are also capable of serving web pages.</p><p>In this article we will review an alternative method for serving web pages using serverless functions — one that utilizes the asynchronous nature of web applications and a serverless architecture.<br>Apart for accelerating serverless web pages, this approach also enables a new, unique feature which as far as I know is available only in serverless — <br>“dynamic static content”.</p><p>But we’ll get back to this oddity later :) Lets begin with a quick recap:</p><p>In my previous article I created a “<a href="https://medium.com/@dror_76194/creating-a-serverless-db-less-blog-664fe02d03fb">Serverless, DB-less blog</a>”, demonstrating how serverless functions can generate HTML, CSS and Javascript on the fly and serve it to the client.<br>I created individual functions for each resource:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrnA1pVUC7-C2pCDjuH6tg.png" /></figure><p>Then exposed them as a public endpoint using the <a href="https://functionfactory.io/?ref=med5">FunctionFactory.io</a> web interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z17vedmgKoUqz7NFjfwm2w.png" /></figure><p>When a user requested the main index page, the function behind it used Python to generate the required HTML structure.<br>It then went on to call additional functions and append their output to our page template, adding new features — a navbar, and “storage functions” that held and returned the actual content of our blog, one for each post.</p><p>However, preparing the content in this manner has some drawbacks, chief among them the long wait times caused by function cold-start and spin-up times. The user had to wait for the index function to finish, but it wont until each of its “child” functions had returned its output.<br>The result is spin-up times aggregating to unacceptable levels- over 1 second for a simple blog, and it will be much worse should we add more content and components.</p><p>This time we’ll do it right — calling each function independently.<br>You can see the end result here: <br><a href="https://functionfactory.io/api/v1/web/drors/private/modIndex">https://functionfactory.io/api/v1/web/drors/private/modIndex</a></p><p>First I created the main index function:</p><pre>def main(params):<br>    <br>    body = &#39;&#39;&#39;&lt;html&gt;<br>    &lt;head&gt;<br>    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<a href="https://functionfactory.io/api/v1/web/drors/private/modStyle">https://functionfactory.io/api/v1/web/drors/private/modStyle</a>&quot;&gt;<br>    &lt;/head&gt;<br>    <br>    &lt;body&gt;<br>    <br>    &lt;div class=main&gt;<br>    &lt;h1&gt;Hello!&lt;/h1&gt;<br>    &lt;/div&gt;<br>    <br>    &lt;div id=&quot;sidebar&quot;&gt;&lt;/div&gt;<br>    <br>    &lt;script src=&quot;<a href="https://functionfactory.io/api/v1/web/drors/private/modSidebar?sideNavItems=[(\&#39;Home\&#39;,\&#39;https://functionfactory.io/home\&#39;),(\&#39;About\&#39;,\&#39;https://functionfactory.io\&#39;)]">https://functionfactory.io/api/v1/web/drors/private/modSidebar</a>&quot;&gt;<br>    &lt;/script&gt;<br>    <br>    &lt;/body&gt;&lt;/html&gt;&#39;&#39;&#39;<br>    <br>    return {&#39;body&#39;: body}</pre><p>This simple Python function returns plain HTML as as “body”, which the FunctionFactory / OpenWhisk platform sends to the browser as a web page.</p><p>The CSS stylesheet is also a simple function returning static content:</p><pre>def main(params):<br> <br> body = &#39;&#39;&#39;&lt;style&gt;<br>body {<br> font-family: “Lato”, sans-serif;<br>}</pre><pre>.sidenav {<br> height: 100%;<br> width: 160px;<br> position: fixed;<br> z-index: 1;<br> top: 0;<br> left: 0;<br> background-color: #111;<br> overflow-x: hidden;<br> padding-top: 20px;<br>}<br>.<br>.<br>&lt;/style&gt;&#39;&#39;&#39;</pre><pre>return {&#39;body&#39;: body}</pre><p>The sidebar is where things get interesting..<br>We need a way to append the HTML elements served to the browser by the main “modIndex” function. <br>To that end I created &lt;div id=&quot;sidebar&quot;&gt; , an element which will be replaced with the sidebar HTML using document.getElementById(&quot;sidebar&quot;).innerHTML .</p><p>After setting the placeholder div I call the “modSidebar” function which contains both the sidebar content and the replacing script:</p><pre>import ast</pre><pre>def main(params):</pre><pre>    // Prep structure of sidenav<br>    sidenav = &#39;&lt;div class=&quot;sidenav&quot;&gt;&#39;<br>    <br>    // Append sidenav items<br>    defaultItems = &#39;[(&quot;title&quot;,&quot;<a href="https://functionfactory.io/">https://functionfactory.io</a>&quot;)]&#39;<br>    items = params.get(&quot;sideNavItems&quot;, defaultItems)<br>    items = ast.literal_eval(items)<br>    for item in items:<br>        sidenav += &#39;&lt;a href=&quot;&#39;+item[1]+&#39;&quot;&gt;&#39;+item[0]+&#39;&lt;/a&gt;&#39;<br>    sidenav += &#39;&lt;/div&gt;&#39;<br>    <br>    <br>    sidebar = &#39;&#39;&#39;// select the element that will be replaced<br>var el = document.getElementById(&#39;sidebar&#39;);</pre><pre>// Create a new element to place sidebar in<br>var newEl = document.createElement(&#39;p&#39;);</pre><pre>newEl.innerHTML = `&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;</pre><pre>{sidenav}<br>`</pre><pre>// replace el with newEL<br>el.parentNode.replaceChild(newEl, el);<br>&#39;&#39;&#39;.format(sidenav = sidenav)</pre><pre>return {&#39;body&#39;: sidebar}</pre><p>This might seem a bit confusing, but what I’m essentially doing is:<br>a. prep “sidenav” html content using Python<br>b. prep “sidebar” Javascript that will replace the placeholder div in the index<br>c. Place the “sidenav” items into the sidebar innerHTML using Python .format — sort of a “search &amp; replace”.</p><p>Now the output of “modSidebar” function is returned as plain Javascript, which browser will execute and replace the placeholder div with actual sidenav content.</p><p>The browser is oblivious to the fact that the script passed to it with &lt;script src= is actually dynamically generated. It receives the final Javascript.</p><p>And this brings us to the “oddity” — <br>As the above function preps content dynamically, we can actually pass parameters to this script src import to alter the returned Javascript -<br>All I need to do is pass parameters in the src= URL of the script call in the main index function, just like I would to any other API endpoint or URL:</p><pre>&lt;script src=&quot;<a href="https://functionfactory.io/api/v1/web/drors/private/modSidebar?sideNavItems=[(\&#39;Home\&#39;,\&#39;https://functionfactory.io/home\&#39;),(\&#39;About\&#39;,\&#39;https://functionfactory.io\&#39;)]">https://functionfactory.io/api/v1/web/drors/private/modSidebar?sideNavItems=[(\&#39;Home\&#39;,\&#39;https://functionfactory.io/home\&#39;),(\&#39;About\&#39;,\&#39;https://functionfactory.io\&#39;)]</a>&quot;&gt;&lt;/script&gt;</pre><p>This is interesting because it allows us to create “generic” web page components, like our sidebar, and reuse them with different content outputted based on parameters with which they are called.</p><p>With such capability it is possible to share these web components for others to consume, like in the FunctionFactory component library.</p><p>I hope you find this interesting and not too confusing, and like me see the great potential of serving web pages using serverless functions.</p><p>These components are available for consumption and alteration within the <a href="https://functionfactory.io/home">FunctionFactory.io component library</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eb2475c4fbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Serverless, DB-less blog]]></title>
            <link>https://medium.com/@dror_76194/creating-a-serverless-db-less-blog-664fe02d03fb?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/664fe02d03fb</guid>
            <category><![CDATA[function-factories]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 12:12:34 GMT</pubDate>
            <atom:updated>2018-06-11T12:12:34.629Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we’ll be exploring the use of serverless functions<br>Created using <a href="https://functionfactory.io/?ref=med3">FunctionFactory.io</a> to present a web page built from multiple components.</p><p>But also -<br>Serverless functions will act as the storage mechanism for our content.</p><p>Can it be done? it certainly can.<br>Here’s an example of a blog stored and presented entirely by serverless:<br><a href="https://functionfactory.io/api/v1/web/drors/private/ffBlogIndex">Blog Post</a></p><p>Lets see how it’s done…</p><p>Instead of accessing an external database or storage for the page content,<br>We will execute components that act as storage, relieving us of a database or external services.</p><p>First step is to create an index page that will serve as our entrypoint. The index will build the top level html ‘body’,<br>And add to it the output of child serverless components that when executed return html or markdown content.</p><pre>from ff import ffCall</pre><pre>  def main(params):</pre><pre>  # We inject an html sidebar - output of &#39;sidebar&#39; component<br>  body += ffCall(&#39;sidebar&#39;, params)[&#39;body&#39;]</pre><pre>  # sets pages to be imported. these are component names.<br>  # These will be passed to &#39;markdown&#39; - which will convert them to html<br>  posts = [&#39;mdContent&#39;, &#39;mdContent2&#39;]</pre><pre>  # execute markdown converter and inject result to body<br>  for post in posts:<br>  body += ffCall(&#39;markdown&#39;, {&#39;target&#39;: post})[&#39;body&#39;]</pre><pre>  return {&#39;body&#39;: body}</pre><p>While the ‘sidebar’ component returns an html element which is already browser-compatible, The actual post content is stored in ‘mdContent’ in Markdown syntax:</p><pre>def main(params):</pre><pre>return {&#39;body&#39;: &#39;&#39;&#39;<br># Markdown content<br>## Subheader <br>Some text<br>&#39;&#39;&#39;}</pre><p>Therefore, we call on an additional component to convert the markdown text to html elements.<br>For that we use the <a href="https://github.com/showdownjs/showdown">Showdown</a> library.<br>Showdown can be imported client-side with a ‘script src=’ html tag.<br>Our function ‘markdown’ injects both the converting script and text to be converted to the returned html page:</p><pre>from ff import ffCall</pre><pre>def main(params):</pre><pre># execute the text-holding function that was passed as param:<br>etarget = params[&#39;target&#39;]<br>etext = ffCall(etarget, params)[&#39;body&#39;];</pre><pre>body =  &#39;&#39;&#39;&lt;script src=&quot;https://cdn.rawgit.com/showdownjs/showdown/1.8.6/dist/showdown.min.js&quot;&gt;&lt;/script&gt;</pre><pre>            &amp;lt;\div id=&quot;convTarget&quot;&amp;gt;{convText}&amp;lt;\/div&amp;gt;</pre><pre>            &lt;script&gt;<br>                var converter = new showdown.Converter();</pre><pre>                var text = document.getElementById(&quot;convTarget&quot;).innerHTML;<br>                var html = converter.makeHtml(text);</pre><pre>                document.getElementById(&quot;convTarget&quot;).innerHTML = html;</pre><pre>            &lt;/script&gt;&#39;&#39;&#39;.format(<br>                convText = etext<br>            )</pre><pre>return {&#39;body&#39;: body}</pre><h3>Thoughts</h3><p>This demonstration goes to prove serverless functions can be used collectively<br>To generate complete web pages using modular components.</p><p>It further demonstrates the use of serverless functions a storage device rather than a compute action,<br>And though this approach is proved and very easy to maintain<br>As it is very simple to edit storage-functions in-place using the FunctionFactory editor -<br>It still suffers from the cold-start overhead of serverless, and is limited in size by vendors.</p><p>Nice and modular though :)</p><p>I hope you enjoyed this read, and these components will be available soon<br>In the <a href="https://functionfactory.io/home?ref=med3">FunctionFactory serverless component library</a></p><p><em>Originally published at </em><a href="https://functionfactory.io/?ref=med3"><em>functionfactory.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=664fe02d03fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless vs. API Marketplace]]></title>
            <link>https://medium.com/@dror_76194/serverless-vs-api-marketplace-bd6b8b7f22bf?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd6b8b7f22bf</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[openwhisk]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 12:04:52 GMT</pubDate>
            <atom:updated>2018-06-11T12:04:52.911Z</atom:updated>
            <content:encoded><![CDATA[<p>When introducing <a href="https://functionfactory.io/?ref=med2">FunctionFactory</a> — our serverless collaboration platform, people often compare it against various API marketplaces &amp; libraries, asking for my opinion on the differences between the two. Therefore I decided to expand on my previous article — <a href="https://medium.com/@dror_76194/serverless-vs-api-gateway-8d72fcfdaff9">Serverless vs. API Gateway</a> and compare the two. The bottom line is actually very simple -</p><blockquote>Serverless can do APIs, APIs can’t do serverless.</blockquote><p>A broad generalisation, I know. But lets take a deeper look at the differences and limitations of these approaches.</p><h3>Logic</h3><p>The first issue that comes to mind with an API Marketplace is the implementation of logic and flow control of an application. While an API can include multiple methods and deliver diverse results based on inputs provided, it is still essentially a single action being invoked. It is easy to include it as a step in our application, however the conditions leading to the invocation, and utilisation of the response is still up to our application — which is hosted elsewhere.</p><p>In serverless on the other hand an “action” can include application logic. A function can indeed include an API call to an external service (the “lowest hanging fruit” for serverless), but can also prepare the input for said call, operate on the output returned and make a decision to act upon it.</p><p>It’s true that some API Marketplaces facilitate some form of logic (IFTTT comes to mind), however that logic is often limited to a “directional flow” — a single chain of events where one action passes the output to the next, While in serverless we can implement much finer and complex flow — For loops, altering parameters, forking and all other operations which are part of <strong>an actual application flow.</strong></p><h3>Hosting</h3><p>Due to the above, an API Marketplace is usually used in conjunction with an application where logic is held. Said application will need to be hosted somewhere — pushed to production, maintained &amp; monitored.</p><p>Serverless on the other hand allows us to create a self-contained endpoint, that while it may call an external API service, will also handle its output and present to the consumer a “complete solution” — an endpoint that requires no management and is always maintained at perfect health and availability by the platform itself.</p><h3>Complexity</h3><p>True, serverless functions are limited compared to hosted “classical” apps — They are ephemeral, short-lived, and often allow the use of very specific programming languages, libraries and dependencies.</p><p>However compared to an API Marketplace they are much more capable than a simple request, allowing developers to integrate and execute advanced operations and manipulation of inputs in a more true-to-life manner which leads to them acting as production-grade components of an application.</p><p>Furthermore, we’re seeing serverless platform constantly evolving, with some allowing the user to bring his own dependencies, and others (like FunctionFactory) even supporting “black-box” Docker containers — which eliminates the limitations on methods available, allowing users to incorporate any form of computation in their action — be it AI, database integration, or even a dated COBOL binary..</p><h3>Library</h3><p>The one advantage an API Marketplace holds over serverless is the diversity of services offered. Users can browse a list of vendor/community contributed APIs, select one and quickly begin consuming it.</p><p>And that is exactly where <a href="https://functionfactory.io/home?ref=med2">FunctionFactory</a> improves upon serverless — By integrating a function library, a “Serverless Marketplace” if you will, we essentially gain all the features of an API Marketplace, combined with the power and flexibility of serverless.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd6b8b7f22bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Vs. API Gateway]]></title>
            <link>https://medium.com/@dror_76194/serverless-vs-api-gateway-8d72fcfdaff9?source=rss-3b30128923cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d72fcfdaff9</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[openwhisk]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[functions-as-a-service]]></category>
            <dc:creator><![CDATA[Dror Gensler]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 11:56:18 GMT</pubDate>
            <atom:updated>2018-06-11T11:59:34.173Z</atom:updated>
            <content:encoded><![CDATA[<p>A few weeks ago, while explaining the technical aspects of my Serverless startup <a href="https://functionfactory.io/?ref=med1">FunctionFactory.io</a> to a friend, he raised an interesting question-</p><p>“So it’s just like an API Gateway?”</p><p>The question left me stumped for a moment. I have to admit that even though I had a chance to work with both, and am aware of the similarities- I never tried to “draw a line” and determine where the similarities end, which I will try to do in this article.</p><p>Serverless and API Gateways may seem like completely different platforms, so much that one might ask what’s the point comparing the two. But examining their features and behaviour we quickly come to realise they have more in common than you’d think.</p><p>It seems the deciding factor between the two is the specific use-case one has in mind: For tailoring-together existing microservices or adding functionality such as authentication and monitoring to your API it’s likely that a gateway is the right choice. On the other hand if you wish to create new, complex functionality that is triggered upon request (and does not necessarily returns a response i.e batch-processing) — then Serverless might be the best choice.</p><p>It is important to note though that both platforms support similar behaviours — API Gateways can actually execute code functions (usually JS), and Serverless contains an API Gateway to expose functions to the outside world. The features they focus on and their performance are what makes the difference.</p><p>In this article I will use Google’s <strong>Apigee </strong>as an example for an API gateway, and Apache <strong>OpenWhisk</strong> for a Serverless platform. Both of which I had a chance to work with extensively.</p><p>Lets establish a test case which can be achieved with both platforms: Our marketing department uses a shared tweeter account to post messages (oh no.. another Twitter example.. ;) , and rather than sharing the credentials among all team members we opt to create an API Endpoint that validates user-specific permissions, then posts using the shared Tweeter account:</p><pre>curl -X POST <a href="http://company.com/api/twitterPost">http://company.com/api/twitterPost</a> -d ‘{“user”: “dave”, “post”: “Hello!”}’ </pre><p>or</p><pre>curl -X POST http://company.com/api/twitterPost?message=&quot;Hello, world!”</pre><p>Behind the scenes we execute a function that implements Twitter’s API, sending the secret API key or password along with our message.</p><p>In the classic API gateway use-case this function will be performed by a microservice, say a Python Flask app running in Cloud Foundry listening for connections. What the gateway does for us is expose it as a new, simplified endpoint, which proxies requests to the backend. The gateway can also handle authentication freeing our developers from the need to embed it into their app thus allowing the creation of a true microservice.</p><p>Than how does the API gateway perform authentication? in Apigee’s case this is a built-in feature, but behind the scenes it actually executes snippets of code — in a Serverless manner. In fact — Apigee is capable of executing user-created Javascript and Python functions as part of the request flow, therefore it actually contains elements of a Serverless platform.</p><p>In OpenWhisk, we wouldn’t actually need the backend microservice. Serverless allows us to execute code functions on demand. So we would create an “Action” containing the Twitter API secrets, and have the platform invoke it upon request. The advantage here is that our developer doesn’t even need to include an HTTP listener in his code (Flask in our microservice Python example) — He can simply create a “main()” function that gets executed by the platform whenever a request is received.</p><p>But wait, if the code snippet doesn’t handle HTTP who does? There must be a listening service somewhere, and in OpenWhisk that is the embedded API gateway, which receives an HTTP request and triggers a code snippet for us. So in-fact, a Serverless platform requires elements of an API Gateway to function.</p><p>This example outlines the similarities between the platforms, and also their main points of difference: While an API gateway allows us to compose microservices together and handle events like authentication outside our app, it still requires an HTTP listener to be embedded within our code, regardless of how many stops the request makes along the way.</p><p>While in Serverless, our code can be generic. The built in API gateway not only routes traffic between components, but can also translate an HTTP request to parameters that are handed over to our general-purpose code.</p><p>In my opinion the above makes Serverless somewhat superior to a gateway, at least on paper, as it’s a bit more flexible and reduces the backend requirements. However it is important to note that Apigee is very good at what it does and while it can execute simpler functions its response times are much faster than OpenWhisk.. at least for now..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d72fcfdaff9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>