This document provides a comprehensive analysis of the differences between Hadoop's original S3 and S3A (S3Advanced) filesystem implementations based on direct examination of the Hadoop codebase.
- Location:
~/hadoop/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/ - Status: DEPRECATED AND REPLACED
- Remaining Files: Only
S3xLoginHelper.javaandpackage.html- minimal codebase - Package Documentation: Explicitly states: "It has been replaced by the S3A client"
- URI Scheme:
s3:// - Maintenance: No active development
- Location:
~/hadoop/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/ - Status: ACTIVELY MAINTAINED - primary S3 implementation
- Scale: 72 subdirectories with comprehensive implementation
- Core Files:
S3AFileSystem.java(5,749 lines) - main implementationS3ABlockOutputStream.java(1,594 lines) - advanced output handling
- URI Scheme:
s3a:// - Configuration Prefix:
fs.s3a.*(notfs.s3.*)
- Buffer-all approach: All data buffered to disk before upload
- Single upload: Per
close()operation - Performance: Slow for large files, fills disk space
- Pattern: Simple but inefficient write pattern
- Fast Upload: Modern multipart upload architecture via
S3ABlockOutputStream - Parallel Block Uploads: Blocks uploaded in background threads while data is still being written
- Buffering Strategies: Three configurable options:
disk: Uses local directories (default, configurable viafs.s3a.buffer.dir)array: In-heap memory arraysbytebuffer: Off-heap direct ByteBuffers
- Key Configuration:
fs.s3a.multipart.size = 64M # partition size fs.s3a.multipart.threshold = 128M # when to start multipart fs.s3a.fast.upload.active.blocks = 4 # max concurrent uploads fs.s3a.fast.upload.buffer = disk # buffering strategy - Streaming Upload: Begins uploading as soon as buffered data exceeds partition size
- Optimized Close: Time limited to remaining data upload, not total file size
- Vectored IO: Multiple file ranges read with batching and merging
- Prefetching: Optional
S3ACachingInputStreamfor optimized reads - Input Policies (fadvise): Sequential, random, whole-file modes
- Seek Optimization: Configurable readahead range to minimize reconnections
- Block Size: Configurable via
fs.s3a.block.size = 32M
- List API Versions: Supports both ListV1 and ListV2
- Default:
fs.s3a.list.version = 2 - Pagination:
fs.s3a.paging.maximum = 5000keys per request - Performance: Significantly improved listing performance (HADOOP-17400)
- Relied on eventual consistency semantics (problematic until AWS S3 changed in November 2020)
-
Historical Challenge: AWS S3 was eventually consistent until November 2020
- Newly created objects excluded from directory listings
- Newly deleted objects retained in listings
- Deleted objects still visible in HEAD/GET probes
- 404 caching issues
-
S3Guard Solution (2016-2020): Used DynamoDB as metadata cache for consistency
-
Current State (Post-2020): AWS S3 provides read-after-write consistency
- S3Guard deprecated and removed (HADOOP-17409)
- Change detection via ETag or version IDs
- Configuration:
fs.s3a.change.detection.sourceandfs.s3a.change.detection.mode
- Minimum Part Size: 5MB (AWS S3 requirement)
- Default Part Size: 64MB (
fs.s3a.multipart.size) - Copy Operations: Also use multipart for large files
- Cleanup Management:
- Automatic purge of orphaned uploads (configurable age)
- Configuration:
fs.s3a.multipart.purge,fs.s3a.multipart.purge.age
- Multi-Object Delete:
- Enabled by default (
fs.s3a.multiobjectdelete.enable = true) - Bulk delete in single request (vs. individual DELETEs)
- Page size: 250 entries (not 1000) to avoid throttling
- Enabled by default (
- Used old JetS3t-based libraries
- No modern credential provider chain
- Limited authentication options
- Credential Interface:
software.amazon.awssdk.auth.credentials.AwsCredentialsProvider - Provider Chain:
- Temporary credentials (TemporaryAWSCredentialsProvider)
- Simple credentials (SimpleAWSCredentialsProvider)
- Environment variables
- EC2/Container Metadata Service (IAMInstanceCredentialsProvider)
- Advanced Features:
- Assumed Role support with STS
- Delegation tokens
- Per-bucket credential configuration
- Credential provider mapping for V1→V2 migration
- SSE-S3: AES256 server-side encryption
- SSE-KMS: Key Management Service encryption
- SSE-C: Customer-provided keys
- CSE-KMS: Client-side encryption
- Configuration:
fs.s3a.encryption.algorithm,fs.s3a.encryption.key
| Aspect | Configuration Key | Default Value |
|---|---|---|
| Authentication | ||
| Access Key | fs.s3a.access.key |
- |
| Secret Key | fs.s3a.secret.key |
- |
| Session Token | fs.s3a.session.token |
- |
| Connection Management | ||
| Connection Pool | fs.s3a.connection.maximum |
96 |
| Thread Pool | fs.s3a.threads.max |
(tunable) |
| Retry & Resilience | ||
| Retry Limit | fs.s3a.retry.limit |
7 |
| Retry Interval | fs.s3a.retry.interval |
500ms |
| Throttle Retry Limit | fs.s3a.retry.throttle.limit |
20 |
| Performance Tuning | ||
| Fast Upload Buffer | fs.s3a.fast.upload.buffer |
disk |
| Socket Send Buffer | fs.s3a.socket.send.buffer |
8192 bytes |
| Socket Recv Buffer | fs.s3a.socket.recv.buffer |
8192 bytes |
| Storage Options | ||
| Checksum Algorithm | fs.s3a.create.checksum.algorithm |
(none) |
| Storage Class | fs.s3a.create.storage.class |
Standard |
- All
fs.s3aoptions (exceptfs.s3a.impl) can be overridden per bucket - Pattern:
fs.s3a.bucket.BUCKETNAME.OPTION_NAME
| Operation | Characteristic | Configuration |
|---|---|---|
| Upload | Parallel background | fs.s3a.threads.max |
| Buffering | Three strategies | fs.s3a.fast.upload.buffer |
| Queuing | Task queue limit | fs.s3a.max.total.tasks |
| Seek | Readahead support | fs.s3a.readahead.range = 64K |
| Listing | Batch pagination | fs.s3a.paging.maximum = 5000 |
| Throttling | Exponential backoff | fs.s3a.retry.throttle.interval = 100ms |
| Vectored I/O | Range batching | fs.s3a.vectored.read.* |
- Rename: Not atomic - copies all files, then deletes originals
- Delete (dir): Not atomic - can fail partway through
- Time Complexity: Proportional to number of files and data size
- Network: Operations occur inside S3, don't depend on client bandwidth
- Magic Committer: Special support for task-parallel writes
- Configuration:
fs.s3a.committer.name(file, directory, partitioned, magic) - Staging: Uses consistent cluster filesystem (HDFS) for staging metadata
- Abort Handler: Cleanup of pending multipart uploads on job failure
- Auditing: Track S3 operations by job, user, filesystem operation
- S3Select: Server-side filtering support
- Delegation Tokens: Support for Kerberos environments
- Assumed Roles: Support for cross-account access
- S3 Express One Zone: Latest AWS storage option support
- Directory Markers: Configurable behavior for pseudo-directory tracking
- URI Change:
s3://bucket→s3a://bucket - Configuration Prefix:
fs.s3.*→fs.s3a.* - Credential Provider: Interface changes (V1 → V2 SDK)
- Mapping Support:
fs.s3a.aws.credentials.provider.mapping
- S3 implementation files are minimal (only login helper remains)
- S3 is NOT actively maintained
- All new features and optimizations go to S3A
- AWS SDK upgraded from V1 to V2 in Hadoop 3.4.0
Based on code analysis and documentation:
- Performance: S3 buffered entire files before upload; S3A uploads in parallel blocks
- Scalability: S3A supports modern multipart upload with background threads
- SDK Evolution: Move to modern AWS SDK versions with better features
- Consistency: S3A built-in support for consistency mechanisms (S3Guard, change detection)
- Enterprise Features: Committers, auditing, delegation tokens, S3Select
- Reliability: Better error handling, retry policies, instrumentation
- Efficiency: Configurable buffering strategies (disk, array, bytebuffer)
/hadoop/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/
s3native/ (DEPRECATED - original S3)
├── S3xLoginHelper.java
└── package.html (states "It has been replaced by the S3A client")
s3a/ (ACTIVE - S3A Advanced)
├── S3AFileSystem.java (5,749 lines - core)
├── S3ABlockOutputStream.java (1,594 lines)
├── S3AInputStream.java
├── S3AInstrumentation.java (metrics & statistics)
├── Constants.java (configuration)
├── impl/ (implementation details)
├── statistics/ (performance metrics)
├── s3guard/ (consistency - deprecated)
├── commit/ (committer architecture)
└── [68+ more files and subdirectories]
- ❌ Deprecated and unmaintained
- ❌ Poor performance for large files
- ❌ Limited authentication options
- ❌ No modern AWS SDK features
- ❌ No consistency guarantees
- ❌ Single-threaded uploads
- ✅ Actively maintained and feature-rich
- ✅ High-performance parallel uploads
- ✅ Modern AWS SDK v2 support
- ✅ Comprehensive authentication options
- ✅ Enterprise features (auditing, delegation tokens)
- ✅ Multiple buffering strategies
- ✅ Consistency management
- ✅ Advanced committer support
Recommendation: Use S3A for all new deployments. The original S3 implementation should only be encountered in legacy systems requiring migration to S3A.