What is infrastructure: Difference between revisions
imported>Unknown user No edit summary |
m Maintenance script moved page UserDocumentation:Knowledge Central/KC IT/Devops definitions/What is infrastructure to What is infrastructure: Cleaned title and categorized |
(No difference)
| |
Revision as of 18:51, 19 October 2025
The infrastructure of a website encompasses the range of systems, services, and tools that together enable a website to be available to its users. It forms the backbone of a website's operations and influences aspects like speed, reliability, security, and scalability. Here are the elements that constitute a website's infrastructure:
Domain Name System (DNS)
Domain Name System (DNS) is a hierarchical and decentralized system designed to translate human-readable domain names, such as "http://www.example.com ", into IP addresses, which are numerical labels, enabling computers to identify each other on the Internet or a private network. The DNS system is one of the foundational elements of the modern internet.
- Domain Name: It's the human-readable address (URL) of a website, like http://www.example.com . It's easier to remember than IP addresses.
- Domain Registrar: Companies like GoDaddy, Namecheap, and Bluehost, where you can register a domain name.
- DNS Hosting Services: Maintain the directory of domain names and translate them to IP addresses, ensuring that when someone enters a domain, they're directed to the correct server.
Web Hosting
- Web hosting refers to the service that allows individuals and organizations to make their website accessible via the World Wide Web. Web hosts are companies that provide space on servers they own or lease for use by their clients, as well as providing Internet connectivity, typically in a data center. The main purpose of web hosting is to give websites a home where they can reside. Without web hosting, your website would not be accessible to the public.
- Shared Hosting: A cost-effective solution where multiple websites share server resources. Suited for small websites with low traffic.
- VPS: It offers more control and customization. Users get a virtualized "portion" of a server.
- Dedicated Hosting: Best for high-traffic sites that require lots of resources. You rent an entire server.
- Cloud Hosting: Flexible and scalable. Your website's resources can be pulled from multiple servers.
- \**CDN: Services like Cloudflare or Akamai that cache website content in multiple locations, delivering it from the nearest point to the user.
Web Servers
A web server is a combination of software and hardware that uses the HTTP protocol (and often HTTPS) to serve files, commonly web pages, to users in response to their requests, which are forwarded by their web browsers.
Software Aspect
The term "web server" often specifically refers to the software that accepts requests from clients (usually web browsers) and then serves them web pages. Popular web server software includes:
- Apache: An open-source web server software that's been around since the 1990s and is known for its flexibility, reliability, and wide support.
- Nginx: Also open-source, it's renowned for its speed and robustness. It can also act as a reverse proxy, load balancer, and more.
- Microsoft's Internet Information Services (IIS): An integrated part of the Windows Server operating system. LiteSpeed, Tomcat, Caddy, and many others, each with its specific features and optimizations.
How they work
- Listening: The web server software listens for incoming requests on a particular port, typically port 80 for HTTP and 443 for HTTPS.
- Parsing the Request: Once a request is received, the server interprets it. This includes determining the desired file or resource, any input data, and other specifications in the HTTP header.
- Locating the Resource: If the resource exists and no errors are found in the request, the server fetches it. This can be a static file like an HTML, CSS, or JS file, or it could be a dynamic one, like a script that needs to be executed to generate a response.
- Generating Response: For static files, this generally means reading the file and sending its contents. For dynamic resources, the server often integrates with other software to process code and then serve the result. For instance, PHP scripts are commonly processed using a module that integrates with the server.
- Sending Response: The server sends the response back to the client using the HTTP protocol, which includes headers (providing metadata about the response) and the actual content (like an HTML page).
Hardware Aspect:
The software needs to run on a physical machine, typically a computer optimized for handling web traffic. This machine's features may include:
- Redundant Power Supplies: To stay online even if one fails.
- Fast I/O Operations: Often achieved with SSDs to read/write data quickly.
- Robust Networking: Fast and reliable network interfaces, often with redundancy and failover capabilities.
- Scalability: Many large-scale web servers can distribute loads across multiple machines, either in one location or dispersed data centers.
Additional Considerations
- Security: A vital aspect. Measures include firewalls, SSL/TLS for encrypted connections, security configurations, and more.
- Logging: Servers typically maintain logs for all requests and errors. This can help in troubleshooting, monitoring, and analyzing traffic.
- Load Balancing: For high-traffic sites, a load balancer may distribute incoming requests across multiple web servers.
- Caching: To speed up responses, servers often use caching mechanisms, either internally or via external systems, to store and quickly serve frequently accessed content.
- Configuration: Administrators can configure aspects like how to handle different file types, redirect rules, custom error pages, authentication requirements, etc.
Database Servers
Store structured data, like user profiles or product catalogs. MySQL is popular for web apps, while MongoDB (a NoSQL database) is known for scalability.
Network Infrastructure
- Routers: Direct data on a network.
- Switches: Connect devices within a network.
- Load Balancers: Distribute incoming network traffic across multiple servers.
- Firewalls: Monitors and controls incoming/outgoing traffic based on security policies.
SSL/TLS
SSL, which stands for "Secure Sockets Layer," is a cryptographic protocol designed to provide secure communication over a computer network. It's the predecessor of the modern TLS (Transport Layer Security) protocol, but the term "SSL" is still often used in practice to refer to TLS.
How It Works
- Handshake Phase: Before data transmission begins, the client and server exchange a series of messages to agree on the encryption algorithms they will use, verify the server's identity (and possibly the client's), and generate shared secrets.
- Data Transfer Phase: Actual encrypted data transfer between the client and server using the parameters established during the handshake.
- Closure: Proper termination of the session, which can also be reused for future sessions without repeating the full handshake.
Key Concepts
- Public Key Infrastructure (PKI): SSL uses a combination of public key and symmetric encryption. The PKI comprises the components necessary to create, distribute, manage, store, and revoke digital certificates.
- Digital Certificates: Issued by Certificate Authorities (CAs), they contain the public key of the server and various pieces of information about the entity. Clients use this to verify the server's identity.
- Private Key: This remains confidential and is stored securely on the server. It is used in combination with the public key in the digital certificate for encrypting or decrypting information.
- Cipher Suites: A set of cryptographic algorithms. When a connection is initiated, the client and server agree on a specific suite to use.
Benefits
- Data Encryption: Encrypts the data being transmitted, ensuring that even if intercepted, it remains unreadable without the proper decryption key.
- Data Integrity: Ensures that the data sent between the client and server isn't tampered with during transit.
- Authentication: By verifying the server's digital certificate, clients can be confident they are connecting to the genuine server, not an imposter.
Vulnerabilities and Criticisms
- As with any technology, older versions of SSL/TLS have vulnerabilities. It's crucial to disable outdated versions and configurations.
- Examples of vulnerabilities in older versions include POODLE (in SSL 3.0) and BEAST (in TLS 1.0).
- Some criticisms arise from the centralized nature of trust in the PKI system. A compromised or dishonest CA could create mistrusted certificates.
Best Practices
- Always keep your server configurations up to date.
- Use strong cipher suites and prefer forward secrecy.
- Regularly renew and manage your server certificates.
- Ensure all web content is served over HTTPS, not just sensitive pages.
- Implement HTTP Strict Transport Security (HSTS) to ensure browsers only connect over HTTPS.
- Regularly audit and test your configurations for vulnerabilities.
Storage Solutions
Storing large files or backups. Cloud solutions like Amazon S3 offer vast storage capacities and pay-as-you-go pricing.
Backup Systems
Regularly store copies of website data. In case of data loss or cyberattacks, these backups can restore the website.
Monitoring & Analytics
Tools like Google Analytics track user behavior. Monitoring tools (e.g., New Relic or Datadog) track server performance and uptime.
Security Measures
WAF: Protects web apps by monitoring HTTP traffic. IDS/IPS: Monitors network traffic for suspicious activity and prevents or alerts about potential threats.
Deployment Tools & CI/CD
Automated systems for pushing code changes. CI focuses on integrating code changes regularly. CD ensures that this code reaches the production environment.
Email Servers
Manage sending, receiving, and storing emails. Services like SendGrid or in-house servers using software like Postfix.
Development Environment
Separate setups where new features or changes are tested before being pushed to the live website.
Scaling & Load Balancing
As traffic grows, a website might need additional resources. Scaling can be vertical (adding more resources to a server) or horizontal (adding more servers). Load balancers distribute this traffic to prevent overloading a single server.