UNIT 1: Data Management, Architectures, and Security Frameworks
1. Data Engineering Fundamentals
Data Engineering is the discipline of designing, building, and maintaining systems and infrastructure for collecting, storing, processing, and analyzing large volumes of data. It focuses on creating reliable, scalable, and efficient data pipelines to support analytics, machine learning, and business intelligence.
Data Engineering Lifecycle (Often depicted as a cyclical process):
| Stage | Primary Goal | Key Activities & Security Considerations |
|---|---|---|
| 1. Data Ingestion | Acquire data from source systems. | Connect to APIs, databases, streams (Kafka). Security: Authenticate sources, encrypt in-transit (TLS/SSL), validate data formats to prevent injection attacks. |
| 2. Data Storage | Persist data reliably & accessibly. | Choose storage (Data Lake, Warehouse, DB). Security: Encrypt at-rest (AES-256), implement IAM policies, manage keys (KMS), classify sensitive data (PII). |
| 3. Data Processing | Transform raw data into usable formats. | ETL/ELT, cleansing, enrichment, aggregation. Security: Sanitize inputs, run in isolated environments, audit transformation logic, enforce least-privilege for processing jobs. |
| 4. Data Serving | Make data available to consumers. | Serve via APIs, dashboards, BI tools. Security: Implement API gateways, rate limiting, access controls (RBAC), data masking for sensitive fields. |
| 5. Data Consumption & Monitoring | End-users & apps use data; system health. | Query execution, report generation. Security: Log all access (who, what, when), monitor for anomalous queries, set up alerts for data exfiltration patterns. |
| 6. Orchestration & Metadata Mgmt. | Automate & govern the pipeline. | Schedule workflows (Airflow), track lineage, manage metadata. Security: Secure orchestration tools, audit metadata changes, ensure lineage integrity for compliance (GDPR, HIPAA). |
[!TIP] Exam Focus: Be prepared to draw this lifecycle cycle and explain each stage with a security control example. The lifecycle is a frequent 7-mark question.
2. Enterprise and Data Frameworks
A. Zachman Framework
A schema for organizing enterprise architecture (EA) artifacts. It's a 6x6 matrix that classifies descriptive representations (What, How, Where, Who, When, Why) from different perspectives (Planner, Owner, Designer, Builder, Subcontractor, Enterprise).
-
Purpose: Provides a comprehensive, logical structure for defining and documenting an enterprise's architecture, ensuring all stakeholder concerns are addressed.
-
Security Relevance: The "Why" column (Motivation) is critical for documenting security policies, compliance requirements, and risk management rationale. The "Who" column identifies security roles and responsibilities.
-
Visual:
DiagramCANVAS: A 6x6 grid. Rows: Planner (Scope), Owner (Business), Designer (System), Builder (Technology), Subcontractor (Detailed), Enterprise (Functioning). Columns: What (Data), How (Function), Where (Network), Who (People), When (Time), Why (Motivation).
B. Gartner Data Maturity Model
A model with 5 levels to assess an organization's data management sophistication.
| Level | Name | Characteristics | Example |
|---|---|---|---|
| 1 | Aware | Data seen as a by-product. Siloed, reactive. No formal governance. | Departments use Excel; no central data team. |
| 2 | Developing | Some centralized efforts (data warehouse). Basic tools. Limited governance. | A central BI team builds reports; manual data cleaning. |
| 3 | Defined | Standardized processes, formal data governance, data quality programs. | Data catalog exists, data stewards appointed, defined KPIs. |
| 4 | Managed | Data is a strategic asset. Measurable business value. Advanced analytics. | Predictive models drive revenue; data product thinking. |
| 5 | Optimized | Data-driven culture. AI/ML pervasive. Continuous optimization. | Real-time personalization, autonomous operations. |
[!TIP] Exam Focus: Know the 5 levels in order and be able to give a concrete example for Level 3 (Defined) and Level 5 (Optimized). Link maturity to security posture (e.g., higher maturity implies better data classification & access controls).
3. Data Governance and Lineage
Data Governance is the overall management of data availability, usability, integrity, and security. It's a framework of policies, standards, processes, and roles to ensure data is a trusted, strategic asset.
-
Core Pillars:
-
Policies & Standards: Rules for data quality, privacy (GDPR), security (classification).
-
Roles & Responsibilities: Data Owners (accountable), Data Stewards (manage), Data Custodians (implement).
-
Processes: Data quality management, issue resolution, change management.
-
Metrics & Monitoring: KPIs for data quality, policy compliance.
-
-
Security Link: Governance mandates data classification (Public, Internal, Confidential, Restricted), which directly drives access control policies and encryption requirements.
Data Lineage Tracking in DataOps is the ability to track data's journey from source to consumption, showing transformations, movements, and dependencies. Critical for debugging, impact analysis, compliance, and trust.
-
Pattern-Based Lineage: Automatically infers lineage by analyzing code/logic patterns in transformation scripts (SQL, Spark jobs).
-
Example: A tool scans all
INSERT INTO ... SELECT ...SQL statements to map source tables to target tables. -
Advantage: Automated, works with existing code.
-
Limitation: Can miss lineage from external sources or manual steps.
-
-
Lineage by Data Tagging: Manually or semi-automatically attach metadata tags (e.g.,
source_system: CRM,PII: true) to datasets at each stage.-
Example: Tag a table in the data warehouse as
derived_from: sales_db.ordersandcontains: customer_email. -
Advantage: Granular, captures business context.
-
Limitation: Requires discipline, prone to human error.
-
[!TIP] Exam Focus: Contrast the two lineage methods clearly. For the 7-mark question, use a single, consistent example (e.g., a customer data pipeline) to illustrate both techniques.
4. Data Architectures and Patterns
Types of Data Architectures (with Pros/Cons):
| Architecture | Description | Advantages | Disadvantages | Security Implications |
|---|---|---|---|---|
| Monolithic / Traditional EDW | Single, structured repository (e.g., Teradata). | High performance for known queries, strong ACID. | Inflexible, expensive, poor for unstructured data. | Centralized security controls, but a single point of failure. |
| Data Lake | Store raw, unstructured/semi-structured data (e.g., S3, ADLS). | Schema-on-read, scalable, cheap storage, all data types. | Can become "data swamp" without governance, performance issues. | Critical: Requires strict access controls & encryption on raw data. Governance (catalog, tagging) is essential to avoid chaos. |
| Lakehouse | Combines Data Lake (storage) + Data Warehouse (management). (e.g., Delta Lake, Iceberg). | ACID transactions on data lake, unified governance, cost-effective. | Emerging tech, complexity in management. | Built-in features like time travel aid in audit & compliance. |
| Data Fabric | Unified architecture providing data access across disparate sources (hybrid/multi-cloud). | Agility, self-service, virtualized view. | Complex to implement, potential performance overhead. | Challenge: Enforcing consistent security policies across virtualized layers and underlying sources. |
Data Lake Patterns:
-
Merits: Single source of truth for all data, enables exploratory analytics/ML, cost-effective storage, flexible schema.
-
Applications: Storing IoT sensor data, social media feeds, log files, raw backup data for future use cases.
-
Key Pattern: "Landing Zone" pattern: Raw data ingested into a "bronze" zone, then refined to "silver" (cleaned) and "gold" (business-level) zones.
Lambda Architecture (for Real-Time Processing):
A hybrid architecture processing both batch and stream data to balance latency and accuracy.
-
Batch Layer (Speed Layer): Processes all historical data at rest (Hadoop/Spark). Outputs accurate, comprehensive views (slow, hours).
-
Speed Layer (Real-Time Layer): Processes incremental, real-time stream (Kafka/Flink). Outputs low-latency, approximate views (seconds).
-
Serving Layer: Merges batch and speed views to serve queries. Provides a single, up-to-date view.
Security Note: Securing both layers is complex. Batch layer needs secure storage (HDFS encryption). Stream layer needs secure brokers (TLS) and consumer auth.
Kappa Architecture:
A simplified alternative to Lambda. Only a stream processing layer is used.
-
All data is treated as a stream. Historical data is re-processed by replaying the stream from a persistent log (Kafka).
-
Advantage: Simpler codebase (one processing logic).
-
Disadvantage: Requires powerful stream processing for large historical reprocessing.
-
Security: Focus on securing the immutable log (Kafka) and stream processors.
Streaming Architecture for Time-Series Pattern Detection:
-
Goal: Detect anomalies/patterns (e.g., fraud, sensor failure) in continuous data.
-
Typical Stack: Sources (IoT sensors) → Message Broker (Kafka) → Stream Processor (Apache Flink, Spark Streaming) → Alerting/Storage (Elasticsearch, DB).
-
Key Operations: Windowing (tumbling/sliding), stateful processing (tracking session), complex event processing (CEP).
-
Example: Detect a temperature spike:
(sensor_id, temp > 100) OVER (last 5 minutes) -> ALERT. -
Security: Secure sensor-to-broker communication, validate stream data, monitor processor resource usage (DoS risk).
[!TIP] Exam Focus: Lambda vs. Kappa is a classic 7-mark question. Draw a simple diagram for each. For streaming, know the components and a concrete pattern detection example (e.g., credit card fraud:
3 transactions in 2 mins, different locations).
5. Data Integration and Warehouse Design
Extract, Transform, Load (ETL) Process:
-
Extract: Pull data from source systems (DB, API, files). Security: Use secure connectors, credentials in vaults.
-
Transform: Clean, structure, enrich data (filter nulls, join, aggregate). Security: Sanitize to prevent SQLi, apply data masking for PII.
-
Load: Write transformed data to target (Data Warehouse). Security: Use bulk load with encrypted connections, validate row counts.
Example (Retail): Extract sales from POS DB & web logs → Transform (merge, calculate total, mask customer emails) → Load into
fact_salestable in Redshift.
Schema Migration: The process of changing the structure (schema) of a database or data warehouse.
-
Types:
-
Schema Evolution: Adding new columns/tables (backward compatible).
-
Schema Transformation: Renaming, changing data types, splitting tables (requires data migration).
-
-
Example: Migrate a
userstable from(id, name, address)to(id, first_name, last_name, street, city, state, zip). This requires a transformation script to splitnameandaddress. -
Security Impact: Migration scripts must be reviewed to avoid accidental data exposure. Ensure new schema has appropriate constraints and permissions.
Step-by-Step Data Warehouse Design: University Case Study (3-Marker Outline):
-
Requirements Gathering: Identify key processes (Admissions, Academics, Finance). Key questions: "What is student pass rate by course?" "What is fee collection trend?"
-
Dimensional Modeling (Kimball): Design Star Schema.
-
Fact Tables:
Fact_Enrollments(student_id, course_id, date_id, grade, credits). -
Dimension Tables:
Dim_Student(demographics),Dim_Course(details),Dim_Date(calendar).
-
-
Source System Analysis: Map source data (Student Info System, LMS, Finance DB) to target dimensions/facts.
-
ETL Design: Define how to extract, transform (e.g., calculate GPA), and load into the star schema.
-
Security & Governance: Implement row-level security (e.g., faculty see only their students), data classification (student data = Confidential), audit logs on fact table access.
-
Deploy & Test: Build, test with sample queries, validate results.
-
Maintain: Schedule ETL, monitor performance, manage slowly changing dimensions (SCD).
[!TIP] Exam Focus: For the 3-mark question, list the 5-6 key steps concisely. For a 7-mark ETL question, use a specific example (like Retail above) and walk through E, T, L with security touches.
6. Data Acquisition Techniques
Webhooks:
A user-defined HTTP callback (or small code snippet) that is triggered by a specific event in a source system. It's a push mechanism for real-time data delivery.
-
How it works:
-
Client (your app) registers a URL (webhook endpoint) with the source system (e.g., GitHub, Stripe).
-
When an event occurs (e.g., "new commit", "payment succeeded"), the source system POSTs a JSON payload to your URL.
-
Your endpoint receives and processes the data immediately.
-
-
Example: A GitHub webhook sends a payload to your CI/CD server whenever code is pushed to the
mainbranch, triggering an automated build. -
Security: Validate the request signature (HMAC) to ensure it's from the legitimate source. Use HTTPS. Implement rate limiting.
Web Scraping:
Automated programmatic extraction of data from websites. Used when no API exists.
-
Hypothetical Scenario:
https://www.rgpvonline.com- Find all representatives with press releases about "data". -
Step-by-Step Approach:
-
Inspect: Analyze site structure (HTML). Find URLs listing representatives and their press release pages.
-
Crawl: Use a library (Python:
Scrapy,BeautifulSoup+Requests) to:-
Crawl the main representatives listing page.
-
Extract links to individual representative pages.
-
For each rep, crawl their "Press Releases" section.
-
-
Scrape & Filter: On each press release page, extract text. Filter for pages containing the keyword "data" (case-insensitive).
-
Store: Save representative name, press release title, URL, and snippet containing "data" to a CSV/DB.
-
-
Ethical & Legal Considerations:
-
Check
robots.txt(guideline, not law). -
Respect
rate-limiting(don't hammer the server). -
Review Terms of Service - scraping may be prohibited.
-
Copyright: Data facts may be free, but compilation/expression might be protected.
-
Security: Scraped data may contain PII - handle per data governance policy.
-
[!TIP] Exam Focus: For the 11-mark webhooks question, detail the step-by-step workflow and emphasize security (signature validation). For web scraping, present the algorithmic steps for the given scenario and discuss legality/ethics - a common follow-up.
7. Security Protocols and Operational Controls
Secure Copy Protocol (SCP):
A network protocol based on SSH for secure transfer of files between a local and a remote host (or between two remote hosts).
-
How it works:
-
Establishes an SSH connection (port 22) for authentication and encryption.
-
Uses the SSH connection to execute the
scpcommand on the remote host. -
Files are encrypted during transfer using the SSH session's symmetric cipher (e.g., AES).
-
-
Command Example:
scp -P 2222 file.txt user@remotehost:/path/ -
Security Features: Relies on SSH's strong encryption, host key verification (prevents MITM), and authentication (password/public key).
-
Limitations vs. SFTP: SCP is simpler but older. It has fewer features (no directory listing, resume, or permission control) and can be less secure in edge cases (e.g., filename expansion vulnerabilities). SFTP (SSH File Transfer Protocol) is generally preferred for its robustness and richer command set over the same SSH connection.
Logging, Monitoring, and Alerting (The LMA Triad):
A core operational security control for data systems.
| Component | Purpose | Key Activities & Tools | Security Output |
|---|---|---|---|
| Logging | Record system & user events. | Generate logs (access, error, audit). Use structured logging (JSON). Tools: Fluentd, Logstash. | Immutable audit trail for forensics. |
| Monitoring | Track health & performance metrics. | Collect metrics (CPU, latency, error rates). Visualize (Grafana). Tools: Prometheus, CloudWatch. | Detect anomalies (spike in DB queries, failed logins). |
| Alerting | Notify on critical events. | Define thresholds/rules. Route alerts (Slack, PagerDuty). Tools: Alertmanager, Datadog. | Real-time response to breaches (e.g., "Data warehouse export > 1GB in 1 min"). |
-
Integrated Workflow Example:
-
Log: A user runs
SELECT * FROM customer_ssn→ Access log records(user, query, timestamp). -
Monitor: SIEM (Splunk, ELK) correlates this with the user's role (should not access SSN). Metric: "Unauthorized table access count" spikes.
-
Alert: Rule triggers:
IF unauthorized_table_access > 0 THEN alert SOC team.
-
-
Critical Security Practices: Centralize logs (prevent tampering), enforce log retention (compliance), protect log integrity (write-once storage), and regularly review alert rules.
[!TIP] Exam Focus: For SCP, contrast it with SFTP and state why SFTP is often recommended. For LMA, describe the flow from logging to alerting with a concrete security incident example (like the unauthorized query above). This is a high-frequency 7-mark question.