DevOps & Cloud

3,496 questions on DevOps & Cloud, part of Computing & Information Sciences. Below are 12 of them in full, each answered in plain language.

Questions & explanations

1. How can you replicate data across regions for a serverless disaster recovery setup?

To replicate data across regions, use a database that supports cross-region replication. For example, DynamoDB global tables automatically replicate your data to other regions with multi-master writes. For relational databases, you can use Aurora Global Database, which replicates data with low latency. For object storage like S3, enable cross-region replication to copy objects to a bucket in another region. For serverless functions, you deploy the same function code to multiple regions using infrastructure as code. Then, you configure a global DNS service to route traffic to the nearest healthy region. This setup ensures that if one region fails, another can take over with minimal data loss.

2. How does a lift-and-shift migration to serverless differ from a refactor migration?

Lift-and-shift moves the application as-is to run on serverless platforms, usually by packaging the whole app into a container or using a serverless container service. It requires minimal code changes but may not fully benefit from serverless features like auto-scaling or pay-per-use. Refactor migration rewrites parts of the application into small serverless functions, following best practices like stateless design. Refactoring takes more time but can reduce costs and improve scalability. For example, a legacy PHP website might be lifted into a container on AWS Fargate, while a refactored version would break it into separate Lambda functions for each API endpoint.

3. Compare active-passive and active-active multi-region designs for serverless.

In active-passive, one region handles all traffic normally, and the second region is idle but ready. If the primary fails, you switch traffic to the passive region. This is simpler but wastes resources and takes time to activate. In active-active, both regions serve traffic at the same time. Traffic is split using a DNS service like Route53 with latency-based routing. Active-active gives faster failover because both regions are already running. However, you must handle data replication so that both regions have consistent data. For example, use DynamoDB global tables to automatically sync writes. Active-active is more expensive but provides near-zero downtime.

4. Give an example of a serverless application designed for multi-region high availability.

A global e-commerce site might have serverless functions in us-east-1 and eu-west-1. Users are routed to the nearest region using Route53 latency routing. The product catalog is stored in DynamoDB global tables, so both regions have the same data. User sessions are stored in a global Redis cache. Every function is deployed to both regions via a CI/CD pipeline that pushes the same code to both Lambda environments. If us-east-1 fails, Route53 health checks detect the failure and route all new traffic to eu-west-1. Users might see a slight latency increase but the site stays available. The application is designed to be stateless, so failover is seamless.

5. What are the benefits of using Kubernetes-based serverless platforms over managed serverless?

Using Kubernetes-based serverless like Knative gives you portability: you can run the same platform on any cloud or on-premises. You have more control over the environment, including networking, security, and resource limits. You can avoid vendor lock-in. Also, you might reduce costs if you already have Kubernetes infrastructure. However, you must manage the cluster and the serverless platform yourself, which increases operational complexity. Managed serverless like Lambda is simpler, scales automatically without cluster management, and integrates tightly with other cloud services. The choice depends on your need for control versus ease of use.

6. What are the cost considerations of running a multi-region serverless architecture?

Running a multi-region serverless architecture increases costs because you pay for duplicate resources. Each region has its own Lambda functions, API Gateways, and databases. Data replication also costs money: DynamoDB global tables charge for replicated write capacity. Data transfer between regions incurs network costs. However, serverless pricing can help because you only pay for what you use. If the passive region is idle most of the time, costs are lower than with traditional servers. You can reduce cost by using a standby replica in the secondary region that is only activated when needed. Plan carefully to balance availability and budget.

7. What is a potential downside of using Testcontainers in a CI pipeline compared to using a dedicated test database?

Testcontainers requires Docker to be installed and running in the CI environment, which may not be available or could have permission restrictions. Starting containers adds time to the pipeline, especially if many tests need different containers. Dedicated test databases are always available and can be faster. Additionally, Testcontainers uses more memory and CPU on the CI runner. If the CI environment has limited resources, containers may fail to start or slow down other jobs. Some managed CI services also restrict Docker access unless you use a custom runner. However, Testcontainers provides isolation that a shared test database cannot.

8. What is disaster recovery for serverless applications?

Disaster recovery (DR) is a plan to keep your application running when a major failure happens, like a data center outage. For serverless apps, DR means having copies of your functions and data in another geographic region. If one region goes down, traffic is redirected to the second region. The goal is to minimize downtime and data loss. Serverless platforms like AWS Lambda run in specific regions, so you must deploy your functions to multiple regions. You also need to replicate databases like DynamoDB globally. The plan defines how fast you can recover (Recovery Time Objective) and how much data you can lose (Recovery Point Objective).

9. How does OWASP ZAP differ from a static code analyzer like SonarQube when used in a pipeline?

OWASP ZAP tests a running application from the outside (dynamic analysis), while SonarQube checks source code without executing it (static analysis). ZAP finds issues like misconfigurations or runtime behavior, whereas SonarQube detects coding flaws like bugs or code smells. Both complement each other: ZAP catches security problems in the live system, and SonarQube flags issues in the code itself. In a pipeline, you can run both to cover different types of problems. For example, ZAP might find a missing security header, while SonarQube might spot a weak encryption algorithm in the code. Using both gives a more complete security picture.

10. What is one main difference in how startups and large enterprises use Site Reliability Engineering (SRE)?

Startups often have fewer people and less money, so SRE tasks are done by the same team that builds features. Large enterprises can have a separate SRE team with more tools and budget. In startups, SRE is often simpler: they focus on keeping the site up with basic monitoring and on-call rotation. Large enterprises have complex systems and need detailed service level objectives (SLOs) and error budgets. For example, a startup might use a simple cloud provider dashboard, while a large company builds custom automation. The key difference is that startups trade thoroughness for speed, while large enterprises invest heavily in reliability.

11. What could cause a test to fail when using Selenium Grid that would not happen locally?

Network delays between the hub and node can cause timeouts, especially if the node is on a different machine. Resource contention when many tests run in parallel might slow down the node, leading to element-not-found errors. Mismatched browser versions between the node and the WebDriver binary can also cause failures. Additionally, if the node runs an OS different from the local machine, OS-specific issues like file paths or keyboard shortcuts may appear. Finally, the hub or node might crash due to memory exhaustion if too many tests queue up. These failures highlight the need for robust timeout handling and environment consistency.

12. What makes Cypress different from Selenium for end-to-end testing?

Cypress runs directly in the browser using JavaScript, while Selenium works by sending commands over the WebDriver protocol. Cypress has a simpler, more modern API and provides real-time reloading during test development. It automatically waits for elements and network requests without explicit waits. Unlike Selenium, Cypress cannot drive multiple browsers at once; it mainly supports Chrome-family browsers. Cypress also gives you direct access to the browser's DOM and network traffic for easier debugging. These differences make Cypress faster and more reliable for single-browser testing, but less flexible for cross-browser suites.

More Computing & Information Sciences topics

This page shows 12 of 3,496 questions on this topic. The full set, with progress tracking and five agent perspectives per question, is in the JupiteX app — browse the exam catalogue or browse the Learn library.