optional · CSS study notes
26. Web Application Issues — Operation and Maintenance
CSS Optional — Paper-II, Section-B · P-II.VI.26 · Web applications spend most of their life in operation, and maintenance typically consumes the majority of total lifecycle cost.
1. Operation
Operation = running the live application reliably: hosting, monitoring, backups, incident response and support.
- Monitoring: uptime checks, server metrics (CPU, memory, disk), application performance monitoring (APM), error tracking, log analysis, security alerts. Tools: Prometheus/Grafana, New Relic, Datadog, Sentry, UptimeRobot, ELK stack.
- Backups: regular automated backups of database and files; test restores. 3-2-1 rule: 3 copies of data, on 2 different media, 1 off-site.
- Disaster recovery: RPO (Recovery Point Objective — maximum acceptable data loss, e.g. 1 hour) and RTO (Recovery Time Objective — maximum acceptable downtime, e.g. 4 hours).
- Incident management: detect → respond → resolve → post-mortem to prevent recurrence.
- SLA (Service Level Agreement): contractual availability and response targets.
- Capacity planning: forecast growth; scale before limits are reached.
- Security operations: patching, certificate renewal, access reviews.
2. Maintenance — Four Types
| Type | Purpose | Web example |
|---|---|---|
| Corrective | Fix defects found in use | Checkout button fails on Safari |
| Adaptive | Adapt to changes in environment | Update for a new PHP version, browser change or payment-gateway API change |
| Perfective | Improve performance or add features requested by users | Add Urdu language option; faster search |
| Preventive | Prevent future problems; reduce technical debt | Refactor code, update libraries, fix security weaknesses proactively |
Web-specific maintenance: continuous content updates (news, prices, fees); broken-link fixing; SEO upkeep; keeping third-party plugins/CMS updated (outdated WordPress plugins are a common attack route); adapting to new devices and screen sizes.
3. Why Maintenance Dominates
- Lehman's law of continuing change: a system used in the real world must be continually adapted or it becomes progressively less useful.
- Web apps evolve constantly (competition, new browsers, security threats, business changes).
- Technical debt (quick fixes, outdated libraries) accumulates and raises future maintenance cost unless addressed.
Maintainability practices: modular/layered architecture (MVC), coding standards, documentation, automated tests, version control, CI/CD, dependency management, configuration outside code, feature flags.
📐 Worked Numericals — Availability
Downtime per year = (1 − availability) × 8,760 hours.
| Availability | Downtime per year | Per month (approx.) |
|---|---|---|
| 99% ("two nines") | 87.6 hours | 7.3 hours |
| 99.9% ("three nines") | 8.76 hours | 43.8 minutes |
| 99.99% | 52.6 minutes | 4.4 minutes |
| 99.999% | 5.26 minutes | 26 seconds |
Availability from MTBF/MTTR: A = MTBF / (MTBF + MTTR). A server fails on average every 1,000 hours (MTBF) and takes 2 hours to repair (MTTR) → A = 1000/1002 ≈ 99.8%.
Redundancy: two independent servers each 99% available, either can serve → A = 1 − (0.01 × 0.01) = 99.99%.
🎯 CSS Exam Angle
Separate operation (running it) from maintenance (changing it). Use the four-type maintenance table with web examples, then availability numbers. The MTBF/MTTR or redundancy calculation is a quick, impressive addition.
⚠️ MCQ Traps
- Adaptive = environment change; perfective = improvements/new features; corrective = bug fixes; preventive = future-proofing.
- RPO is about data loss; RTO is about downtime.
- 99.9% availability allows about 8.76 hours of downtime per year.
- Maintenance usually costs more than initial development over a system's life.
✅ Self-Check (with Answers)
Q1. Classify: (a) fixing a broken contact form, (b) updating code for a new PHP version, (c) adding dark mode, (d) upgrading an old library before it becomes a risk.
Ans: (a) Corrective, (b) adaptive, (c) perfective, (d) preventive.
Q2. What are RPO and RTO?
Ans: RPO — the maximum acceptable amount of data loss measured in time (how old the latest backup may be). RTO — the maximum acceptable time to restore service after a failure.
Q3. A site promises 99.95% availability. How much downtime per year is allowed?
Ans: 0.0005 × 8,760 = 4.38 hours per year (about 22 minutes per month).
Q4. Explain the 3-2-1 backup rule.
Ans: Keep 3 copies of data, on 2 different storage media, with 1 copy off-site (e.g. in another region or cloud) so a single disaster cannot destroy all copies.
Q5. Why is maintenance especially demanding for web applications?
Ans: Content changes continuously, browsers/devices/APIs evolve, security vulnerabilities in frameworks and plugins appear regularly, and competition demands frequent new features — all under 24/7 availability expectations.