deploying code
changes at every small iteration, reducing the chance of developing
new code based on bugged or failed previous versions
based on
automating the execution of scripts to minimize the chance of
introducing errors while developing applications.
For every push to the repository, you
can create a set of scripts to build and test your application
automatically, decreasing the chance of introducing errors to your app.
when you run PHP script every time, PHP needs to initialize modules and launch Zend Engine for your running environment. And your PHP script needs to be compiled to OpCodes and then Zend Engine can finally execute them.
in traditional PHP lifecycle, it wastes a bunch of time building and destroying resources for your script execution.
have a built-in server on top of Swoole, and all the scripts can be kept in memory after the first load
"when you run PHP script every time, PHP needs to initialize modules and launch Zend Engine for your running environment. And your PHP script needs to be compiled to OpCodes and then Zend Engine can finally execute them."
Laravel is shipped with a built-in queue system that helps you run tasks in the background
The QueueManager is registered into the container and it knows how to connect to the different built-in queue drivers
for example when we called the Queue::push() method, what happened is that the manager selected the desired queue driver, connected to it, and called the push method on that driver.
Name servers host a domain’s DNS information in a text file called the zone file
Start of Authority (SOA) records
You’ll want to specify at least two name servers. That way, if one of them is down, the next one can continue to serve your DNS information.
Every domain’s zone file contains the admin’s email address, the name servers, and the DNS records.
a zone file, which lists domains and their corresponding IP addresses (and a few other things)
TLD nameserver
ISPs cache a lot of DNS information after they’ve looked it up the first time
Usually caching is a good thing, but it can be a problem if you’ve recently made a change to your DNS information
An A record matches up a domain (or subdomain) to an IP address
point different subdomains to different IP addresses
An AAAA record is just like an A record, but for IPv6 IP addresses.
An AXFR record is a type of DNS record used for DNS replication
used on a slave DNS server to replicate the zone file from a master DNS server
DNS Certification Authority Authorization uses DNS to allow the holder of a domain to specify which certificate authorities are allowed to issue certificates for that domain.
A CNAME record or Canonical Name record matches up a domain (or subdomain) to a different domain.
You should not use a CNAME record for a domain that gets email, because some mail servers handle mail oddly for domains with CNAME records
the target domain for a CNAME record should have a normal A-record resolution
a CNAME record does not function the same way as a URL redirect
A DKIM record or domain keys identified mail record displays the public key for authenticating messages that have been signed with the DKIM protocol
An MX record or mail exchange record sets the mail delivery destination for a domain (or subdomain).
Ideally, an MX record should point to a domain that is also the hostname for its server.
Your MX records don’t necessarily have to point to your Linode. If you’re using a third-party mail service, like Google Apps, you should use the MX records they provide.
Lower numbers have a higher priority
NS records or name server records set the nameservers for a domain (or subdomain).
You can also set up different nameservers for any of your subdomains.
The order of NS records does not matter; DNS requests are sent randomly to the different servers, and if one host fails to respond, another one will be queried.
A PTR record or pointer record matches up an IP address to a domain (or subdomain), allowing reverse DNS queries to function.
PTR records are usually set with your hosting provider. They are not part of your domain’s zone file.
An SOA record or Start of Authority record labels a zone file with the name of the host where it was originally created.
The administrative email address is written with a period (.) instead of an at symbol (<@>).
The single nameserver mentioned in the SOA record is considered the primary master for the purposes of Dynamic DNS and is the server where zone file changes get made before they are propagated to all other nameservers.
An SPF record or Sender Policy Framework record lists the designated mail servers for a domain (or subdomain).
An SPF record for your domain tells other receiving mail servers which outgoing server(s) are valid sources of email, so they can reject spoofed email from your domain that has originated from unauthorized servers.
Your SPF record will have a domain or subdomain, type (which is TXT, or SPF if your name server supports it), and text (which starts with “v=spf1” and contains the SPF record settings).
An SRV record or service record matches up a specific service that runs on your domain (or subdomain) to a target domain.
A TXT record or text record provides information about the domain in question to other resources on the Internet.
One common use of the TXT record is to create an SPF record on nameservers that don’t natively support SPF.
Caching persists data between the same job in different Workflow builds.
Artifacts persist data after a Workflow has finished
When a Workspace is declared in a job, one or more files or directories can be added. Each addition creates a new layer in the Workspace filesystem. Downstreams jobs can then use this Workspace for its own needs or add more layers on top.
Unlike caching, Workspaces are not shared between runs as they no longer exists once a Workflow is complete.
Caching lets you reuse the data from expensive fetch operations from previous jobs.
A prime example is package dependency managers such as Yarn, Bundler, or Pip.
Caches are global within a project, a cache saved on one branch will be used by others so they should only be used for data that is OK to share across Branches
Artifacts are used for longer-term storage of the outputs of your build process.
If your project needs to be packaged in some form or fashion, say an Android app where the .apk file is uploaded to Google Play, that’s a great example of an artifact.
"CircleCI 2.0 provides a number of different ways to move data into and out of jobs, persist data, and with the introduction of Workspaces, move data between jobs"
a stateless authentication mechanism as the user state is never saved in server memory
In authentication, when the user successfully logs in using their credentials, a JSON Web Token will be returned and must be saved locally (typically in local storage, but cookies can be also used), instead of the traditional approach of creating a session in the server and returning a cookie.
ser agent should send the JWT, typically in the Authorization header using the Bearer schema.
Name servers host a domain’s DNS information in a text file called a zone file.
Start of Authority (SOA) records
specifying DNS records, which match domain names to IP addresses.
Every domain’s zone file contains the domain administrator’s email address, the name servers, and the DNS records.
Your ISP’s DNS resolver queries a root nameserver for the proper TLD nameserver. In other words, it asks the root nameserver, *Where can I find the nameserver for .com domains?*
In actuality, ISPs cache a lot of DNS information after they’ve looked it up the first time.
caching is a good thing, but it can be a problem if you’ve recently made a change to your DNS information
An A record points your domain or subdomain to your Linode’s IP address,
use an asterisk (*) as your subdomain
An AAAA record is just like an A record, but for IPv6 IP addresses.
An AXFR record is a type of DNS record used for DNS replication
DNS Certification Authority Authorization uses DNS to allow the holder of a domain to specify which certificate authorities are allowed to issue certificates for that domain.
A CNAME record or Canonical Name record matches a domain or subdomain to a different domain.
Some mail servers handle mail oddly for domains with CNAME records, so you should not use a CNAME record for a domain that gets email.
MX records cannot reference CNAME-defined hostnames.
Chaining or looping CNAME records is not recommended.
a CNAME record does not function the same way as a URL redirect.
A DKIM record or DomainKeys Identified Mail record displays the public key for authenticating messages that have been signed with the DKIM protocol
DKIM records are implemented as text records.
An MX record or mail exchanger record sets the mail delivery destination for a domain or subdomain.
An MX record should ideally point to a domain that is also the hostname for its server.
Priority allows you to designate a fallback server (or servers) for mail for a particular domain. Lower numbers have a higher priority.
NS records or name server records set the nameservers for a domain or subdomain.
You can also set up different nameservers for any of your subdomains
Primary nameservers get configured at your registrar and secondary subdomain nameservers get configured in the primary domain’s zone file.
The order of NS records does not matter. DNS requests are sent randomly to the different servers
A PTR record or pointer record matches up an IP address to a domain or subdomain, allowing reverse DNS queries to function.
opposite service an A record does
PTR records are usually set with your hosting provider. They are not part of your domain’s zone file.
An SOA record or Start of Authority record labels a zone file with the name of the host where it was originally created.
Minimum TTL: The minimum amount of time other servers should keep data cached from this zone file.
An SPF record or Sender Policy Framework record lists the designated mail servers for a domain or subdomain.
An SPF record for your domain tells other receiving mail servers which outgoing server(s) are valid sources of email so they can reject spoofed mail from your domain that has originated from unauthorized servers.
Make sure your SPF records are not too strict.
An SRV record or service record matches up a specific service that runs on your domain or subdomain to a target domain.
Service: The name of the service must be preceded by an underscore (_) and followed by a period (.)
Protocol: The name of the protocol must be proceeded by an underscore (_) and followed by a period (.)
Port: The TCP or UDP port on which the service runs.
Target: The target domain or subdomain. This domain must have an A or AAAA record that resolves to an IP address.
A TXT record or text record provides information about the domain in question to other resources on the internet.
improve the performance and reliability of a server environment by distributing the workload across multiple servers (e.g. web, application, database).
ACLs are used to test some condition and perform an action (e.g. select a server, or block a request) based on the test result.
ACLs allows flexible network traffic forwarding based on a variety of factors like pattern-matching and the number of connections to a backend
A backend is a set of servers that receives forwarded requests
adding more servers to your backend will increase your potential load capacity by spreading the load over multiple servers
mode http specifies that layer 7 proxying will be used
specifies the load balancing algorithm
health checks
A frontend defines how requests should be forwarded to backends
use_backend rules, which define which backends to use depending on which ACL conditions are matched, and/or a default_backend rule that handles every other case
A frontend can be configured to various types of network traffic
Load balancing this way will forward user traffic based on IP range and port
Generally, all of the servers in the web-backend should be serving identical content--otherwise the user might receive inconsistent content.
Using layer 7 allows the load balancer to forward requests to different backend servers based on the content of the user's request.
allows you to run multiple web application servers under the same domain and port
acl url_blog path_beg /blog matches a request if the path of the user's request begins with /blog.
Round Robin selects servers in turns
Selects the server with the least number of connections--it is recommended for longer sessions
This selects which server to use based on a hash of the source IP
ensure that a user will connect to the same server
require that a user continues to connect to the same backend server. This persistence is achieved through sticky sessions, using the appsession parameter in the backend that requires it.
HAProxy uses health checks to determine if a backend server is available to process requests.
The default health check is to try to establish a TCP connection to the server
If a server fails a health check, and therefore is unable to serve requests, it is automatically disabled in the backend
For certain types of backends, like database servers in certain situations, the default health check is insufficient to determine whether a server is still healthy.
However, your load balancer is a single point of failure in these setups; if it goes down or gets overwhelmed with requests, it can cause high latency or downtime for your service.
A high availability (HA) setup is an infrastructure without a single point of failure
a static IP address that can be remapped from one server to another.
If that load balancer fails, your failover mechanism will detect it and automatically reassign the IP address to one of the passive servers.
you can define supported formats at the class level and tell in the instance the resource to be represented by those formats.
when a request comes, for example with format xml, it will first search for a template at users/index.xml. If the template is not available, it tries to render the resource given (in this case, @users) by calling :to_xml on it
how to render our resources depending on the format AND HTTP verb
By default, ActionController::Responder holds all formats behavior in a method called to_format.
Suddenly we realized that respond_with is useful just for GET requests
it renders the resource based on the HTTP verb and whether it has errors or not
Your controller code just have to send the resource using respond_with(@resource) and respond_with will call ActionController::Responder which will know what to do.
A machine image is a single static unit that contains a pre-configured
operating system and installed software which is used to quickly create new
running machines.
"A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines."