Data, Analytics and AI Cloud ArchitecturesIntroductionCloud platforms have transformed data and artificial intelligence (AI) from individually procured infrastructure into elastic, managed capabilities. Contemporary organisations can ingest events continuously, retain data in low-cost object storage, query heterogeneous datasets, train models using specialised accelerators, and expose analytical or generative-AI services globally. The architectural challenge is not simply selecting a cloud product. It is designing a trustworthy flow from data creation to business decision while controlling cost, latency, security, legal exposure and operational complexity. A modern data-and-AI architecture must reconcile several tensions: batch versus real-time processing, flexibility versus governance, centralisation versus data sovereignty, experimentation versus reproducibility, and model capability versus safety. This chapter examines the major architectural patterns and the engineering controls required to operate them at postgraduate level. Learning ObjectivesAfter studying this chapter, a learner should be able to: - Distinguish data lakes, warehouses, lakehouses and managed analytics platforms.
- Design batch and streaming ingestion and processing pipelines.
- Select architectural patterns using latency, consistency, scale, cost and governance criteria.
- Explain the infrastructure requirements of machine learning and generative AI.
- Design MLOps controls for reproducibility, deployment, monitoring and rollback.
- Evaluate privacy, sovereignty, security, responsible-AI and model-governance risks.
- Critically assess a cloud analytics architecture in a realistic organisational setting.
1. Architectural Foundations1.1 From operational data to decisionsA useful abstraction is a sequence of transformations: sources → ingestion → storage → processing → serving → decision or action Sources include transactional databases, applications, sensors, logs, partner feeds and human-generated documents. Ingestion transports and registers data. Storage preserves it, processing changes its form or meaning, and serving makes results available to dashboards, applications, analysts or models. This sequence is not strictly linear. Feedback flows from analytical consumers to source systems, data-quality rules and model-training datasets. A model may generate predictions that become new events; those events may later be used to detect drift or retrain the model. Important architectural quality attributes include: - Latency: elapsed time between data creation and availability for use.
- Throughput: amount of data or number of events processed per unit time.
- Durability: probability that stored data remains recoverable.
- Consistency: how closely replicas or readers observe the same state.
- Availability: proportion of time a service is usable.
- Elasticity: ability to add or release resources as demand changes.
- Lineage: record of data origin, transformations and downstream use.
- Discoverability: ability of authorised users to locate and understand data.
A design should state service-level objectives (SLOs), such as a 99.9% monthly availability target or a 60-second maximum freshness objective. Availability percentages must be interpreted over a defined measurement period; they do not guarantee that every individual request succeeds. 1.2 Data gravity and separation of compute from storageData gravity describes the tendency of applications and services to move toward large, valuable datasets because transferring data is expensive and slow. Cloud object storage encourages separation of compute from storage: data remains in durable storage while query engines, notebooks and processing clusters are created only when needed. This improves elasticity, but introduces concerns about egress charges, metadata coordination, access control and concurrent writes. A sound design treats storage, metadata, compute and governance as related but independently managed planes. Storage holds bytes; a catalog describes datasets; compute executes transformations; governance determines who may discover, read, alter or export them. 2. Principal Data Architectures2.1 Data lakesA data lake stores structured, semi-structured and unstructured data, commonly in object storage. It can retain raw data in its original form and create refined representations later. This is valuable when the future analytical use is uncertain or when retaining evidence is important. A disciplined lake normally has zones such as: - Raw or landing: immutable or append-only copies of received data.
- Validated or standardized: schema, encoding, quality and identity corrections applied.
- Curated or serving: business-ready datasets with documented semantics.
- Sandbox: controlled experimentation with explicit retention limits.
A lake is not automatically well governed. Without cataloguing, schema management, ownership, quality checks and lifecycle policies, it becomes a “data swamp.” File formats optimised for analytics, partitioning by common predicates, compaction and open table formats improve performance and reliability. 2.2 Data warehousesA data warehouse is a governed analytical store optimised for structured, often relational data. It commonly uses dimensional modelling, in which measurable events are represented in fact tables and descriptive context in dimension tables. A star schema can provide predictable reporting performance and shared business definitions. Warehouses are strong for SQL analytics, financial reporting, access controls and consistent metrics. They may be less convenient for rapidly changing schemas, raw documents, very large unstructured corpora or exploratory data-science workflows. Cloud warehouses increasingly support semi-structured data, machine learning functions and separation of compute workloads. 2.3 LakehousesA lakehouse combines low-cost, multi-format object storage with warehouse-like table management. A transactional table layer supplies schema enforcement, atomic commits, versioning, time travel and support for concurrent readers and writers. The architectural promise is one governed copy of data serving business intelligence, data science and machine learning. The term is architectural rather than a guarantee of a particular implementation. Teams must verify transaction semantics, catalog interoperability, isolation, performance and recovery behaviour. A lakehouse does not remove the need for modelling: highly curated dimensions, aggregates and semantic layers remain useful. 2.4 Data marts, data mesh and data fabricA data mart is a subject-oriented subset designed for a department or use case. It can improve usability but may create duplicated definitions. A data mesh is an organisational and architectural approach in which domain teams own data products, treat data as a product, provide self-service platform capabilities and apply federated governance. It is not merely a distributed database. A data fabric emphasises integrated metadata, automation and policy-aware access across heterogeneous environments. Mesh focuses strongly on organisational ownership; fabric focuses strongly on connectivity, metadata and automation. They can coexist. 2.5 Comparative selection| Architecture | Principal strength | Common limitation | Suitable use |
|---|
| Data lake | Flexible, economical retention | Governance and performance require discipline | Raw history, exploration, multimodal data | | Warehouse | Consistent SQL reporting | Less flexible for arbitrary data | Regulated reporting, BI, shared metrics | | Lakehouse | Shared governed data foundation | Table and metadata operations are complex | BI, engineering and ML on common datasets | | Data mesh | Domain accountability and ownership | Requires organisational maturity | Large enterprises with many domains | | Managed analytics platform | Rapid delivery and integrated services | Provider dependence and abstraction | Standardised analytics at operational speed |
Selection should be based on workload characteristics rather than fashionable terminology. 3. Ingestion and Processing Pipelines3.1 Batch ingestionBatch pipelines collect data at intervals. They are appropriate when freshness requirements are measured in hours or days, source systems cannot publish events, or periodic reconciliation is essential. A robust batch process records extraction time, source position, schema version, row counts, checksums and rejected records. Idempotency is central. An idempotent operation can be safely repeated without creating an incorrect additional effect. Common techniques include deterministic keys, merge operations, immutable raw files and checkpointed source offsets. Exactly-once end-to-end behaviour is difficult because source, transport, processor and sink may fail independently. Many systems instead provide at-least-once delivery and achieve effectively-once results through deduplication and transactional sinks. 3.2 Streaming ingestionStreaming architectures process unbounded event sequences. A broker or event-log service typically partitions events for parallelism and retains them for replay. Consumers track offsets, while event-time processing handles delayed or out-of-order records. Three times are important: - Event time: when the event occurred.
- Ingestion time: when the platform received it.
- Processing time: when computation handled it.
Windows may be tumbling, sliding or session-based. A watermark is an operational assertion about how far event time has advanced; it permits the engine to close windows while defining how much lateness is tolerated. Late-event policy should be explicit: discard, update a result, send to a correction stream or recompute. Streaming systems require back-pressure, replay, dead-letter handling, schema evolution and poison-message isolation. A low-latency pipeline without recovery and observability is not production-grade. 3.3 Batch, micro-batch and stream processingPure streaming can minimise latency but increases operational and semantic complexity. Micro-batch processing groups events over short intervals and can provide a useful compromise. Batch remains preferable for large historical recomputation, complex joins and workloads where freshness is not critical. A common pattern is lambda architecture, with separate batch and speed paths. It can provide resilience but duplicates logic. A kappa architecture uses a durable event log and replays events through one streaming path. It simplifies code paths but requires durable retention, replayable transformations and adequate processing capacity. Modern managed platforms often combine incremental processing with periodic compaction, reducing the practical distinction. 4. Analytics Serving and PerformanceAnalytical systems optimise different access patterns. Columnar storage reads only required columns and compresses similar values efficiently. Partitioning reduces scanned data when queries filter on partition keys, but excessive or skewed partitions create metadata and small-file overhead. For a query scanning volume V bytes, a simple cost model is: Cquery = V × p where Cquery is the variable scan cost and p is the provider’s price per byte scanned. This model excludes fixed fees, caching, concurrency charges, data transfer, storage and compute minimums. It applies only when the platform actually prices according to scanned bytes. Partition pruning and column projection reduce V, but logically equivalent queries may have different physical plans. A capacity-planning approximation for required throughput is: Rrequired ≥ Rpeak × (1 + h) where Rpeak is peak observed or forecast input rate, h is a dimensionless safety margin, and Rrequired is provisioned sustainable rate. The estimate assumes the measurement units are identical, such as events per second, and must be validated through load testing. It does not account for burst duration, state size or downstream bottlenecks. Semantic layers define trusted measures such as revenue, active customer and churn. They prevent every analyst from implementing slightly different business logic. Caching, materialised views, aggregates and workload isolation improve performance, but cached results require freshness and invalidation policies. 5. Machine-Learning Cloud Architectures5.1 The ML lifecycleA production ML system includes problem formulation, data preparation, feature engineering, training, evaluation, registration, deployment, monitoring and retirement. The model is only one component; data pipelines, feature definitions, inference code, infrastructure and policies jointly determine behaviour. A typical architecture contains: - A governed feature or training-data store.
- Reproducible development environments and experiment tracking.
- Distributed training infrastructure.
- A model registry containing versions, metadata, approvals and dependencies.
- Batch, online or edge inference endpoints.
- Monitoring for data quality, drift, performance, latency and cost.
- Automated but controlled retraining and deployment pipelines.
5.2 Accelerators and workload placementCPUs are versatile and suitable for orchestration, preprocessing and many inference tasks. GPUs provide massive parallelism for tensor operations and are effective for deep learning. TPUs and other application-specific accelerators can deliver high performance for supported operations. Selection should consider memory capacity, interconnect bandwidth, software ecosystem, utilisation, precision, availability and total cost—not peak operations alone. Mixed-precision training can improve throughput and reduce memory use, but numerical stability requires appropriate formats, loss scaling or hardware support. Distributed training introduces communication overhead. Scaling is beneficial only when computation saved exceeds coordination and data-transfer costs. 5.3 Evaluation and uncertaintyClassification accuracy can be misleading under class imbalance. Precision and recall are defined as: Precision = TP ÷ (TP + FP) Recall = TP ÷ (TP + FN) Here, TP is true positives, FP false positives and FN false negatives. Precision answers “of predicted positives, how many were correct?” Recall answers “of actual positives, how many were found?” These formulas require a defined positive class and a chosen decision threshold. They do not by themselves establish fairness or business value. Regression evaluation may use mean absolute error: MAE = (1 ÷ n) ∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ| where n is the number of observations, yᵢ the observed value and ŷᵢ the prediction. MAE has the same units as the target and treats errors linearly. Evaluation data must represent the deployment population and must not leak future information. 6. Generative-AI ArchitecturesA generative-AI platform commonly contains a foundation model, prompt and policy layer, retrieval system, orchestration, tool connectors, safety filters, observability and an application interface. 6.1 Retrieval-augmented generationRetrieval-augmented generation (RAG) indexes authorised documents, retrieves relevant passages for a query and supplies them as context to a language model. It can improve factual grounding and allow updates without retraining the foundation model. A production RAG system requires document ownership, chunking rules, embedding-model versioning, access-filter propagation, citation handling and evaluation of retrieval as well as generation. RAG does not guarantee truth. Retrieved documents may be wrong, stale, malicious or irrelevant. Prompt injection can instruct a model to ignore application policy or disclose retrieved content. Treat retrieved text as untrusted input, enforce tool permissions outside the model and log decisions without retaining unnecessary sensitive prompts. 6.2 Fine-tuning and model choiceFine-tuning is useful when the desired behaviour, style or task cannot be achieved adequately through prompting and retrieval. It increases data, evaluation and governance requirements. Parameter-efficient methods can reduce training cost but do not eliminate privacy or copyright risks. Model selection should compare quality, latency, context capacity, licensing, regional availability, safety controls and total cost. A simple serving-cost estimate is: Costrequest ≈ (Tin × pin + Tout × pout) ÷ 1,000,000 where Tin and Tout are input and output tokens, and pin and pout are prices per million tokens. This applies only to token-priced services and excludes retrieval, orchestration, storage, network, caching and evaluation costs. Tokenisation differs by model and language, so character count is not a reliable substitute. 7. MLOps, Governance and OperationsMLOps applies software-engineering discipline to data and model lifecycles. Essential practices include versioning code, data references, schemas, feature definitions, prompts, model weights and infrastructure; recording environments and random seeds where reproducibility is feasible; and requiring approval gates for high-impact deployments. A model registry should record training data lineage, intended use, limitations, evaluation results, fairness analysis, security review, owner, approval state and retirement date. Continuous integration should test data contracts, feature distributions, inference schemas and adversarial inputs. Continuous delivery should support canary releases, shadow evaluation, staged rollout and rapid rollback. Monitoring should cover four layers: | Layer | Examples |
|---|
| Data | Missingness, range violations, schema changes, distribution shift | | Model | Accuracy, calibration, drift, subgroup performance | | System | Latency, errors, throughput, accelerator utilisation | | Business and safety | Cost, conversion, harmful output, complaints, override rate |
Drift detection is not equivalent to performance measurement. A change in input distribution may be harmless, while unchanged inputs may produce degraded outcomes because the relationship between inputs and targets changed. Whenever labels arrive later, delayed performance monitoring is necessary. 8. Security, Privacy and SovereigntyData architectures should apply least privilege, separation of duties, encryption in transit and at rest, key-management controls, private connectivity where appropriate, secrets management, immutable audit logs and tested recovery. Identity-based access is generally preferable to shared credentials. Service accounts should have narrow scopes and short-lived credentials. Privacy engineering begins with data minimisation and purpose limitation. Techniques include tokenisation, pseudonymisation, aggregation, differential privacy, confidential computing and access-controlled clean rooms. Pseudonymisation reduces direct identification but does not make data anonymous; re-identification remains possible when auxiliary information exists. Data sovereignty concerns where data is collected, stored, processed, accessed and backed up, as well as which legal authority can compel access. A “regional” service may still involve support access, control-plane metadata or subprocessors in other jurisdictions. Contracts, transfer mechanisms, retention rules, breach duties and sector regulations must therefore be mapped to actual data flows. For sensitive AI use, maintain an inventory of personal data, training sources, prompts, outputs, subprocessors and retention periods. Do not send confidential data to a public model endpoint unless contractual, technical and legal controls explicitly permit it. 9. Responsible AI and Model RiskResponsible AI is an engineering and governance discipline, not a final compliance checklist. Relevant principles include validity, reliability, safety, security, transparency, explainability where appropriate, privacy, fairness, accountability and human oversight. Fairness cannot be reduced to one universal metric. For a binary classifier, demographic parity compares selection rates across groups, while equal opportunity compares true-positive rates. These goals may conflict when base rates differ. The appropriate criterion depends on the decision context, harms, legal requirements and stakeholder consultation. Generative systems introduce additional risks: hallucination, stereotyping, data leakage, prompt injection, model extraction, copyright disputes, automation bias and overreliance. Controls include restricted tools, grounded responses, refusal policies, human review for consequential decisions, red-team testing, provenance indicators, incident reporting and appeal mechanisms. Governance should classify use cases by impact. A recommendation for low-risk content can follow lighter controls than credit, employment, health or public-service decisions. High-impact systems require documented purpose, representative evaluation, human accountability, monitoring, user notification and a mechanism to contest outcomes. 10. Illustrative Case: Regional Health Analytics and AIBackgroundA fictional regional health network operates hospitals and clinics in three jurisdictions. It wants a dashboard updated within five minutes, a data science environment for readmission prediction and a clinician-facing assistant that searches approved clinical guidance. ProblemThe network has incompatible electronic-record schemas, delayed laboratory feeds, personally identifiable information and legal restrictions on cross-border processing. Clinicians require evidence-linked answers rather than unsupported generated text. The board also requires predictable cost and an auditable model lifecycle. AnalysisA single central warehouse would simplify reporting but could violate residency constraints and create a large concentration of risk. A pure data lake would preserve flexibility but would not by itself provide trusted clinical definitions. Real-time analytics is needed for operational alerts, whereas model training can use daily snapshots. The assistant needs retrieval over approved documents with document-level authorisation. Approach / SolutionThe network adopts jurisdictional landing zones in object storage, each encrypted with locally governed keys. Source adapters publish standardised events to regional event logs. Streaming jobs validate schemas and produce a five-minute operational store; nightly batch jobs create reconciled lakehouse tables for historical analysis. A governed semantic layer defines admissions, readmissions and occupancy. Training datasets are de-identified or appropriately pseudonymised within the permitted jurisdiction. A model registry records data lineage, subgroup metrics, clinical owner and approval status. The readmission model is deployed first in shadow mode, then to a limited group of clinicians. Its output is advisory, displays uncertainty and cannot automatically deny care. The assistant uses a regional vector index containing approved guidance. Retrieval applies the requesting clinician’s permissions before context reaches the model. Responses cite source passages, and unsupported questions receive an explicit uncertainty response. Prompts and outputs are retained only according to a documented clinical and privacy policy. OutcomeThe architecture meets the freshness objective without making all historical data continuously available across borders. It supports replayable events, auditable model releases and controlled experimentation. Costs are managed through lifecycle storage, workload isolation and token budgets. Residual risks include imperfect de-identification, changing clinical practice, false reassurance and regional service outages; these remain subjects of continuous monitoring. Learning Points- Data residency is an architectural constraint, not merely a contract clause.
- Different latency requirements justify different processing paths.
- A model registry and human accountability are as important as a training cluster.
- RAG requires authorisation and evidence evaluation, not only embeddings.
- Safety controls must be designed into user workflows and operational monitoring.
11. Design Method and Best PracticesA repeatable design method is: - Define users, decisions, data classifications and SLOs.
- Map sources, jurisdictions, ownership, lineage and retention.
- Separate raw preservation from curated consumption.
- Choose batch, streaming or hybrid processing according to freshness and correctness needs.
- Define contracts for schemas, quality, identities, late events and failure recovery.
- Select managed services only after assessing portability, lock-in, quotas and exit cost.
- Design security, privacy and governance before production ingestion.
- Establish reproducible experiments, model approval and rollback.
- Load-test data, model and retrieval paths, including failure and adversarial cases.
- Measure business value, reliability, safety and total cost after deployment.
Common anti-patterns include copying every source into one lake without ownership, using dashboards as a substitute for semantic governance, assuming exactly-once delivery without proving sink semantics, training on data that will not be available at inference time, and treating a foundation model’s fluent output as evidence of correctness. Contemporary DevelopmentsCurrent cloud architectures increasingly integrate vector search, open table formats, serverless processing, confidential computing, policy-as-code, data clean rooms and specialised inference hardware. Small language models and mixture-of-experts designs can reduce inference cost for selected tasks. Synthetic data may support testing and augmentation, but it can reproduce or amplify source-data bias and should not be assumed to preserve real-world validity. The strategic direction is toward composable platforms: shared governance and metadata with independently scalable storage, processing, model and application services. This flexibility increases the need for architecture standards, platform engineering and FinOps. The important question is not whether an organisation can deploy AI, but whether it can operate an evidence-based, secure and accountable decision system over time. Chapter SummaryCloud data architectures connect sources, ingestion, storage, processing, serving and decisions. Data lakes provide flexible retention; warehouses provide governed analytical consistency; lakehouses seek to combine both; mesh and fabric approaches address ownership and metadata at organisational scale. Batch, micro-batch and streaming pipelines should be selected from explicit freshness, correctness and recovery requirements. Machine-learning architecture extends beyond model training to include data lineage, experiment tracking, model registries, deployment strategies and monitoring. Accelerators must be evaluated using workload economics rather than peak specifications. Generative-AI systems require retrieval, tool controls, evaluation, privacy protection and resistance to prompt injection. Governance must address security, sovereignty, privacy, fairness, transparency, human oversight and incident response. Successful designs integrate these controls from the beginning rather than adding them after deployment. Key TermsData lake: Flexible storage for structured, semi-structured and unstructured data. Data warehouse: Governed analytical store optimised for structured queries. Lakehouse: Object-storage-based architecture with warehouse-like table management. Data mesh: Domain-oriented model of data ownership and federated governance. Data fabric: Metadata- and automation-oriented integration across data environments. Data lineage: Record of data origin, transformation and downstream use. Idempotency: Property that permits safe repetition of an operation. Event time: Time at which an event actually occurred. Watermark: Progress indicator used to manage late events in stream processing. Semantic layer: Governed definitions of business entities and measures. Feature store: Managed repository for reusable ML features and their definitions. MLOps: Practices for reliable development, deployment and operation of ML systems. Model registry: Controlled inventory of model versions, metadata and approvals. Drift: Change in data, relationships or model behaviour over time. RAG: Retrieval-augmented generation using external information as model context. Data sovereignty: Legal and policy control associated with data location and access. Pseudonymisation: Replacing identifiers while retaining a controlled re-identification possibility. Responsible AI: Practices addressing safety, fairness, accountability, transparency and human impact. FinOps: Financial management of cloud consumption through visibility and optimisation. Review Questions5 Short Answer Questions- What distinguishes a data lake from a data warehouse?
- Why are event time and processing time different in a streaming system?
- What purpose does a model registry serve?
- Why does RAG not guarantee factual correctness?
- Name four controls relevant to data sovereignty.
5 Long Answer Questions- Compare lake, warehouse and lakehouse architectures for an enterprise analytics programme.
- Explain how idempotency, checkpoints and replay contribute to reliable pipelines.
- Describe a complete MLOps lifecycle from dataset creation to model retirement.
- Analyse the security and privacy architecture of a generative-AI assistant.
- Discuss why responsible AI requires organisational governance as well as technical controls.
3 Analytical / Application Questions- An organisation needs sub-minute fraud alerts but only weekly regulatory reports. Design a hybrid data architecture and justify the processing paths, storage layers and recovery strategy.
- A classifier has high accuracy but poor recall for a minority group. Propose an evaluation and governance plan, including technical and non-technical interventions.
- Design a cross-border RAG platform for a regulated organisation. Identify data-flow, authorisation, sovereignty, model-risk and operational-monitoring controls.
Multiple Choice Questions with AnswersQuestion 1Which architecture most directly combines object-storage flexibility with transactional table management and warehouse-style analytics? A. Data lake B. Data warehouse C. Lakehouse D. Data mart Correct Answer: C. Lakehouse Question 2In stream processing, event time refers to: A. When the event was processed B. When the event occurred C. When the event was archived D. When the consumer started Correct Answer: B. When the event occurred Question 3Which practice makes a retried ingestion operation safe from creating an unintended duplicate effect? A. Idempotency B. Sharding C. Tokenisation D. Caching Correct Answer: A. Idempotency Question 4If TP = 80 and FP = 20, what is precision? A. 0.20 B. 0.50 C. 0.80 D. 0.llu Correct Answer: C. 0.80 Question 5Which component records model versions, lineage, evaluation results and approval status? A. Event broker B. Model registry C. Semantic cache D. Dead-letter queue Correct Answer: B. Model registry Question 6The principal purpose of retrieval-augmented generation is to: A. Replace all model training B. Provide external context to a generative model C. Guarantee that outputs are true D. Remove the need for access control Correct Answer: B. Provide external context to a generative model Question 7Which statement about pseudonymisation is correct? A. It always makes data anonymous B. It prevents every possible re-identification C. It replaces identifiers but may permit controlled re-identification D. It eliminates the need for encryption Correct Answer: C. It replaces identifiers but may permit controlled re-identification Question 8Which metric measures the proportion of actual positive cases that a classifier identifies? A. Precision B. Recall C. Specificity D. Latency Correct Answer: B. Recall Question 9A cloud design that keeps regulated datasets within legally approved jurisdictions is primarily addressing: A. Data sovereignty B. Column pruning C. Model quantisation D. Event watermarking Correct Answer: A. Data sovereignty Question 10Which is an appropriate production control for a high-impact ML model? A. Automatic deployment without review B. Removing all audit logs C. Canary release with monitoring and rollback D. Training only on synthetic data without validation Correct Answer: C. Canary release with monitoring and rollback
|