You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: module7-cloud-computing/r1.2-deployment/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Once your site is finished (or finished "enough" to start public testing) you're
4
4
5
5
Up to now, you've been working in a development environment, using Express/Node as a web server to share your site to the local browser/network, and running your website with (insecure) development settings that expose debugging and other private information.
6
6
7
-
## Production Enviroment
7
+
## Production Environment
8
8
9
9
The production environment is the environment provided by the server computer where you will run your website for external consumption. The environment includes:
10
10
@@ -26,7 +26,7 @@ Some developers will choose the increased flexibility provided by IaaS over PaaS
26
26
27
27
There are numerous hosting providers that are known to either actively support or work well with Node (and Express). These vendors provide different types of environments (IaaS, PaaS), and different levels of computing and network resources at different prices.
28
28
29
-
Few popular options are:
29
+
A few popular options are:
30
30
31
31
- Amazon Web Services (EC2)
32
32
- DigitalOcean
@@ -35,7 +35,7 @@ Few popular options are:
35
35
36
36
## Creating and starting the server
37
37
38
-
After picking a provider, we need to pick an operating system for our cloud computer and other specifications like Ram. Most servers run Linux and it is a great choice for developing Node.js, Windows servers are only really useful for specialized applications such as .NET. For the basic things there isn’t much difference between the Linux images. You can go with Ubuntu Server because it is widely used and has tonnes of guides and plenty of questions and answers on the internet.
38
+
After picking a provider, we need to pick an operating system for our cloud computer and other specifications like Ram. Most servers run Linux and it is a great choice for developing Node.js, Windows servers are only really useful for specialized applications such as .NET. For the basic things, there isn’t much difference between the Linux images. You can go with Ubuntu Server because it is widely used and has tonnes of guides and plenty of questions and answers on the internet.
39
39
40
40
An image is an exact copy of a hard drive that can be easily loaded onto an empty hard drive, in this case they are being used as presets to get your machine setup easily. Without at least an operating system and SSH, it wouldn’t be possible to even configure the server so some preset software is necessary.
41
41
@@ -53,9 +53,9 @@ Because these ports are often public, you need special privileges to run process
53
53
54
54
## SSH into your server
55
55
56
-
There are many ways to establish a connection with a remote machine depending on the operating system you are running, the most common is Secure Shell (SSH) fro linux-based machines by using a text-based interface or CLI.
56
+
There are many ways to establish a connection with a remote machine depending on the operating system you are running, the most common is Secure Shell (SSH) for linux-based machines by using a text-based interface or CLI.
57
57
58
-
To SSH we need to have a username, an address and a key. The address is available usually in your server provider dashboard, it look something like this `52.214.64.31`. The key is usually provided to as `.pem` file or a string key when you run your server for the first time.
58
+
To SSH we need to have a username, an address and a key. The address is available usually in your server provider dashboard, it looks something like this `52.214.64.31`. The key is usually provided to you as `.pem` file or a string key when you run your server for the first time.
59
59
Almost there. By default, connecting to your instance without a username will try to login as root which is generally not allowed. So from your server provider, you can get the username to use when you SSH to your server. for ubuntu the username is by default ubuntu.
60
60
61
61
To connect, the SSH command should look something like
@@ -79,7 +79,7 @@ To check node is ready to go just echo the version.
79
79
80
80
## Deploying code into the server
81
81
82
-
Now after having node installed, our server is ready to run our node app. To get your code, it does't make since to write code on SSH session, for that you can clone your code from github to your server and run it (don't forget, your remote server is just like your local computer but somewhere else).
82
+
Now after having node installed, our server is ready to run our node app. To get your code, it doesn't make sense to write code on SSH session, for that, you can clone your code from github to your server and run it (don't forget, your remote server is just like your local computer but somewhere else).
83
83
84
84
We need to SSH into the server, generate a SSH private/public key pair and then add it as a deployment key in source control (i.e. Github). Only when the server is allowed access to the remote repo will it be able to clone the code and pull down changes.
85
85
SSH into your server and generate the key pair.
@@ -129,16 +129,16 @@ To make sure that your PM2 restarts when your server restarts
129
129
`pm2 startup`
130
130
131
131
This will print out a line of code you need to run depending on the server you are using. Run the code it outputs.
132
-
Finally, save the current running processes so they are run when PM2 restarts.
132
+
Finally, save the currently running processes so they are run when PM2 restarts.
133
133
134
134
`pm2 save`
135
135
136
136
Great! Check out the [PM2 docs](https://pm2.keymetrics.io/) to see what else you can do with process management, like using PM2 in order for us to do the git cloning on the server for us.
137
137
138
138
## Deploying on PaaS
139
139
140
-
As we mentioned earlier, There are many platforms out there that enables you to deploy your node app with only few clicks without the need to setup everything manually by yourself.
141
-
These are more popular now days for small projects and way quicker than the cloud server approach. you can simply upload your code and the platform (eg. [aws elastic beanstalk](https://aws.amazon.com/getting-started/hands-on/deploy-nodejs-web-app/)) automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring.
140
+
As we mentioned earlier, There are many platforms out there that enable you to deploy your node app with only a few clicks without the need to setup everything manually by yourself.
141
+
These are more popular nowadays for small projects and way quicker than the cloud server approach. you can simply upload your code and the platform (eg. [aws elastic beanstalk](https://aws.amazon.com/getting-started/hands-on/deploy-nodejs-web-app/)) automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring.
Copy file name to clipboardExpand all lines: module7-cloud-computing/r4-serverless-architecture/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Serverless Architecture
2
2
3
-
A serverless architecture is a way to build and run applications and services without having to manage infrastructure. Your application still runs on servers, but all the server management is done by the platform you are using (For example, AWS). You no longer have to provision, scale, and maintain servers to run your applications, databases, and storage systems.
3
+
Serverless architecture is a way to build and run applications and services without having to manage infrastructure. Your application still runs on servers, but all the server management is done by the platform you are using (For example, AWS). You no longer have to provision, scale, and maintain servers to run your applications, databases, and storage systems.
4
4
5
5
## Why use serverless architectures?
6
6
@@ -16,7 +16,7 @@ serverless architecture offers the following value propositions:
16
16
- Fault tolerant. Since serverless application coding is logically decoupled from the underlying infrastructure, hardware failures have minimal impact on the software development process. Users are not required to manage applications on their own.
17
17
- Low operational overhead. The infrastructure and operations management tasks are managed by cloud vendors, allowing organizations to focus their efforts on building software features. Applications are released faster, resulting in faster end-user feedback and therefore, continued improvements over the next software release cycles.
18
18
- Optimized usage-based billing. The pay-as-you-go billing model serves particularly well for small and midsize (SMB) organizations that lack the capital to establish and manage on-site data centers.
19
-
- Built-in integrations. Most cloud vendors offer integrations with a variety of services that allow users to focus on building highquality applications instead of configuring them.
19
+
- Built-in integrations. Most cloud vendors offer integrations with a variety of services that allow users to focus on building high-quality applications instead of configuring them.
20
20
21
21
## Types of serverless architecture software
22
22
@@ -30,7 +30,7 @@ A function is a piece of software running business logic on an operating system.
30
30
FaaS gives developers an abstraction for running web applications in response to events, without managing servers.
31
31
32
32
With Amazon Lambda (a FaaS service from Amazon Web Services, we will talk more about it later in this lesson), you can directly run your code without even managing the servers.
33
-
For example, you upload an image in the server, now the Lambda function will work for you and will automatically resize the image according to the device a user is using, be it mobile, laptop, desktop or a tablet.
33
+
For example, you upload an image in the server, now the Lambda function will work for you and will automatically resize the image according to the device a user is using, be it mobile, laptop, desktop or tablet.
34
34
35
35
Think of FaaS as a ready-to-implement framework that can be easily tailored to the needs of an enterprise company.
36
36
@@ -39,9 +39,9 @@ Think of FaaS as a ready-to-implement framework that can be easily tailored to t
39
39
Backend-as-a-Service (BaaS) is a cloud service model in which developers outsource all the behind-the-scenes aspects of a web or mobile application so that they only have to write and maintain the frontend. BaaS vendors provide pre-written software for activities that take place on servers, such as user authentication, database management, remote updating, and push notifications (for mobile apps), as well as cloud storage and hosting.
40
40
41
41
Let's take [Firebase](https://firebase.google.com/) as an example of BaaS.
42
-
Firebase is owned by Google. It has extensive features for building, hosting and managing apps. The platform consists of several tools that developers need for building and managing apps. In essence, it provides all the tools developers need to build an app, launch it, and engage with the app users.
42
+
Firebase is owned by Google. It has extensive features for building, hosting, and managing apps. The platform consists of several tools that developers need for building and managing apps. In essence, it provides all the tools developers need to build an app, launch it, and engage with the app users.
43
43
44
-
Since the backend platform gives the developer access to several ready-made services like file storage, database, authentication, they can put more efforts into building excellent apps. Another superb feature of Firebase it the seamless scaling of apps. All these features work together to make Firebase one of the leading BaaS platforms today.
44
+
Since the backend platform gives the developer access to several ready-made services like file storage, database, authentication, they can put more effort into building excellent apps. Another superb feature of Firebase is the seamless scaling of apps. All these features work together to make Firebase one of the leading BaaS platforms today.
45
45
46
46
### Database
47
47
@@ -53,7 +53,7 @@ Amazon Web Services. is a subsidiary of Amazon providing on-demand cloud computi
53
53
54
54
In this use case, we are going to look at a simple to-do list web application that enables a registered user to create, update, view, and delete items.
55
55
56
-
For this use case, we may use few AWS serverless services:
56
+
For this use case, we may use a few AWS serverless services:
57
57
58
58
-[AWS Lambda](https://aws.amazon.com/lambda/?c=ser&sec=uc1): is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers.
59
59
@@ -78,7 +78,7 @@ This application consists of 3 main components outlined below.
78
78
79
79
### Front End Application
80
80
81
-
The front-end application is all the static content (HTML files, CSS files, JavaScript files and images) that are generated by `create-react-app`. All these objects are hosted on AWS Amplify Console.
81
+
The front-end application is all the static content (HTML files, CSS files, JavaScript files, and images) that are generated by `create-react-app`. All these objects are hosted on AWS Amplify Console.
82
82
83
83
When a user connects to the web site, the needed resources are downloaded to their browser and start to run there. When the application needs to communicate with the backend it does so by issuing REST API calls to the backend.
An event-driven architecture uses events to trigger and communicate between decoupled services and is common in modern applications built with microservices. An event is a change in state, or an update, like an item being placed in a shopping cart on an e-commerce website. Events can either carry the state (the item purchased, its price, and a delivery address) or events can be identifiers (a notification that an order was shipped).
72
72
73
-
Before moving deepter into Event-driven functions, we need to understand Pub/Sub.
73
+
Before moving deeper into Event-driven functions, we need to understand Pub/Sub.
74
74
75
75
Pub/Sub, which stands for Publisher/Subscriber, allows services to communicate asynchronously, with latencies on the order of 100 milliseconds.
76
76
@@ -86,7 +86,7 @@ Core concepts of Pub/Sub
86
86
87
87
1. Implementing Asynchronous Workflows: You can create an application that is used to place and process orders. This application will use a Pub/Sub topic, where the order would be placed and can be picked up by multiple workers for its processing. 2. Distributing Event Notifications
88
88
89
-
2. Distributing Event Notifications: You can create an application that has a module that handles new user registrations. This module will fetch the data from user-signups and send notifications whenever a new registration occurs. The other module of the application will subscribe to receive the notifications sent by the first module. 3. Refreshing a Distributed Cache
89
+
2. Distributing Event Notifications: You can create an application that has a module that handles new user registrations. This module will fetch the data from usersignups and send notifications whenever a new registration occurs. The other module of the application will subscribe to receive the notifications sent by the first module. 3. Refreshing a Distributed Cache
90
90
91
91
3. Refreshing a Distributed Cache: You can create an application that will be responsible for publishing invalidation events to update the primary keys of objects that have been altered. 4. Reliability Improvement
0 commit comments