Set Up Amazon S3 Tables and Amazon Athena for Higher Transaction Throughput and Automatic Small-File Compaction Through the AWS Console - Part 1
Set Up Amazon S3 Tables and Amazon Athena for Higher Transaction Throughput and Automatic Small-File Compaction Through the AWS Console - Part 1
Series: Financial Service (33 articles)
- …
- 30Set Up Amazon S3 Tables and Amazon Athena for Higher Transaction Throughput and Automatic Small-File Compaction Through the AWS Console - Part 1 This article
Amazon S3 Tables provides a table-oriented S3 storage capability designed for analytical workloads in Apache Iceberg format. A table bucket stores namespaces and tables as managed resources rather than exposing a conventional general-purpose S3 folder as the table contract. This distinction matters for financial-services trading desks because market, order, execution, allocation, position, reference, risk, surveillance, and regulatory datasets are not merely collections of Parquet files. They require committed snapshots, concurrent-writer coordination, reproducible reads, controlled schema evolution, and continuous maintenance.
AWS describes S3 table buckets as delivering higher transactions per second and better query throughput than self-managed Iceberg tables in general-purpose S3 buckets. The transaction-throughput improvement refers to Iceberg table commits and related table operations. It does not mean that S3 Tables should replace an order-management system, matching engine, pre-trade risk engine, or low-latency transactional database. A trading desk should use S3 Tables for analytical and data-engine workloads in which frequent data ingestion, micro-batch commits, corrections, and concurrent table operations create pressure on a self-managed Iceberg catalog and maintenance layer.
Small files are one of the most persistent operating problems in a trading-data lake. Streaming and frequent micro-batch writers often create many small Parquet files because each batch is intentionally bounded for freshness and recovery. Those files increase object requests, metadata planning, file-open overhead, query task scheduling, and scan inefficiency. S3 Tables performs managed maintenance, including compaction, snapshot management, and removal of unreferenced files. Compaction combines smaller files into larger files so that query engines such as Amazon Athena can plan and read fewer objects.
The configuration in this guide uses the AWS Management Console as the primary setup path. The guide creates the security boundary, creates an S3 table bucket, enables integration with AWS Glue Data Catalog, grants access, registers the S3 Tables catalog in Athena where required by the selected console path, creates and queries an Iceberg table, validates transaction throughput, and configures and observes compaction.
The console names and available controls can vary by AWS Region, account configuration, and service release. Use one supported Region consistently for S3 Tables, AWS Glue Data Catalog, Lake Formation, Athena, and the query-results bucket unless the architecture explicitly requires another arrangement.
Step 1: Define the Trading-Desk Data Product and AWS Region
Before opening the AWS console, define one bounded data product for the first deployment. A normalized execution-events table is a suitable pilot because it represents a real analytical workload without placing the order-entry hot path inside an analytical table service.
Define the source systems, business owner, technical owner, expected daily rows, peak rows per minute, expected commit frequency, retention period, common query predicates, correction behavior, and downstream consumers. Record whether writers are append-only or whether they perform updates, deletes, or merges.
Define the meaning of TPS for the pilot. Measure table commits per second, concurrent writers, successful commits, retried commits, failed commits, rows per commit, files per commit, and end-to-end data freshness. Do not use exchange-order TPS or financial-trade TPS as if it were the same metric.
Choose an AWS Region that supports S3 Tables and all required integrations. In the AWS Management Console, use the Region selector in the upper-right corner. Select the Region and keep it unchanged throughout the setup.
Record the AWS account ID, selected Region, table-bucket naming convention, namespace naming convention, table name, Athena workgroup name, and Athena query-results location.
Use names that do not expose restricted client, strategy, trader, or market-sensitive information. A suitable logical naming pattern is
fsi-trading-analytics-prod for the table bucket, executions for the namespace, and normalized_execution_events for the table.Step 2: Create the IAM Administrative and Runtime Roles
Sign in to the AWS Management Console through IAM Identity Center using an approved cloud-platform administration permission set. Avoid using the root user and avoid creating long-lived IAM access keys for human users.
Open the IAM console. In the left navigation pane, choose Roles. Choose Create role.
Select AWS account as the trusted entity when creating a role for authorized workforce federation, or select the relevant AWS service when creating a service role. Follow the enterprise identity pattern rather than inventing a separate authentication path for the pilot.
Create a role for S3 Tables administration. Give it a name such as
S3TablesPlatformAdminRole . This role is responsible for creating table buckets, namespaces, tables, integration settings, and maintenance configuration.Create a separate role for Athena query execution, such as
AthenaS3TablesQueryRole , when the enterprise uses role separation. This role requires permissions for Athena, the relevant AWS Glue Data Catalog resources, S3 Tables table-bucket and table resources, the Athena query-results bucket, and KMS keys when customer-managed encryption is used.Create a separate writer role for ingestion, such as
TradingExecutionIngestionRole . It should be able to discover the intended namespace and table, read table metadata required for committing, write table data, and update the table metadata location through the supported catalog transaction. It should not receive broad administrative permissions over unrelated tables.Open each role and choose the Permissions tab. Add only the actions required by the selected access path. For Athena operations against S3 Tables, AWS documentation identifies S3 Tables actions including
s3tables:GetTableBucket , s3tables:GetNamespace , s3tables:GetTable , s3tables:GetTableData , s3tables:PutTableData , s3tables:ListNamespaces , s3tables:ListTables , s3tables:CreateNamespace , s3tables:CreateTable , s3tables:DeleteNamespace , s3tables:DeleteTable , and s3tables:UpdateTableMetadataLocation for the complete supported operation set. Restrict the Resource element to the intended table bucket, namespace, and table where supported.Grant AWS Glue Data Catalog permissions for the catalog, database, and table resources exposed through the integration. Grant Athena permissions for starting queries, retrieving query results, and reading workgroup configuration. Grant access to the Athena result bucket. Add KMS permissions only when the selected S3 Tables, catalog, or result-storage path uses a customer-managed key.
Open the Trust relationships tab for each role. Confirm that only the approved identity provider, service, or account can assume the role. Add conditions required by the enterprise, such as the organization ID, external ID, source account, or principal tags.
Do not attach
AdministratorAccess to application roles. A short pilot does not justify a permanent control weakness.Step 3: Create the Athena Query-Results Bucket
Open the Amazon S3 console. Choose General purpose buckets in the left navigation pane. Choose Create bucket.
Enter a globally unique name such as
company-athena-results-region-accountid . Select the same Region used for S3 Tables and Athena.Leave Block Public Access enabled. Do not use the query-results bucket as a public reporting location.
Enable bucket versioning when required by the enterprise retention policy. Configure default encryption. Use Amazon S3 managed keys for a simple pilot or a customer-managed AWS KMS key when the institution requires explicit key administration, revocation, cross-account control, or separation of duties.
Choose Create bucket.
Open the new bucket. Choose the Management tab. Add a lifecycle rule for old Athena query results only after confirming the enterprise evidence and audit policy. Query results may contain sensitive trading or client data. Retention must follow policy rather than convenience.
Open the Permissions tab. Confirm that public access remains blocked. Add a bucket policy only if the Athena query role needs explicit access beyond identity-based permissions.
Step 4: Create the Amazon S3 Table Bucket
In the Amazon S3 console, choose Table buckets in the left navigation pane. Choose Create table bucket.
Enter the table-bucket name. Follow the displayed naming requirements. Use an environment and domain name that remains valid when teams or projects change.
Confirm the selected AWS Region. Table buckets are regional resources, and the analytics integration and permissions must use the same intended Region.
Review the available encryption settings. Select the encryption configuration required by the enterprise. If a customer-managed KMS key is available for the current console experience, select the approved key and ensure that administrative, writer, and reader roles have the required key permissions. If the service uses its documented default encryption path for the selected configuration, record that decision.
Choose Create table bucket.
Open the new table bucket. Record its Amazon Resource Name. The table-bucket ARN is required for resource policies, catalog configuration, REST catalog clients, and operational documentation.
Open the Permissions or policy area presented by the console. Add or review the table-bucket policy. Allow the platform role to administer the table bucket. Allow the ingestion and query roles only the data and metadata actions they require.
Use explicit principals and resource conditions. Do not use anonymous principals. Add organization or account conditions when appropriate.
Step 5: Create the Namespace
Inside the table bucket, choose Create namespace.
Enter
executions as the namespace for the pilot, or use the approved domain name. A namespace groups related Iceberg tables and becomes part of catalog discovery and permissions.Choose Create namespace.
Open the namespace and record its ARN or resource identifier shown by the console. Confirm that the table-administration role can manage it and that the query and ingestion roles can discover it.
Use separate namespaces when business ownership, access, retention, or regulatory classification differs materially. Do not place public reference data and restricted client execution data under one broad permission simply because they are both used by a trading desk.
Step 6: Enable Amazon S3 Tables Integration with AWS Glue Data Catalog
Open the AWS Glue console in the same Region. In the left navigation pane, locate Data Catalog settings, Data Catalog, or the S3 Tables integration section shown by the current console.
Choose the option to enable Amazon S3 Tables integration with AWS Glue Data Catalog. Review the prerequisites displayed by the console.
Allow the console to create the required service-linked role or integration role only after reviewing its trust policy and attached permissions. Record the generated role name.
Select the table bucket or account-level integration scope required by the current console. Confirm the integration.
Wait until the integration status reports success. Do not continue with Athena until the S3 table-bucket catalog and resources are visible through the integration.
Open AWS Glue Data Catalog. Choose Catalogs. Locate the catalog created or exposed for S3 Tables. Open it and confirm that the table bucket appears.
Open Databases or the equivalent namespace view. Confirm that the
executions namespace is visible.If the namespace is not present, return to the S3 console and confirm that the namespace exists in the same Region. Review the integration status, service-linked role, IAM permissions, and CloudTrail events for denied operations.
Step 7: Configure AWS Lake Formation or IAM Access Control
Open the AWS Lake Formation console in the same Region.
Open Administration and choose Administrative roles and tasks or Data lake administrators. Add the approved data-governance administrator. Avoid assigning every platform engineer as a Lake Formation administrator.
Open Data catalog settings. Review the default permission model. Decide whether the pilot uses IAM-only access, Lake Formation access control, or hybrid access mode. Use the enterprise standard and document the choice.
For Lake Formation permissions, choose Data lake permissions and then Grant.
Select the principal for the Athena query role. Select the S3 Tables catalog, namespace, and table resources exposed by the integration. Grant DESCRIBE and SELECT for read-only analysis. Add INSERT, DELETE, or ALTER only when Athena is explicitly authorized to perform those operations in the chosen environment.
Select the ingestion role. Grant the catalog and table permissions required to write and commit data. Do not grant access to unrelated namespaces.
Choose Grant.
Return to Data lake permissions and verify the entries. Confirm that no broad principal has uncontrolled access to restricted trading data.
If IAM-only access is used, verify that the query principal has permissions on both AWS Glue Data Catalog resources and S3 Tables resources. Athena documentation requires access across both control planes for S3 Tables operations.
Step 8: Create the Iceberg Table
Open the Amazon S3 console. Choose Table buckets, open the pilot table bucket, and open the
executions namespace.Choose Create table if the console provides table creation for the selected Region and service release.
Enter
normalized_execution_events as the table name.Define the schema using the console controls. Create fields for
event_id , source_system , source_sequence , order_id , execution_id , instrument_id , venue , side , quantity , price , currency , event_timestamp , business_date , ingestion_timestamp , correction_reference , payload_hash , schema_version , and validation_status .Use string fields for stable textual identifiers. Use decimal fields for quantity and price with precision and scale selected from the actual source contract. Use timestamp fields with explicitly documented timezone semantics. Use a date field for the controlled business date when required by query patterns.
Set required and optional fields deliberately. An execution identifier may not exist for an order event, but it should be required for a normalized execution table unless the business contract explicitly permits pending records.
Configure partitioning. Use an Iceberg day transform on
event_timestamp or partition by the controlled business_date when that matches the access pattern. Avoid partitioning directly by high-cardinality values such as execution_id or order_id .Choose Create table.
If the S3 console does not expose schema creation for the intended path, create the table through the supported Athena or Spark integration after catalog registration. Use the same schema contract and confirm that the resulting table appears under the S3 table bucket and namespace.
Open the created table. Record its ARN, metadata status, format version, and maintenance status.
Step 9: Create and Configure the Amazon Athena Workgroup
Open the Amazon Athena console in the same Region.
Choose Workgroups in the left navigation pane. Choose Create workgroup.
Enter
s3_tables_trading_analytics as the workgroup name. Select the SQL analytics engine and use the current Athena engine version supported for S3 Tables.Under Query result configuration, enter the S3 URI of the Athena query-results bucket created earlier. Enable result encryption. Select the approved encryption option and KMS key when required.
Enable the option to override client-side settings. This prevents individual users from directing sensitive results to uncontrolled locations.
Set per-query or workgroup data-usage controls if the console provides them. Configure CloudWatch metrics. Add tags for environment, business owner, technical owner, cost center, and data classification.
Review the encryption limitation before enabling write operations. Athena documentation states that write operations such as INSERT, UPDATE, DELETE, and MERGE cannot run on S3 Tables in workgroups configured with SSE-KMS or CSE-KMS query-result encryption. Separate read-only and write-enabled workgroups when the enterprise requires KMS-encrypted result storage and also requires Athena DML. Do not weaken encryption without security approval.
Choose Create workgroup.
Select the workgroup and choose Switch workgroup.
Step 10: Register or Select the S3 Table-Bucket Catalog in Athena
In the Athena console, choose Data sources or Data source manager.
Look for the S3 Tables catalog that was created by the AWS Glue integration. If it is already present, open it and confirm its status.
If the console requires registration, choose Create data source.
Select the data-source option for Amazon S3 table-bucket catalogs or AWS Glue Data Catalog. Enter a catalog name such as
s3tables_trading_catalog .Select the Glue catalog or S3 table-bucket catalog that represents the target table bucket. Select the same Region.
Choose Create data source or Register catalog.
Wait until the data source status becomes active.
Return to the Athena query editor. In the Data source selector, select the registered S3 Tables catalog. In the Database selector, select the
executions namespace.Confirm that
normalized_execution_events appears in the Tables panel.Athena documentation notes that DDL operations are limited for S3 Tables registered as Athena data sources. The service also directs compaction and snapshot maintenance to S3 Tables rather than Athena
OPTIMIZE and VACUUM . Use S3 Tables maintenance controls for these functions.Step 11: Insert Pilot Data Through Athena
Use the query editor in the intended non-production environment. Confirm that the selected workgroup supports the planned DML and does not have an incompatible query-result encryption or Requester Pays configuration.
Enter an INSERT statement using values that do not contain real client or restricted production information.
INSERT INTO normalized_execution_eventsVALUES( 'evt-000001', 'exchange-a', 1000001, 'ord-10001', 'exe-90001', 'instrument-abc', 'venue-x', 'BUY', DECIMAL '100.0000', DECIMAL '25.12500000', 'USD', TIMESTAMP '2026-10-30 09:30:00.000', DATE '2026-10-30', CURRENT_TIMESTAMP, NULL, 'sample-hash-000001', 1, 'VALIDATED');Choose Run.
Open the Query results pane. Confirm that the operation succeeded. Open Recent queries and record the query execution ID.
Run a SELECT statement.
SELECT event_id, order_id, execution_id, instrument_id, quantity, price, business_date, validation_statusFROM normalized_execution_eventsWHERE business_date = DATE '2026-10-30';Choose Run. Confirm that the inserted row appears.
For larger ingestion, use AWS Glue, Amazon EMR Spark, an Iceberg REST client, or another supported writer rather than issuing millions of individual INSERT statements. The objective is to create appropriately sized micro-batches and files while using the catalog transaction path.
Step 12: Configure a Transaction-Throughput Test
Create a non-production load test that reflects the trading desk’s actual commit behavior. A meaningful test varies concurrent writers, rows per commit, files per commit, partition skew, and update type.
In the Athena console, open Query editor and Recent queries. Use Athena for controlled SQL commits and query verification. Use AWS Glue or EMR for higher-concurrency Spark write testing where the intended production writer is Spark.
For AWS Glue, open the AWS Glue console. Choose ETL jobs. Choose Create job and select a Spark job type. Choose a current Glue version with the required Iceberg and S3 Tables support.
Assign the ingestion IAM role. Configure the S3 Tables or Glue Iceberg REST catalog according to the integration path. Use temporary role credentials and the table-bucket ARN. Do not place access keys in job parameters.
Configure the job to generate or ingest synthetic test data. Mark it clearly as synthetic. Create a deterministic batch identifier for every commit. Write batches at the intended micro-batch size.
Start with one writer. Record committed batches per minute, rows per batch, files per batch, commit latency, and end-to-end freshness.
Increase concurrency gradually. Observe successful commits, retried commits, validation conflicts, job failures, and table freshness. Do not jump directly to the maximum load because the purpose is to identify the point at which contention, file creation, or downstream maintenance changes behavior.
For append-heavy tests, use independent batch identifiers and non-overlapping source ranges. For MERGE, UPDATE, or DELETE tests, deliberately include overlapping partitions because rewrite conflicts are materially different from append conflicts.
Use CloudWatch Logs for the Glue or EMR job. Search for commit retries, validation exceptions, throttling, and S3 503 Slow Down messages.
Calculate committed Iceberg transactions per second from confirmed successful commits during the measured interval. Keep separate figures for append commits and row-level rewrite commits. Record the p50, p95, and p99 commit latency.
Compare S3 Tables with the existing self-managed Iceberg baseline using the same data distribution, batch size, writer count, Region, encryption, and engine version. Do not claim a percentage improvement from tests that use different workloads.
Series: Financial Service (33 articles)
- …
- 30Set Up Amazon S3 Tables and Amazon Athena for Higher Transaction Throughput and Automatic Small-File Compaction Through the AWS Console - Part 1 This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article