Cloud concept · Updated

Data Locality - Data locality is the placement of data and the workloads that use it close together to reduce network movement, latency, and transfer costs.

In short

In cloud architectures, locality can mean using the same Region, Availability Zone, or processing environment, depending on the workload. It matters because network boundaries affect performance and billing, while replication and geographic distribution introduce trade-offs involving resilience, consistency, and data residency.

Cloud Concepts Hub →

6 key aspects of Data Locality

Data locality combines access-aware placement, transfer-aware cost analysis, reduced data movement, and deliberate trade-offs with resilience and location requirements.

01
Placement follows access patterns

Place processing near the datasets it accesses most heavily, and place frequently requested content near its consumers. Measure transferred bytes and request frequency rather than choosing locations solely from the application's deployment location.

02
Transfer direction affects billing

Internet ingress into AWS is generally free of transfer charges, while internet egress and inter-Region transfers commonly incur charges. Identify the source, destination, and service-specific billing rules for each flow.

03
Network boundaries have different costs

Same-Region does not automatically mean free transfer: cross-Availability Zone traffic can be chargeable. Conversely, some service pairings, such as S3 and EC2 within the same Region, have free transfer even though they do not share a customer-selected zone.

04
Move less data

Filter, aggregate, compress, or cache data before sending it across expensive or slow boundaries. Sending a compact query result is often more efficient than moving the source dataset to the consumer.

05
Resilience can justify remote copies

Multi-zone and cross-Region designs may intentionally sacrifice some locality to meet availability and disaster recovery objectives. Include replication traffic, extra storage, and synchronization behavior in the design.

06
Locality is distinct from residency

Locality concerns proximity between data and its consumers; residency concerns permitted storage or processing locations. A nearby cache or replica must still satisfy applicable location restrictions.

Cloud services for Data Locality

S3 provides regional data storage, while EC2 and EMR supply processing that can run near those datasets. RDS provides application databases whose placement should be coordinated with application compute, without abandoning required availability protections. CloudFront addresses a different locality problem by caching content near geographically distributed viewers. Together, these services support keeping large scans and frequent database exchanges close to their sources while distributing selected results or cached content to users. Evaluate each connection separately: service-specific transfer exemptions do not remove storage, request, replication, or intermediate networking charges.

Amazon S3Amazon S3

S3 buckets have a selected AWS Region, making bucket location important for nearby processing and replication costs. Transfer between S3 and EC2 in the same Region is generally free, while cross-Region copying introduces transfer costs alongside requests and destination storage.

Amazon EC2Amazon EC2

EC2 instances are placed in specific Availability Zones, allowing engineers to locate processing near databases, peers, and regional storage. Same-zone private-IP instance traffic and cross-zone instance traffic have different transfer pricing, so placement should consider both cost and availability.

Amazon RDSAmazon RDS

Placing application servers near an RDS database reduces network latency and can limit chargeable application traffic across zones or Regions. Multi-AZ deployments and cross-Region read replicas introduce resilience or read-locality benefits, with deployment-specific transfer and replication pricing.

Amazon CloudFrontAmazon CloudFront

CloudFront caches supported content at edge locations near viewers, reducing repeated origin fetches and improving response latency. AWS-origin transfer to CloudFront is generally free, but CloudFront viewer delivery and requests have their own pricing.

Amazon EMRAmazon EMR

EMR runs data-processing workloads that benefit from proximity to their input datasets. Using the same Region as S3 inputs avoids unnecessary inter-Region reads, while distributed processing frameworks can also exploit worker-local data when available.

Data Locality exam questions

Real practice exam questions on Data Locality, with the correct answer and its explanation. Answer them with every option in the exam simulator.

CLF-C02

A company runs a temporary batch-processing job on two Amazon EC2 instances. The instances exchange several terabytes of intermediate results each day. The job does not require instances in separate Availability Zones, and all instance configurations have the same compute cost. Which deployment will minimize EC2 data transfer charges for the exchanged results?

Show answerCORRECT ANSWER

Place the instances in the same Availability Zone and exchange results directly using private IP addresses.

Data transferred directly between EC2 instances using private IP addresses within the same Availability Zone is free of data transfer charges. This placement minimizes transfer costs and meets the job's requirements.

SOA-C03

A company runs a reporting application on Amazon EC2 instances in us-west-2. The application queries an authoritative database hosted on an EC2 instance in us-east-1 through an existing inter-Region VPC peering connection. Each report performs thousands of sequential, dependent database requests, reads several gigabytes of data, and produces a summary smaller than 1 MB.

Tracing shows that the application spends most of its time waiting for network round trips. CPU utilization is low, database storage latency is consistently low, and network throughput is well below the instances' limits. The database must remain in its current location, and the company prohibits creating additional database copies. Reporting instances can be replaced, and interrupted reports can be restarted.

Which change will BEST reduce report completion time and inter-Region data transfer volume?

Show answerCORRECT ANSWER

Launch the reporting instances in the database instance's Availability Zone in us-east-1, query the database through private IP addresses, and transfer only completed summaries to us-west-2.

Running the reporting computation near the authoritative database removes inter-Region round trips from the database request path. The gigabytes of database reads remain local to the Availability Zone, while only the small completed summaries cross Regions. This meets the restrictions without creating another database copy.

SAP-C03

A company operates a document-analysis application in us-east-1 and maintains a warm disaster recovery deployment in us-west-2. Each deployment has a local copy of the documents. Inference requests contain several megabytes of document content and must use a specific Amazon Bedrock foundation model. Single-Region on-demand inference quotas cannot support peak traffic, and quota increases are unavailable.

The primary deployment uses a cross-Region inference profile. Security approved that profile after verifying that all its destination Regions, when invoked from us-east-1, are permitted by company policy. An SCP denies Bedrock inference in all other Regions.

During a recovery exercise, the application invokes the same profile through the us-west-2 Bedrock endpoint and receives authorization errors. Investigation confirms that the profile's destination list from us-west-2 includes a prohibited Region. The profile catalog also contains an alternative for the same model whose complete destination list from us-west-2 is approved and whose quotas meet peak requirements.

The company must preserve the Region restrictions and support peak traffic during recovery while minimizing application-managed inter-Region data transfer. Which solution should a solutions architect recommend?

Show answerCORRECT ANSWER

Validate the alternative profile's destination list from us-west-2, authorize invocation across its complete approved destination set, and configure the recovery deployment to invoke that profile through the local Bedrock endpoint.

A profile defines both the model and eligible destination Regions, and some profiles have different destinations depending on the source Region. Selecting the alternative validated for us-west-2 preserves the Region restrictions and provides the required cross-Region inference quotas. Bedrock automatically routes requests to the profile's destinations, avoiding an application-managed cross-Region relay.

Practice Data Locality in a full exam

Questions on Data Locality in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Data Locality

3 min read

Data locality means placing computation near the data it reads or writes, or placing frequently accessed data near its consumers. The objective is to avoid unnecessary network movement. A batch job that scans a large dataset benefits from running near the storage location, while a globally accessed website benefits from caching content near users. Locality is relative to the access pattern: the best location for analytics may differ from the best location for serving customers.

Cloud architecture applies this idea through Region selection, Availability Zone placement, replication, caching, and workload scheduling. First identify where data originates, where it is stored, and which applications consume it. Then map the network boundaries crossed by each important flow. A useful estimate is the volume transferred across each billable boundary multiplied by its applicable transfer rate, with storage, requests, and network processing charges calculated separately.

For AWS pricing questions, distinguish incoming transfer from outgoing transfer. Data transferred into AWS from the internet is generally free of data-transfer charges, but this does not make the entire operation free. Upload requests, storage, and any chargeable processing or networking components can still cost money. Data transferred from AWS to the internet generally incurs outgoing transfer charges, subject to service-specific pricing, allowances, and exceptions.

Transfers between AWS Regions generally incur inter-Region transfer charges. For common transfers such as copying Amazon S3 objects to another Region, the source incurs outgoing inter-Region transfer charges, while incoming transfer at the destination is generally free. Destination storage and replication-related requests remain separate costs. Always check the services and transfer direction involved rather than assuming that every transfer has the same billing treatment.

Within one Region, the Availability Zone and service pairing matter. Ordinary Amazon EC2 instance-to-instance traffic using private IP addresses within the same Availability Zone is generally free of transfer charges. Traffic between EC2 instances in different Availability Zones generally incurs regional transfer charges on both sides. However, service-specific exceptions exist: data transfer between Amazon S3 and EC2 in the same Region is generally free, even though S3 is a regional service rather than storage placed in a customer-selected Availability Zone. Therefore, neither “all internal traffic is free” nor “all cross-zone traffic is charged identically” is a reliable rule.

For example, an analytics team can run its processing workers in the same Region as its object storage rather than repeatedly reading terabytes across Regions. Filtering and aggregating locally before sending a small result elsewhere further reduces traffic. Similarly, a frequently communicating application and database can benefit from geographic proximity. Routing still matters: a NAT gateway or other intermediate component can introduce processing charges even when the underlying service-to-service transfer is free.

Locality must be balanced against availability and recovery requirements. Keeping every component in one Availability Zone may reduce transfer costs but exposes the workload to a shared failure boundary. Multi-zone deployments and cross-Region disaster recovery deliberately move data to improve resilience. Replicas and caches also require storage, synchronization, and decisions about stale reads. Data locality is not synonymous with data residency: proximity improves efficiency, whereas residency requirements constrain where data may be stored or processed. Choose placement using workload measurements, current pricing, recovery objectives, and applicable location requirements.

Learn Data Locality in lessons

7 short lessons on Data Locality in 6 certification courses.

and 1 more lesson

Open the lessons