Selecting ETL over ELT for SQL Injection Prevention

ADP By islever Editorial Last updated

Short answer

C ETL extracts data, transforms it by removing SQL injections in a preprocessing stage, and then loads the cleaned data into BigQuery, ensuring security before ingestion.

Question

You need to design a data pipeline that ingests data from CSV, Avro, and Parquet files into Cloud Storage. The data includes raw user input. You need to remove all malicious SQL injections before storing the data in BigQuery. Which data manipulation methodology should you choose?
  1. EL
  2. ELT
  3. ETL Correct Answer
  4. ETLT

Key Takeaways

ETL is the correct methodology because it transforms data to remove SQL injections before loading it into BigQuery. Unlike ELT, which loads raw data first, ETL ensures that untrusted input is sanitized in a separate processing environment, protecting the target database from malicious payloads.

Expert Analysis

ETL (Extract, Transform, Load) transforms data before loading, allowing SQL injection removal during the transform phase before data reaches BigQuery. EL (A) has no transform step. ELT (B) loads raw data first - risky with SQL injection. ETLT (D) is non-standard and adds unnecessary complexity.

The core decision in this scenario hinges on where the transformation logic occurs relative to the final storage location, specifically when dealing with untrusted input containing malicious SQL injections. The requirement is to ingest CSV, Avro, and Parquet files into Cloud Storage, but critically, to remove SQL injections before the data enters BigQuery. This constraint dictates a specific architectural pattern known as Extract, Transform, Load (ETL).

In an ETL workflow, data is first extracted from its source systems—in this case, the various file formats residing in or being moved to Cloud Storage. Once extracted, the data undergoes a transformation phase in a separate processing environment, such as Dataflow or Dataproc, rather than inside the target warehouse. It is during this intermediate stage that cleansing operations, including the detection and removal of malicious SQL injection patterns, are executed. Only after the data has been validated and sanitized does it get loaded into the final destination, BigQuery. This approach ensures that BigQuery never receives raw, potentially harmful data, thereby protecting the integrity of the analytical layer and preventing potential security vulnerabilities or query failures at the ingestion point.

Option A, EL (Extract, Load), is incorrect because it lacks any transformation capability. An EL process would simply move the raw files from their source into Cloud Storage or directly into BigQuery without modification. Since the requirement explicitly mandates the removal of SQL injections, an EL pipeline fails to meet the functional specification. There is no mechanism within pure EL to inspect or alter the content of the data stream before it lands.

Option B, ELT (Extract, Load, Transform), involves loading the raw data into the target system first—typically BigQuery—and then performing transformations using the computational power of the warehouse itself. While ELT is efficient for large-scale analytics where the source data is trusted, it poses a significant risk here. Loading raw user input with potential SQL injections directly into BigQuery exposes the database to immediate threats. Even if subsequent queries are parameterized, the presence of injected code in the raw data can lead to issues with data corruption, unintended execution contexts, or security breaches depending on how the data is accessed. Furthermore, relying on BigQuery for initial sanitization shifts the burden to the analytical engine, which may not be optimized for heavy pre-processing string manipulation compared to dedicated streaming tools.

Option D, ETLT, is not a standard industry methodology. It implies multiple rounds of extraction, transformation, and loading, which introduces unnecessary complexity and latency. For a straightforward requirement of cleaning data before final storage, a single pass through the ETL cycle is sufficient and optimal. Adding redundant steps degrades performance and complicates maintenance without providing additional value.

Therefore, choosing ETL aligns best with the security and data quality constraints. By transforming the data in a controlled environment before it touches BigQuery, you ensure that only clean, safe data resides in your analytical store. This separation of concerns allows for robust validation logic, such as regex filtering or schema enforcement, to be applied consistently across all incoming file types (CSV, Avro, Parquet) regardless of their structure, ensuring a secure and reliable data pipeline.

Practice All ADP Questions

Access 65 questions with complete answers and detailed explanations.

View Full ADP Practice Test →

← Back to ADP Study Guide