每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,歡迎關注開源日報。交流QQ群:202790710;微博:https://weibo.com/openingsource;電報群 https://t.me/OpeningSourceOrg


今日推薦開源項目:《React 基本庫 libreact》傳送門:GitHub鏈接

推薦理由:顧名思義,這個基本庫里包含了使用 React 時你用得上的工具,大部分都是組件,包括了 UI 界面,動畫,感測器等等,興許它們中有一些可以作為你正在尋找的實現方法的備選項。如果你想更有效率的尋找你需要的工具推薦使用它們的 Storybook,那裡面還提供了一些示例以供參考。

Storybook 地址:https://streamich.github.io/libreact/demos/


今日推薦英文原文:《Beginner』s Web Development Guide Part 4: Cloud Deployment》作者:Pavels

原文鏈接:https://medium.com/devtrailsio/beginners-web-development-guide-part-4-cloud-deployment-82fdcd40d7ef

推薦理由:Web 開發系列教程第四部分——雲部署,將你的應用程序部署在較大的雲提供商的雲上可以得到更好的服務與更廣的可訪問區域

Beginner』s Web Development Guide Part 4: Cloud Deployment

This post is part of a series of posts for beginner web developers. Also check out 「Part 1: Frontend」, 「Part 2: Backend」, and 「Part 3: Platforms and Tools」.

Once you』re done developing your applications, it』s time to deploy it. There are multiple cloud providers that offer all the necessary services to build and deploy your applications, the largest of them being Amazon Web Services, Microsoft Azure and Google Cloud Platform. There are also smaller players that provide more tailored services that can be easier to set up for beginners.

Why clouds? We believe, that deploying an application into a cloud-based service nowadays is the best way to go. Pricewise you might find better offers from local data centers available in your region, but joining a larger cloud provider will grant you access to a lot of modern services and different geographical regions. Unless you have compelling legal or financial reasons to host in a local datacenter, clouds seem like a better alternative.

When we』re talking about application hosting, there are several layers of abstraction you can choose, from infrastructure as a service, meaning virtual machines, disks, and networks, to containers as a service, a high-level abstraction for running containers over a cluster of machines. Lower abstraction levels give you more control over the setup, but also require more work and technical skills to configure, while higher-level services make things easier, often reducing the level of control and transparency.

? Infrastructure as a Service

Infrastructure as a Service (IaaS) refers to services that allow you to run virtual machines, file systems, and virtual networks. To make onboarding easier, some platforms provide you with pre-configured images of machines built for different purposes, such as an Apache server on Ubuntu or a PostgreSQL server. You can create a VM based on one of those images and then tailor it to your needs, for example, install software, configure networking and setup security and firewalls. Although IaaS gives you the most control over your services, it』s also requires the most efforts to set up. It』s a good choice when you need to host something other than a plain web application.

Here are some of the popular IaaS services from different providers.

  • DigitalOcean is a cloud platform that offers IaaS services in data centers worldwide. Setting up a VM in DigitalOcean is relatively simple, however, it only offers Linux virtual machines. DigitalOcean offers $100 worth of credits for 60 days to try their services.
  • Amazon EC2 is the Amazon』s IaaS offering and a leader in the overall market share. EC2 offers different kinds of virtual machines with flexible configuration, however, the initial setup can be more challenging. It offers a free 12 month tier for some of the smaller VM types.
  • Azure Virtual Machines is an IaaS offering from Microsoft with a large number of pre-configured images. Microsoft offers $200 worth of credits for one month and 750 hours of small VM』s for 12 months.
  • Google Compute Engine is a service in the Google Cloud Platform that offers $300 credits for a 12 month trial period, an always-free micro VM instance.

? Platform as a Service

Platform as a Service (PaaS) is a type of service for running web applications designed for easier setup. Unlike IaaS, PaaS services provide a complete technology stack to run your application without the need to set up the environment on your own. Some of the other concerns that are usually handled by PaaSes are:

  • A user interface for managing, running or stopping your application;
  • Basic monitoring and logging capabilities;
  • Horizontal and vertical scaling to cope with increasing loads;
  • Environment configuration;
  • Health checks to make sure your application is running and accessible.

Some PaaSes have a limited set of languages they natively support, but nowadays most of them support running Docker containers, meaning you can run an application written in almost any technology. PaaSes are usually designed for running web applications, and might not be suitable to run daemons or other kinds of software.

Some of the popular PaaS offerings are:

  • Heroku is one of the oldest PaaS services out there. It supports running applications written in Ruby, Java, PHP, Node.js, and others, as well as deploying applications in Docker containers. Heroku offers a free tier, however, your application will be put to sleep after 30 minutes of inactivity.
  • Netlify is a service for hosting static websites. It offers a fully fledged free tier with support for automated deployment, HTTPS, redirects, A/B testing, form submission and backend logic using AWS Lambda functions.
  • Azure App Service is an offering from Microsoft Azure. It allows hosting applications written in different languages on both Windows or Linux, as well as running Docker applications. There』s a free shared instance available for the Windows app service.
  • Google App Engine is a service on Google Cloud that supports deploying applications written in Java, Python, Node.js, Go and PHP and Docker applications. There』s also a limited free tier available.

? Function as a Service

Function as a service (FaaS), sometimes also referred to as serverlesscomputing, is a relatively new concept in cloud computing. It』s designed to deploy simple atomic functions into a runtime without the need to worry about the infrastructure and a lot of operational concerns, such as logging and monitoring. Such functions can be invoked as regular services via HTTP requests, but a lot of platforms also provide the ability to react to various events such file uploads, a message in a queue or a modification in a database. The pricing model of FaaSes is also different. Instead of uptime, you pay for execution counts and consumed resources. This makes it a financially attractive solution for parts of your application that don』t need to be up all the time or need to scale dynamically.

Functions have their downsides though. The tooling for most platforms is still in its infancy and local development may be not as smooth as with regular applications. The situation, however, can improve as the serverless movement is gaining momentum.

Popular cases for using functions include simple backend services that can be implemented with a minimal amount of code or post-processing to different events in your applications.

Most large cloud providers also has a function offering:

  • AWS Lambda offers integrations with other Amazon services such as S3, DynamoDB, Kinesis, SNS, and CloudWatch as well as the ability to orchestrate function-based workflows using Step Functions. The AWS SAM tools allows testing your functions locally before deployment. The free tier offers 1M requests and 400,000 Gb seconds computing power per month.
  • Azure Functions is a similar offering from Microsoft that allows integrating with Azure services, such as Blob Storages, Storage Queues, CosmosDB and etc. Azure Functions can be integrated into Logic Apps to form complex workflows. It currently supports C#, F#, JavaScript, and Python as well as Java but in preview. It also offers 1M requests and 400,000 Gb seconds computing power per month.
  • Google Cloud Functions provides similar integrations to Google Cloud services, however, only JavaScript and Python functions are supported at the moment. Local development is supported only for JavaScript functions.

? Containers as a Service

With the rise of containers and Kubernetes as the dominant orchestration platform new 「Kubernetes as a service」 solutions are rolled out by all the major cloud platforms. Such services are commonly referred to as Containers as a Service (CaaS). Since hosting your own Kubernetes cluster is not a trivial task, deploying to a managed cloud cluster is a better alternative for most cases. Such services offer maintained control planes, upgrades, guaranteed cluster uptime and middleware so you can focus on developing your application.

  • Amazon EKS provides a managed Kubernetes cluster with control nodes deployed to multiple availability zones to ensure uptime, built-in security features, and the ability to integrate with other AWS services. However, the process of setting up a new cluster is not as straightforward as it could be. There is no free tier available, and you need to pay both for the worker nodes, and a fixed fee per cluster.
  • Azure Kubernetes Services (AKS) offers a relatively easy initial setup process and a competitive pricing model, that doesn』t charge anything for managing the cluster, but only for node VMs.
  • Google Kubernetes Engine has received a lot of positive reviews from the community, which is to be expected from the company that created Kubernetes. It』s praised for its simple setup and operations. It does, however, offer less integrated services than other platforms.

The cloud landscape is actively developing and providers are racing to offer new innovative services and competitive pricing. Keep an eye out for new offerings from major cloud platforms but also follow smaller platforms that offer more tailored solutions.

This completes the four-chapter 「Beginner』s Web Development Guide」 for now. Hope it helped you find your way around the industry and gave you an idea on which direction to follow next. As a next step, I plan to compose it into a single presentable guide and publish it on devtrails.io so keep posted!

If you have any questions or comments, feel free to leave them here or reach out on twitter @devtrails.io.


每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,歡迎關注開源日報。交流QQ群:202790710;微博:https://weibo.com/openingsource;電報群 https://t.me/OpeningSourceOrg