<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kyle Jones</title>
    <description>The latest articles on DEV Community by Kyle Jones (@kerldev).</description>
    <link>https://dev.to/kerldev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F183546%2F583205dc-89fe-44f5-a7fa-7180b5a2f6e3.jpg</url>
      <title>DEV Community: Kyle Jones</title>
      <link>https://dev.to/kerldev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kerldev"/>
    <language>en</language>
    <item>
      <title>How smart cities are helping the public sector reduce emissions</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Wed, 28 Jul 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/kerldev/how-smart-cities-are-helping-the-public-sector-reduce-emissions-17ck</link>
      <guid>https://dev.to/kerldev/how-smart-cities-are-helping-the-public-sector-reduce-emissions-17ck</guid>
      <description>&lt;p&gt;Our global population is exploding, and the latest estimates project it’s set to reach &lt;a href="https://www.un.org/development/desa/en/news/population/world-population-prospects-2019.html"&gt;10 billion by 2050&lt;/a&gt;. This growth of almost 2 billion people will put an even greater demand on our existing resources, including energy. Most of us are also eager to improve our quality of life, which is often done by finding new ways to incorporate technology into our daily lives. However, with growing concern around climate change, these uses for technology need to be more efficient and sustainable. So how do we start to reduce the carbon footprint of a city while improving lives?&lt;/p&gt;

&lt;p&gt;The answer could be in how we build smarter cities for the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are smart cities?
&lt;/h2&gt;

&lt;p&gt;Smart cities are large settlements that are data-driven, using a variety of sensors, analytics and automated processes to streamline traditionally manual services. This means that society and the overall quality of life improves, as less time and effort gets spent on mundane and repetitive tasks.&lt;/p&gt;

&lt;p&gt;Bristol is an example of a city that is innovating in this way in order to reach their target of &lt;a href="https://use.metropolis.org/case-studies/smart-city-bristol#casestudydetail"&gt;reducing CO2 emissions by 40%&lt;/a&gt; through a number of initiatives such as smart metering.&lt;/p&gt;

&lt;p&gt;European cities like Copenhagen are pushing the boundaries through research and development undertaken by a smart cities incubator called the Copenhagen Solutions Lab. The incubator’s current focus is on air quality and the population’s flow along the roads.&lt;/p&gt;

&lt;p&gt;Further afield, cities including Dubai and Singapore are also installing infrastructure and putting revolutionary systems in place, such as autonomous police stations where fines can be paid or incidents can be reported.&lt;/p&gt;

&lt;h2&gt;
  
  
  What technologies power smart cities?
&lt;/h2&gt;

&lt;p&gt;The main requirement for many of the innovations is a fast, reliable internet connection to transmit the data from the sensors. The internet required is supported by the recent introduction and adoption of 5G across the world. 5G networks have lower latency and higher bandwidth, meaning that they provide a faster connection which will undoubtedly become the backbone of the infrastructure behind smart cities.&lt;/p&gt;

&lt;p&gt;Most commonly, the features in smart cities are underpinned by consumer-grade electronics — particularly sensors, the same technology used in most Internet of Things (IoT) devices like Alexa speakers and Philips Hue bulbs. These electronics have exploded in popularity in recent years with the surge in interest in both smart home products and products from manufacturers like Raspberry Pi and Arduino.&lt;/p&gt;

&lt;p&gt;Smart cities will generate more real-time data that can feed forward into other systems. It could also feed into big data analytics alongside existing data sets such as weather or event calendars to gather further insights from the combined information. For example, on a rainy day, analytics could determine whether an increased capacity for public transport is needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What features of smart cities are environmentally friendly?
&lt;/h2&gt;

&lt;p&gt;As technology advances, more and more manual processes have become automated. These advances are visible across all industries — from autonomous vehicles and autopilot systems to robotics used in manufacturing. Similarly, as technology has improved, more data is being produced that can then be fed into analytics services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Energy
&lt;/h3&gt;

&lt;p&gt;The most common example is the adoption of smart utility meters to monitor and forecast usage. The benefits of these smart meters are that they improve the accuracy of their billing systems and empower a more streamlined, tailored support service. Over time, these smart meters will enable the suppliers to predict the required capacity at any given time. Predicting capacity in this way will pave the way for an easier transition to clean energy through evidence-based requirements for energy storage.&lt;/p&gt;

&lt;p&gt;In anticipation of hosting COP26 in 2020, Glasgow began installing &lt;a href="https://futurecity.glasgow.gov.uk/intelligent-street-lighting/"&gt;smart street lighting&lt;/a&gt; in various parts of the city. The installations use motion and noise detection to turn the lights on when triggered. Keeping these lights off when footfall is at its lowest levels saves electricity, lowering the reliance on the power grid while not compromising on safety or security.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transport
&lt;/h3&gt;

&lt;p&gt;Transport is another key area where some cities have made smart, environmentally-friendly changes.&lt;/p&gt;

&lt;p&gt;One example is the 3,000 sensors installed to create &lt;a href="https://www.smartparking.com/latest/case-studies/cardiff-council"&gt;smart parking spaces in Cardiff&lt;/a&gt;. Proximity sensors are installed in the ground beneath the spaces and detect whether that particular parking space is occupied by a vehicle. The status of these spaces is updated in real-time with local street signs and an app updating to inform motorists of the status of the spaces. The accompanying app also allows users to reserve a space in advance. Informing the public that there are little or no parking spaces available encourages commuters to choose more eco-friendly methods of transport like buses or trains.&lt;/p&gt;

&lt;p&gt;Bike-sharing is another example that improves society in many ways such as improving health by empowering exercise, reducing pollution and easing congestion. Hubs are being added to various cities across Europe, with the Welsh Government recently announcing hub additions in Aberystwyth, Barry, Rhyl and Swansea.&lt;/p&gt;

&lt;h3&gt;
  
  
  Waste management
&lt;/h3&gt;

&lt;p&gt;An effort introduced by Leeds Council is the use of &lt;a href="https://www.recyclingwasteworld.co.uk/products/leeds-makes-smart-move-with-smart-bins/116609/"&gt;smart waste and recycling bins&lt;/a&gt;. These bins use sensors to monitor their capacity while solar panels power a compactor inside to improve the utilisation of the limited space. It is possible to monitor the bin’s capacity using an app that also sends notifications when it needs to be emptied. This functionality enables the council to adapt its refuse and recycling collections. Being able to adapt the collections enables a reduction in the number of collection vehicles on the road, which in turn reduces emissions and improves congestion.&lt;/p&gt;

&lt;p&gt;Redcar &amp;amp; Cleveland Borough Council has proposed a similar scheme involving adding RFID tags to household bins that will measure the weight of the contents and frequency of collections. Thinktank Social Market Foundation has theorised that a scheme like this could encourage recycling by enabling councils to provide tax cuts based on the amount of recycling done by a household. This is particularly important to councils across the UK, as the highest recycling rate in England was 64.5% in 2017 but the lowest was just 14.1%.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the barriers faced by the public sector?
&lt;/h2&gt;

&lt;p&gt;There are a handful of main issues with the development of smart cities. Firstly, budget constraints are a major problem due to austerity measures and the perception that smart city infrastructure isn’t a necessary expense.&lt;/p&gt;

&lt;p&gt;Secondly, deployment of these new technologies is slowed by regulation and bureaucracy. The time taken to develop a proposal, wait on the requested funding and then finally implement the solutions means that it can be months or even years before the changes are put in place and the organisation finally sees the dividends from their efforts.&lt;/p&gt;

&lt;p&gt;Finally, the network capability required to effectively handle the new workloads has only recently begun rolling out. 5G networks were first introduced in late 2019, however initial estimates put a majority coverage will take until around 2025.&lt;/p&gt;

&lt;p&gt;Despite these obstacles, more and more of the public sector is adopting smart city technologies and innovating to improve the lives of their citizens. As the availability of the infrastructure and the number of successful case studies grows, the barriers faced are receding — which in turn lowers the overall cost of adoption thanks to the maturity phase of the product life cycle. As efforts to combat climate change gain traction, levelling up our cities to become digital powerhouses will become more prominent — but it’s clear that the seeds for change have already been sown.&lt;/p&gt;

</description>
      <category>technology</category>
    </item>
    <item>
      <title>How can we build more sustainable software?</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Fri, 04 Jun 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/kerldev/how-can-we-build-more-sustainable-software-20ak</link>
      <guid>https://dev.to/kerldev/how-can-we-build-more-sustainable-software-20ak</guid>
      <description>&lt;p&gt;In 2020, Brewdog announced its latest funding round, &lt;a href="https://www.brewdog.com/uk/equityforpunks/tomorrow-raise/welcome"&gt;Equity for Punks Tomorrow&lt;/a&gt;, aiming to push its sustainability efforts even further. No small feat for a company that is already carbon negative. With the funding, they intend to replace their fleet of vehicles with fully electric alternatives, generate renewable energy for a number of their breweries, and a whole lot more.&lt;/p&gt;

&lt;p&gt;But decarbonisation is not exclusively a private-sector trend — and various public-sector organisations are also turning their attention to more climate-friendly practices. Take the case of the Department for Environment, Food and Rural Affairs (DEFRA). In September 2020, DEFRA published &lt;a href="https://www.gov.uk/government/publications/greening-government-ict-and-digital-services-strategy-2020-2025/greening-government-ict-and-digital-services-strategy-2020-2025"&gt;Greening Government&lt;/a&gt;, a policy paper setting out its strategy for providing digital services that are more sustainable.&lt;/p&gt;

&lt;p&gt;This policy is not an isolated case either, with other government departments such as &lt;a href="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/820284/190716_BEIS_Green_Finance_Strategy_Accessible_Final.pdf"&gt;the Treasury&lt;/a&gt; and the &lt;a href="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/739460/road-to-zero.pdf"&gt;Department for Transport&lt;/a&gt; publishing similar papers in recent years.&lt;/p&gt;

&lt;p&gt;As a growing number of industries are turning their attention to climate change and innovating to reduce their impact on the environment, we’re all on a journey to Net Zero — and that includes our tech. But how does software engineering fit into this picture, with the industry so handcuffed to its consumption of resources?&lt;/p&gt;

&lt;h3&gt;
  
  
  What resources are needed to build software?
&lt;/h3&gt;

&lt;p&gt;With data centres already consuming an &lt;a href="https://www.independent.co.uk/climate-change/news/global-warming-data-centres-to-consume-three-times-as-much-energy-in-next-decade-experts-warn-a6830086.html"&gt;estimated 3% of global electricity&lt;/a&gt;, energy is at the core of any discussion on the resources used when developing software. Electricity is used at every step of the software development life cycle — from the design and engineering all the way to deployment and hosting. Every interaction has an associated cost that could be measured in kWh and can therefore also be measured in tonnes of carbon dioxide equivalents (CO₂e).&lt;/p&gt;

&lt;p&gt;When we think about this in real terms, it all adds up. For example, a weekly one-hour meeting on Zoom with 6 participants releases an estimated 0.05kg of CO₂e per meeting. Over the course of a year, that results in the same emissions as driving a petrol car almost 10 miles.&lt;/p&gt;

&lt;p&gt;There is also an indirect impact associated with the hardware required for the software — materials (especially metals and plastics) are required to manufacture the underlying hardware needed for servers and networking devices.&lt;/p&gt;

&lt;p&gt;Finally, many data centres use liquid cooling to alleviate the excess heat produced by the servers, preventing damage to their components. The coolant used for these systems is usually water, a resource that is already scarce for over 3.2 billion people.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can software engineers make greener services?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Migrating to the cloud
&lt;/h3&gt;

&lt;p&gt;Traditional on-premises infrastructure &lt;a href="https://www.nrdc.org/energy/files/data-center-efficiency-assessment-IP.pdf"&gt;only utilises between 12% and 18% of its capacity&lt;/a&gt;, whereas cloud server utilisation is around 65%. This statistic, alongside the fact that cloud customers consume 77% fewer servers means that those same customers &lt;a href="https://aws.amazon.com/blogs/aws/cloud-computing-server-utilization-the-environment/"&gt;reduce their carbon footprint by a whopping 88%&lt;/a&gt;. Cloud infrastructure processed 60% of workloads in 2019, with that figure &lt;a href="https://www.cisco.com/c/en/us/solutions/executive-perspectives/annual-internet-report/index.html"&gt;estimated to hit 94% by the end of 2021&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These statistics mean that the question is no longer whether or not we should migrate to the cloud. Instead, we should consider whether the cloud providers are providing their services in a sustainable manner.&lt;/p&gt;

&lt;p&gt;Each cloud provider approaches sustainability differently — Azure is leading the way in innovating to reduce its impact. Microsoft has &lt;a href="https://azure.microsoft.com/en-us/global-infrastructure/sustainability/#carbon-benefits"&gt;committed to four key environmental targets&lt;/a&gt;, including using 100% renewable energy by 2025. They introduced &lt;a href="https://news.microsoft.com/innovation-stories/datacenter-liquid-cooling/"&gt;liquid immersion cooling&lt;/a&gt; in its data centres to help them reach these lofty targets.&lt;/p&gt;

&lt;p&gt;At AWS, &lt;a href="https://www.aboutamazon.com/news/aws/reducing-water-usage-in-aws-data-centers"&gt;servers use free-air cooling systems&lt;/a&gt; that incorporate reclaimed or recycled water to provide direct evaporative cooling in summer months, ensuring the air is of a low enough temperature to sufficiently cool the infrastructure. Some sites have even installed on-site water treatment systems to reduce their overall water usage footprint.&lt;/p&gt;

&lt;p&gt;Amazon, Microsoft and Google are also purchasing varying quantities of renewable energy from external sources to further reduce their reliance on fossil fuels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adopting serverless architecture
&lt;/h3&gt;

&lt;p&gt;Migrating applications to the cloud is only one piece of the puzzle, however. Adopting a serverless architecture is critical as it enables us to use what is necessary with little-to-no waste. Using a serverless architecture means that your application runs on infrastructure managed by a cloud provider.&lt;/p&gt;

&lt;p&gt;Examples of these types of infrastructure are AWS’ Fargate, Azure’s CosmosDB and GCP’s Cloud Functions. This infrastructure is shared (unless a dedicated host/instance is requested) and billed on usage. Sharing infrastructure means utilisation of the underlying infrastructure is maximised while billing based on usage encourages reduction and optimisation wherever possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optimise your functionality
&lt;/h3&gt;

&lt;p&gt;The final method of reducing the &lt;a href="https://webkit.org/blog/8970/how-web-content-can-affect-power-usage/"&gt;impact your services have on the environment is to optimise&lt;/a&gt;. Optimising the functionality working behind-the-scenes on an application or website, even if it only accounts for a performance boost of a few milliseconds, contributes exponentially when we change our viewpoint. A few additional milliseconds taken when a single piece of functionality is used quickly multiplies when talking about millions of uses and multiple applications that are powering hundreds of products.&lt;/p&gt;

&lt;p&gt;So how can we make websites more energy efficient?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a Dark Mode&lt;/li&gt;
&lt;li&gt;Block bots and web scrapers&lt;/li&gt;
&lt;li&gt;Design to use static content wherever possible&lt;/li&gt;
&lt;li&gt;Implement caching and use a CDN&lt;/li&gt;
&lt;li&gt;Reduce the quantity or size of images and videos&lt;/li&gt;
&lt;li&gt;Reduce the variety of fonts&lt;/li&gt;
&lt;li&gt;Use system fonts where possible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some are even taking things a step further, developing free and open tools that allow users to make sustainability more visible. Examples include the &lt;a href="https://pauldjohnston.medium.com/climate-change-and-seeing-your-cloud-carbon-footprint-4e03c195a799"&gt;Cloud Sustainability Console&lt;/a&gt;, &lt;a href="https://www.thegreenwebfoundation.org/"&gt;green hosting checks&lt;/a&gt; and &lt;a href="https://www.websitecarbon.com/"&gt;carbon footprint calculators&lt;/a&gt; for websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  How can non-technical teams help?
&lt;/h3&gt;

&lt;p&gt;Other teams can reduce a company’s impact in several ways. They can contribute indirectly by setting sustainability targets and monitoring how the business adheres to these targets. Microsoft has built a &lt;a href="https://appsource.microsoft.com/en-GB/product/power-bi/coi-sustainability.sustainability_dashboard"&gt;Sustainability Calculator&lt;/a&gt; to make monitoring and reporting progress towards environmental targets easier for their customers.&lt;/p&gt;

&lt;p&gt;They can also impact the company’s carbon footprint more directly. Organisations must empower their teams to participate in actions that, although small, all add up, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Car sharing&lt;/li&gt;
&lt;li&gt;Cycle to Work schemes&lt;/li&gt;
&lt;li&gt;Recycling bins in office spaces&lt;/li&gt;
&lt;li&gt;Sustainable suppliers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Net Zero is no small feat for any industry or geography. We all have to take whatever small steps we can to wean ourselves off wasteful, carbon-emitting processes. These small steps can then grow exponentially into visibly significant changes. This is particularly difficult for any industries that have become accustomed to a particular way of working, of which software engineering is far from alone.&lt;/p&gt;

</description>
      <category>technology</category>
    </item>
    <item>
      <title>How Can We Identify Emerging Influencers Using Machine Learning?</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Tue, 13 Apr 2021 07:53:29 +0000</pubDate>
      <link>https://dev.to/kerldev/how-can-we-identify-emerging-influencers-using-machine-learning-2eei</link>
      <guid>https://dev.to/kerldev/how-can-we-identify-emerging-influencers-using-machine-learning-2eei</guid>
      <description>&lt;p&gt;In the age of social media more than ever, marketing teams are turning to influencers to advertise their new, innovative products or services. The number of followers, impressions and engagements all impact traffic, which in turn helps drive one very important metric - sales. This makes the ability to identify the next up-and-coming influencer all the more important and valuable, with 61% of marketers agreeing that it’s difficult to find the right influencers for a campaign.&lt;/p&gt;

&lt;p&gt;Influencer marketing is an industry that has seen rapid growth over the past few years with an increase between 40 and 50 percent year on year, according to &lt;a href="https://influencermarketinghub.com/influencer-marketing-benchmark-report-2020/" rel="noopener noreferrer"&gt;Influencer Marketing Hub&lt;/a&gt;. It allows companies to increase brand awareness and trust through directly interacting with their target audience in a way never seen before in other strands of marketing.&lt;/p&gt;

&lt;p&gt;Take &lt;a href="https://www.gymshark.com/" rel="noopener noreferrer"&gt;Gymshark&lt;/a&gt;, recently valued at £1.3bn, this fitness clothing brand was one of the earliest adopters of the influencer marketing model. They are renowned for marketing products through their community of Instagram influencers and YouTubers, with their success being a testament to the importance of influencer marketing, showing that when done right it can be a key driver to exponential growth. &lt;/p&gt;

&lt;p&gt;As an industry, influencer marketing is expected to hit &lt;a href="https://digitalmarketinginstitute.com/en-gb/blog/20-influencer-marketing-statistics-that-will-surprise-you" rel="noopener noreferrer"&gt;$10bn in 2020&lt;/a&gt;, growing enormously from just $3bn in 2017. Increasingly companies are valuing the involvement of influencers in their marketing, so it is now more important than ever to be able to identify emerging influencers and those with the most potential to drive success for a brand. &lt;/p&gt;

&lt;h2&gt;
  
  
  So what makes an influencer?
&lt;/h2&gt;

&lt;p&gt;The most obvious type of influencer are celebrities - individuals with large numbers of followers who are often idolized. Similarly, other types of influencers include industry experts, thought leaders and bloggers.&lt;br&gt;
These categories, although relatively vague terms, all have some similar traits that provide us with some insight on what features to look for when trying to identify the next big influencer.&lt;br&gt;
Common traits in these categories are that the individuals often have a sizable audience that they engage with through some kind of platform, and in most cases, they are individuals who talk about topics in a particular niche. For example, Andrew Ng could be considered an influencer due to his sizeable audience on Twitter, where he regularly posts about machine learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we quantify influence?
&lt;/h2&gt;

&lt;p&gt;As with a large amount of machine learning problems, being able to express a complex idea like influence is paramount to identifying trends. In the context of social media, there are three main types of data we can use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Number of Followers&lt;/li&gt;
&lt;li&gt;Number of Impressions&lt;/li&gt;
&lt;li&gt;Engagements&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The number of followers and impressions, when measured over time, gives us an idea of the reach of the potential influencer. Engagements then give us information about how the individual is able to convert that reach, giving us insight into how likely the users that are viewing the posts are to be motivated into doing a particular thing, such as purchasing a product.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we predict an emerging influencer?
&lt;/h2&gt;

&lt;p&gt;A &lt;a href="http://cs229.stanford.edu/proj2014/Ruishan%20Liu,%20Yang%20Zhao,%20Liuyu%20Zhou,%20Predict%20Influencers%20in%20the%20Social%20Network.pdf" rel="noopener noreferrer"&gt;paper published by students at Stanford University&lt;/a&gt; discusses a potential solution, while Kaggle (a website which hosts data science and machine learning competitions) &lt;a href="https://www.kaggle.com/c/predict-who-is-more-influential-in-a-social-network" rel="noopener noreferrer"&gt;has several others&lt;/a&gt;. Kaggle's most effective entry makes use of a Bayesian Optimized Light Gradient Boosted Machine that is trained using data that compares two individual's social media statistics, including those discussed above. Bayesian optimization is a process that allows us to fine-tune hyper-parameters for a machine learning model. &lt;a href="https://medium.com/@pushkarmandot/https-medium-com-pushkarmandot-what-is-lightgbm-how-to-implement-it-how-to-fine-tune-the-parameters-60347819b7fc" rel="noopener noreferrer"&gt;LightGBM is a relatively new gradient boosting framework that uses tree-based learning&lt;/a&gt; and differs from other tree-based algorithms in that the tree grows vertically (leaf-wise) rather than horizontally (level-wise).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvin1i38uvgurnkw6vgv9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvin1i38uvgurnkw6vgv9.jpg" title="Illustration of Leaf-wise Growth" alt="Diagram Illustrating Leaf-wise Tree Growth"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73mrqryvmwh8je7b2r4m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73mrqryvmwh8je7b2r4m.jpg" title="Illustration of Level-wise Growth" alt="Diagram Illustrating Level-wise Tree Growth"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some advantages of LightGBM is that it is fast, requires a lower amount of memory and supports GPU learning, however, it is quite sensitive to overtraining. In this implementation, the LightGBM manages to correctly identify which of the two individuals are the most influential with around 87% accuracy, making this model ideal for assisting in deciding between a relatively low number of potential influencers. However, despite this being one of the most accurate machine learning solutions for this problem, it is held back by the need for a large amount of curated data in order to be effective. This means that access to a large volume of user data needs to be accessed via an API or by web scraping, before then pre-processing the data into a given format to be used by the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can we do to improve the implementation?
&lt;/h2&gt;

&lt;p&gt;The difficulty in quantifying influence is that these values better describe an individual’s reach rather than their influence. However, we could also use Natural Language Processing techniques such as sentiment analysis, named entity recognition and document classification to analyse the post itself, along with the text-based engagements. This would give us a better understanding of what topics and what type of posts get a better reach as well as which of these garner the most positive interactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you decide if the influencer you’ve predicted is right for you?
&lt;/h2&gt;

&lt;p&gt;Even with the work mentioned above, the influencer may not necessarily be the right fit for the strategy you have in mind. In order to build brand awareness or to increase a social following, you might need to choose a macro-influencer, whereas to reach an ideal audience a micro-influencer might be a better choice. The relevancy of the influencer's usual posts and the quality of the post could also contribute to choosing a different influencer.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Conduct a Constructive Code Review</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Tue, 16 Mar 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/kerldev/how-to-conduct-a-constructive-code-review-2kg3</link>
      <guid>https://dev.to/kerldev/how-to-conduct-a-constructive-code-review-2kg3</guid>
      <description>&lt;p&gt;Many businesses have a dedicated software engineering department, whether to maintain a website or develop apps. The majority of these departments will perform code reviews as part of their daily routine. But what’s the difference between a negative experience and a constructive review?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a code review?
&lt;/h2&gt;

&lt;p&gt;A code review is a common practice in software engineering that aims to ensure the quality of an implementation is maintained by having the author’s work examined by one or more of their peers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where should you start with a code review?
&lt;/h2&gt;

&lt;p&gt;Productive code reviews should always start with two elements: the ticket for the issue and any test files in the change request. The ticket will include an overview of the scenario and any further information required for the review, such as designs or non-technical considerations. These help to understand the context behind the work. The test files detail the various scenarios and outcomes that the functional changes are hoping to solve and achieve, giving the reviewer a better understanding of the problem and the proposed solution. When reviewing the test files (and later on the functional code itself), it is essential to consider any edge cases that may have gotten overlooked. These edge cases may seem insignificant but could result in a service outage due to unexpected behaviour. Following on from these, the reviewer should turn their attention towards the files with the most changes in them. These files are likely to be the core of the implementation and therefore saves time when reviewing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How should you conduct the code review?
&lt;/h2&gt;

&lt;p&gt;A constructive code review is often tough to achieve. Teams and individuals will often only identify the problems with the change request. Some will even solutionise after spotting a potential issue. The pitfall that many forget is that a review is an evaluation of both the strong and weak points. Not many reviewers praise the positives of an implementation, even when a solution is elegant or when edge cases are addressed. As mentioned above, some reviewers will identify a problem and proceed to solutionise. Solutionising is the responsibility of the author of the change and not the reviewer. Reviewers that solutionise squander time when it could be spent on other problems while also demotivating the author. Many software engineers thrive on the problem-solving element of their work and would prefer to do this themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the finer things?
&lt;/h2&gt;

&lt;p&gt;The reviewer should also avoid demanding that trivial changes are made before approving the work. Identifying issues such as spelling mistakes, poor naming &amp;amp; micro-optimizations are useful as they affect the code quality. However, concerns like these should be noted and fixed in a follow-up change — the purpose of a change request is to improve the overall product and codebase, so it doesn’t necessarily have to be perfect on the first iteration. When reviewing a change request, pay attention to the finer details like file paths and names referenced in the code. These are easily overlooked, particularly during refactoring, but will break the feature if they are not correct. Similarly, with any resources or files referenced, confirm that these are in the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you do the review?
&lt;/h2&gt;

&lt;p&gt;Many engineers are reluctant to carry out code reviews because of the need to context switch. To avoid unnecessarily context switching, conduct code reviews before or after another unavoidable context switch such as a break or meeting. Doing so provides the reviewer with a choice of regular but flexible times to conduct reviews. Despite the focus on flexibility, code reviews should not stagnate for more than a day. The velocity of the team is more important than the velocity of the individual. It’s easy for multiple reviews to stack up and begin to block other engineers or tickets.&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>programming</category>
      <category>branches</category>
      <category>git</category>
    </item>
    <item>
      <title>How to Perform a Successful Incident Postmortem</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Tue, 16 Feb 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/kerldev/how-to-perform-a-successful-incident-postmortem-1e7a</link>
      <guid>https://dev.to/kerldev/how-to-perform-a-successful-incident-postmortem-1e7a</guid>
      <description>&lt;p&gt;When growing a business from a startup to a large enterprise, it's software systems also expand in complexity, meaning that encountering incidents is inevitable. These incidents have indirect costs that can include loss of trust in the product or brand. However, incidents occurring are not necessarily a bad thing - it provides the business with new learning opportunities and the chance to improve its operational practices. But how do we learn from such a failure?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a postmortem?
&lt;/h2&gt;

&lt;p&gt;An incident postmortem is a meeting that brings together all of the people that were involved, whether directly or indirectly, to discuss, document and derive value. Postmortems should remain positive to avoid demotivating the technical teams further. Postmortems should also be blameless - this empowers engineers to provide details of their contribution and prevents the establishment of a fear culture. Learning should be the focus rather than dwelling on what went wrong, and so any past tense discussions should stick to facts instead of opinions - avoiding phrases that include would have, could have or should have is essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should get invites?
&lt;/h2&gt;

&lt;p&gt;A variety of different stakeholders should get invites to the postmortem, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Individuals/Teams that First Logged the Incident&lt;/li&gt;
&lt;li&gt;Individuals/Teams that Responded to the Incident&lt;/li&gt;
&lt;li&gt;Individuals/Teams that Diagnosed the Issue(s)&lt;/li&gt;
&lt;li&gt;Individuals/Teams that Rectified the Issue(s) It may also be appropriate to invite a user that was directly affected by the incident. Invite a range of different people like this maintains transparency and allows us to glean as much information as possible to document.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What should get documented?
&lt;/h2&gt;

&lt;p&gt;Thorough documentation of the event is vital. Memories are short, and in time important details fade into obscurity. Some key facts to document are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Date and Time that the Incident Started&lt;/li&gt;
&lt;li&gt;Date and Time that the Incident was First Logged&lt;/li&gt;
&lt;li&gt;Which Teams/Individuals Responded to the Incident&lt;/li&gt;
&lt;li&gt;Number of Users/Accounts Affected&lt;/li&gt;
&lt;li&gt;Number of Support Requests Raised&lt;/li&gt;
&lt;li&gt;Date and Time that the Incident was Fixed&lt;/li&gt;
&lt;li&gt;Any Solutions or Mitigations In addition to the above details getting recorded in a postmortem document, the meeting should also have minutes taken, and a timeline of the incident constructed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What should you do after the postmortem?
&lt;/h2&gt;

&lt;p&gt;The postmortem produces discussion points to bring into further sessions and documentation that will prove valuable in the future. Values recorded should be compared against any service level agreements (&lt;a href="https://www.atlassian.com/itsm/service-request-management/slas"&gt;SLAs&lt;/a&gt;) that may be in place, to confirm that the incident did not result in any breaches. Any issues identified as a result of the incident should be discussed in-depth, with potential solutions or mitigations planned into the roadmap, alongside rigid delivery dates. These solutions/mitigations should have tickets written to capture the work, each of which should be &lt;a href="https://www.atlassian.com/blog/productivity/how-to-write-smart-goals"&gt;SMART&lt;/a&gt;. Depending on the incident, particularly regarding who first logged the incident and how long it had been ongoing before being logged, improvements to the observability may be required. Observability improvements should be a priority alongside immediate solutions to the faults.&lt;/p&gt;

&lt;p&gt;If an external user reported the issue, it might be pertinent to publish the postmortem's findings openly, allowing anyone access. Publishing postmortem outcomes publicly has most &lt;a href="https://monzo.com/blog/2019/09/08/why-monzo-wasnt-working-on-july-29th"&gt;notably been utilised by Monzo&lt;/a&gt;. It enables them to maintain transparency, ensures accountability as a business and has provided their users with greater trust in the brand.&lt;/p&gt;

</description>
      <category>outage</category>
      <category>career</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How Hacktoberfest and Open-Source Software are Driving Innovation</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Mon, 01 Feb 2021 20:28:35 +0000</pubDate>
      <link>https://dev.to/kerldev/how-hacktoberfest-and-open-source-software-are-driving-innovation-4m4m</link>
      <guid>https://dev.to/kerldev/how-hacktoberfest-and-open-source-software-are-driving-innovation-4m4m</guid>
      <description>&lt;p&gt;Business landscapes around the world are constantly evolving, with every organisation clambering to innovate so that they can better react to the changing conditions in which they exist and uncover new opportunities to help them to drive their growth and profits. But in a world where true innovation is scarce and many companies resort to rehashing the same ideas, how do you foster an environment that cultivates ideation?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open-source?
&lt;/h2&gt;

&lt;p&gt;Open-source software has seen its fair share of innovative languages, tools, frameworks and products in recent years. Some notable examples include &lt;a href="https://www.docker.com/"&gt;Docker&lt;/a&gt;, &lt;a href="https://kubernetes.io/"&gt;Kubernetes&lt;/a&gt;, &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt;, &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt; and &lt;a href="https://www.elastic.co/elasticsearch/"&gt;Elasticsearch&lt;/a&gt; - not to mention numerous machine learning frameworks like &lt;a href="https://www.tensorflow.org/"&gt;Tensorflow&lt;/a&gt;. The most interesting element of this growth is the fact that a number of these open-source products and tools are generating revenue like regular software development companies that do not openly publish their source code, often through hybrid licensing or hosting. The industry as a whole is already estimated to be worth over $20bn and is expected to continue growing to reach around &lt;a href="https://www.statista.com/statistics/270805/projected-revenue-of-open-source-software-since-2008/#statisticContainer"&gt;$33bn by 2022&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In 2014, &lt;a href="https://do.co"&gt;Digital Ocean&lt;/a&gt; unveiled its first open-source hackathon, &lt;a href="https://hacktoberfest.digitalocean.com/"&gt;Hacktoberfest&lt;/a&gt;. The requirements have changed over the years but the core message has stayed the same: several contributions to public code repositories that positively impact the projects earn you a limited edition t-shirt and some stickers. Fast forward to 2020 and Hacktoberfest has grown to become a juggernaut that drives the open-source community to new heights year after year. Key metrics for the event have soared, from &lt;a href="https://www.digitalocean.com/blog/looking-back-at-hacktoberfest/"&gt;768 participants in their first year&lt;/a&gt; to a whopping &lt;a href="https://hacktoberfest.digitalocean.com/"&gt;61,871 completing the challenge in 2019&lt;/a&gt; - an impressive growth of over 8,000 percent! But why has this explosive growth happened, and how does it affect businesses?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why has this explosive growth happened?
&lt;/h2&gt;

&lt;p&gt;Both open-source software and hackathons encourage collaboration between a number of skilled individuals, often rallying them around a single goal. This leads to a positive environment for a number of like-minded people to bounce ideas for new features (or even whole new products) off each other. In the case of hackathons, people are also motivated by the prospect of a reward or prize. Hacktoberfest’s offering of merchandise in return for contributions is part marketing campaign and part motivator, encouraging participation and contributions to both the event and the wider open-source community. This amalgamation motivates by fulfilling a number of elements from &lt;a href="https://www.thoughtco.com/maslows-hierarchy-of-needs-4582571"&gt;Maslow’s Hierarchy of Needs&lt;/a&gt;, fostering a sense of esteem and belonging amongst contributors, as well as also providing them with clothing and shared knowledge in return.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it affect businesses?
&lt;/h2&gt;

&lt;p&gt;Over the years, a variety of well-known companies have contributed to, sponsored and supported Hacktoberfest, with notable examples ranging from &lt;a href="https://www.indeed.co.uk/"&gt;Indeed&lt;/a&gt; to &lt;a href="https://twilio.com/"&gt;Twilio&lt;/a&gt; to &lt;a href="https://auth0.com/"&gt;Auth0&lt;/a&gt;. A handful of these, including Indeed and &lt;a href="https://sendgrid.com/"&gt;SendGrid&lt;/a&gt; (which has recently been acquired by Twilio), have published papers and talks discussing their takeaways and the associated statistics from their participation in Hacktoberfest.&lt;/p&gt;

&lt;p&gt;Companies participating in Hacktoberfest have seen the participation in their projects increase in recent years, helping to accelerate their product development. &lt;a href="https://umbraco.com/blog/pr-team-update-november-2019-hacktoberfest-round-up/"&gt;Umbraco recorded a growth of 40%&lt;/a&gt; in participation between 2018 and 2019, with the total number of pull requests in 2019 coming in at 436. Most recently, Indeed &lt;a href="https://www.youtube.com/watch?v=uweScYvtUts&amp;amp;feature=youtu.be"&gt;talked about the statistics from their internal Hacktoberfest events at DevRelCon Earth 2020&lt;/a&gt;. Between 2018 and 2019, they recorded an increase of 1,322 contributions and 170 pull requests. &lt;a href="https://sendgrid.com/wp-content/uploads/pdf/SendGrid-Hacktoberfest.pdf"&gt;SendGrid&lt;/a&gt; saw the number of pull requests increase from 43 in 2016 to 1,249 in 2017, with over 1,000 of those being changes to source code. These pull requests equated to 1,385 story points of effort (around 3.4 years of work!).&lt;/p&gt;

&lt;p&gt;Innovation is vital in a highly competitive world, with each organisation scrambling to stay one step ahead of their competitors. Companies that participate in open-source hackathons and Hacktoberfest create a culture of innovation and are seeing dividends in the form of increased development velocity. Failing to iterate and innovate means that a business’ products or services can start to stagnate, which can be catastrophic in fast-changing markets. Cultivating and encouraging horizon scanning, ideation and iteration are fundamental to survival in the modern world of business.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>How to Reduce the Chances of an Outage</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Mon, 25 Jan 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/kerldev/how-to-reduce-the-chances-of-an-outage-4142</link>
      <guid>https://dev.to/kerldev/how-to-reduce-the-chances-of-an-outage-4142</guid>
      <description>&lt;p&gt;The popular messaging service &lt;a href="https://slack.com"&gt;Slack&lt;/a&gt; recently experienced a &lt;a href="https://status.slack.com/2021-01-04"&gt;global outage which impacted millions of users&lt;/a&gt;, the majority of which were individuals working from home or remote learning due to the Coronavirus pandemic. The outage lasted for an extended period, potentially impacting their service level agreements (SLAs), impacts the brand while coming hot on the heels of the &lt;a href="https://slack.com/intl/en-gb/blog/news/salesforce-signs-definitive-agreement-to-acquire-slack"&gt;announcement of their $27.7 billion acquisition&lt;/a&gt; by &lt;a href="https://www.salesforce.com"&gt;Salesforce&lt;/a&gt;. Outages like the one Slack experienced are increasingly common in a technology focused society, so how do we avoid costly issues like this?&lt;/p&gt;

&lt;h2&gt;
  
  
  What causes an outage?
&lt;/h2&gt;

&lt;p&gt;An outage (also known as downtime) is a period of time when a given service or system is unavailable, failing to provide and perform it's primary functionality. Completely removing the possibility of experiencing an outage is almost impossible, however there are a number of ways in which the odds of an outage can be significantly reduced. Some of the things that can be done to try and avoid an incident are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Horizontal Scaling&lt;/li&gt;
&lt;li&gt;Chaos Engineering&lt;/li&gt;
&lt;li&gt;Resiliency Improvements to the Software&lt;/li&gt;
&lt;li&gt;Improving Observability&lt;/li&gt;
&lt;li&gt;Improving Processes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What testing should be carried out?
&lt;/h2&gt;

&lt;p&gt;Having a high test coverage is only part of the story when it comes to testing an application's robustness - a high unit test coverage can be deceiving as this simply proves that the software functions as expected, in isolation. Unit testing should be combined with other forms of testing including integration testing, security testing and performance testing (which should also cover various subtypes such as load testing and stress testing). Including a wider array of testing types ensures that both the functional and non-functional factors that could impact the overall system are being checked under various conditions that could occur in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is horizontal scaling?
&lt;/h2&gt;

&lt;p&gt;Horizontal scaling improves the application's stability and robustness, but simply means that each component in the system can increase it's capacity by adding more instances. For example, a simple CRUD application that uses &lt;a href="https://aws.amazon.com/rds/?nc2=h_ql_prod_db_rds"&gt;RDS&lt;/a&gt; in &lt;a href="https://aws.amazon.com"&gt;AWS&lt;/a&gt; might horizontally scale by adding additional &lt;a href="https://www.mysql.com"&gt;MySQL&lt;/a&gt; RDS instances as read replicas in multiple availability zones (AZs).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is chaos engineering?
&lt;/h2&gt;

&lt;p&gt;Chaos engineering is a form of resiliency testing &lt;a href="https://netflixtechblog.com/5-lessons-weve-learned-using-aws-1f2a28588e4c"&gt;created by Netflix&lt;/a&gt; when they built their &lt;a href="https://netflix.github.io/chaosmonkey/"&gt;Chaos Monkey&lt;/a&gt; application, and functions by turning off random components in their architecture to simulate outages for particular services. This aided Netflix in their migration to a cloud hosted infrastructure by allowing them to identify potential pitfalls, particularly by finding dependencies that, when removed, would have caused incidents in a production environment. Doing this regularly in a non-production environment allowed these incidents to occur in a controlled environment that does not impact customers, mitigating the potential impact to the business.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we improve resiliency?
&lt;/h2&gt;

&lt;p&gt;There are a number of resiliency improvements that can be made to an application in order to reduce the chances of it causing or intensifying an outage. Some simple improvements can include adding an &lt;a href="https://dzone.com/articles/understanding-retry-pattern-with-exponential-back"&gt;exponential backoff retry strategy to calls to other services, building circuit breaker&lt;/a&gt; functionality into the system and &lt;a href="https://aws.amazon.com/message-queue/benefits/"&gt;implementing queues&lt;/a&gt; between services in order to provide a smoother, more consistent throughput to the service. Implementing queues also brings with it the advantage of assisting in decoupling the components from each other, meaning that each part of the system is more independent and has fewer dependencies. These strategies can also help to reduce load and enhance the fault tolerance of the application, both of which result in a higher level of resiliency.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about observability?
&lt;/h2&gt;

&lt;p&gt;Successful deployment of a component is only part of the story. Many deployments appear successful at first before running into issues due to use of resources such as memory, an unexpected failure that occurs irregularly or even security issues that are not at first apparent. These reasons are why observability is incredibly important as logs, metrics and traces allow you to continually monitor your system as well as notifying your technical team when a component begins to show signs of an underlying problem using alerts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What processes should be in place?
&lt;/h2&gt;

&lt;p&gt;Good processes should underpin the entire engineering practice and ensure that human error is avoided or that any incidents that occur are recitified swiftly. Code reviews should be carried out to mitigate as many potential issues as possible, whereas processes like on-call policies and incident post-mortems foster a culture of continually iterating and learning from mistakes when they do occur.&lt;/p&gt;

&lt;p&gt;While these methods do not necessarily prevent outages, they are strong foundations when it comes to reducing the odds of an incident occurring and it causing a total outage. These incidents are rare, but when they do occur they can prove costly to an organisation and preparation should be in place to minimise these costs and the chances of such an occurrence.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>architecture</category>
      <category>cloud</category>
    </item>
    <item>
      <title>A Deep Dive into AWS Firecracker</title>
      <dc:creator>Kyle Jones</dc:creator>
      <pubDate>Thu, 02 Apr 2020 13:28:06 +0000</pubDate>
      <link>https://dev.to/kerldev/a-deep-dive-into-aws-firecracker-4o32</link>
      <guid>https://dev.to/kerldev/a-deep-dive-into-aws-firecracker-4o32</guid>
      <description>&lt;p&gt;Firecracker is a Virtual Machine Monitor, written in &lt;a href="https://www.rust-lang.org/"&gt;Rust&lt;/a&gt; that Amazon Web Services use to power it's Serverless Compute services - &lt;a href="https://aws.amazon.com/lambda/"&gt;Lambda&lt;/a&gt; and &lt;a href="https://aws.amazon.com/fargate/"&gt;Fargate&lt;/a&gt;. Firecracker makes use of Linux's &lt;a href="https://www.linux-kvm.org/page/Main_Page"&gt;Kernel-based Virtual Machine&lt;/a&gt; virtualisation infrastructure to provide its products with MicroVMs.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's the Point?
&lt;/h1&gt;

&lt;p&gt;The development of Firecracker was undertaken to meet several objectives. These were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To run thousands of functions (up to 8000) on a single machine with minimal wasted resources.&lt;/li&gt;
&lt;li&gt;To allow thousands of functions to run on the same hardware, protected against a variety of risks including security vulnerabilities, such as side-channel attacks like &lt;a href="https://meltdownattack.com/"&gt;Spectre&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To perform similarly to running natively, with no impact from the consumption of resources by other functions, retaining the possibility of over committing resources while providing functions with only the resources it needs.&lt;/li&gt;
&lt;li&gt;To be able to start new and clean up old functions quickly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  So How Does It Work?
&lt;/h1&gt;

&lt;p&gt;The invoke traffic gets delivered via the Invoke REST API, which authenticates requests, checks for authorization and then loads the function metadata.&lt;/p&gt;

&lt;p&gt;The requests are then handled by the Worker Manager, which sticky-routes to as few workers as possible to improve cache locality, enable connection re-use and amortize the cost of moving and loading customer code. Once the Worker Manager has identified which worker should run the code, it advises the Invoke service, cutting down on round-trips by having it send the payload directly to the worker.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zKrpb3Qe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ueww1nwryfziewcby3q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zKrpb3Qe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ueww1nwryfziewcby3q.jpg" alt="Architectural diagram showing that the Frontend sends data directly to the Workers." width="285" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each worker potentially offers thousands of MicroVMs, each providing a single slot and Firecracker process, with each slot only ever used for a single concurrent invocation of a function, but many serial invocations. Each slot supplies a pre-loaded execution environment for a function, including a minimized Linux kernel, userland and a shim control process. This method is like that offered by &lt;a href="https://www.qemu.org/"&gt;QEMU&lt;/a&gt;, &lt;a href="https://grapheneproject.io/"&gt;Graphene&lt;/a&gt;, &lt;a href="https://cloud.google.com/blog/products/gcp/open-sourcing-gvisor-a-sandboxed-container-runtime"&gt;gVisor&lt;/a&gt; and &lt;a href="https://www.microsoft.com/en-us/research/project/drawbridge/"&gt;Drawbridge&lt;/a&gt; (and by extension, &lt;a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/bascule_eurosys13.pdf"&gt;Bascule&lt;/a&gt;) in that they provide some of the operating system functionality within the userspace to reduce the kernel surface and so improve security. On serial invocations, the MicroVM and the process the function runs in are re-used.&lt;/p&gt;

&lt;p&gt;If a slot is available, the Worker Manager performs a lightweight concurrency control protocol and informs the front-end that the slot is available for utilization. The front-end then calls the MicroManager with the details of the slot and payload, which is then passed onto the shim running inside the MicroVM for that slot. The MicroManager keeps a small pool of pre-booted MicroVMs ready to be used, as the already fast 125ms boot-up time offered by Firecracker is still not fast enough for the scale-up path of Lambda. Upon completion, the MicroManager gets given either a response payload, or the details of an error which are then returned to the front-end.&lt;/p&gt;

&lt;p&gt;However, if no slots are available, the Worker Manager calls the Placement service to request that a new slot gets created for the function. This service then optimizes the process (taking less than 20ms on average), ensuring that the use of resources such as CPU is even across the fleet, before requesting that a particular worker generates a new slot. To reduce blocking of user requests, the MicroManager keeps a small pool of pre-booted MicroVMs ready to be used when requested by the Placement service.&lt;/p&gt;

&lt;p&gt;For each MicroVM, the Firecracker process handles creating and managing the MicroVM, providing device emulation and handling VM exits. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CaxZ9vpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ya5m2bisdtoz1dwg9lv8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CaxZ9vpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ya5m2bisdtoz1dwg9lv8.jpg" alt="Diagram showing the overall architecture of the Lambda Worker." width="356" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The shim process communicates through the MicroVM boundary using a TCP/IP socket with the MicroManager - a process that manages a single worker's Firecracker processes. The MicroManager provides slot management and locking APIs to the Placement service and an invoke API to the front-end.&lt;/p&gt;

&lt;p&gt;As an extra level of security against unwanted behaviour (including code injection), a jailer implements a wrapper around Firecracker which puts it in a restrictive sandbox before booting the guest.&lt;/p&gt;

&lt;p&gt;Further Reading - &lt;a href="https://www.usenix.org/system/files/nsdi20-paper-agache.pdf"&gt;Firecracker: Lightweight Virtualization&lt;br&gt;
for Serverless Applications&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>serverless</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
