“It works on my machine” is less reassuring when the application leaves your laptop. Cloud computing provides rented computing resources over a network, letting a system provision virtual servers as needed rather than relying on a particular physical machine. section 9.1 section 9.1.3 section 9.3.2
The public cloud is not magic: it runs on physical hardware in providers’ data centers. Think of it like an apartment building: tenants have separate spaces, but share the foundations. That sharing can create a noisy neighbor problem: another tenant’s heavy network or disk use can slow your application down. section 9.1.1
Cloud resources can expand and contract, but flexibility comes with operational complexity and potentially higher usage costs. Dropping a rigid on-premises design into an elastic environment can leave it unable to cope with changing demand. Infrastructure as Code helps by describing the required environment in declarative blueprints that can be provisioned automatically. section 9.1.3
Treat virtual servers as replaceable cattle, not carefully tended pets. If one stops responding, automation can terminate it and start another. But replacement is safe only if the server is not holding unique data: keep sessions, uploads, and other state in persistent external storage rather than on its local disk. section 9.3.2 section 9.3.3
Listing 9.1 Stateful Design vs. Stateless Design
# Wrong (Stateful): Saves user upload to the fragile local filesystem
with open('profile.jpg', 'wb') as f:
f.write(user_upload)
# Right (Stateless): Saves user upload directly to an external S3 Bucket
import boto3
boto3.client('s3').put_object(Bucket='mybucket', Key='profile.jpg',
Body=user_upload)Compare an upload saved on a disposable server’s local disk with one sent directly to an S3 bucket. section 9.3.3
The practical decision rule: plan for servers to disappear, store important state elsewhere, and weigh the benefits of elasticity against shared-resource behavior, operational work, and usage costs. section 9.1.1 section 9.1.3 section 9.3.3













