1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning at Scale

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning at Scale

Data at Scale: Lakehouse Architecture and Machine Learning Operations

Data as the Center of Data Work

Modern data work brings together data engineers, data scientists, machine-learning engineers, and analysts. These roles depend on one another: data engineers build and maintain pipelines, analysts and scientists explore data, and machine-learning engineers turn models into services and keep them operating.

Data is therefore more than an input to analysis. Its availability, quality, freshness, and governance shape what the entire data team can accomplish. The term advanced analytics can include several kinds of work:

  • Descriptive analysis: examining historical data to understand what happened.

  • Forecasting and prediction: using data to estimate future outcomes.

  • Machine learning and deep learning: training models to identify patterns or make predictions.

  • Business intelligence: querying and summarizing data to support decisions.

All these activities become more challenging when data is large, diverse, rapidly changing, or distributed across different systems.


Challenges of Data at Scale

Quality, freshness, and reliability

Useful analysis depends on data being accurate and appropriate for its purpose. In practice, teams often spend substantial effort cleaning and preparing data before they can analyze it. Poor quality can produce misleading reports and unreliable models, even when the analytical methods are sound.

Data also loses value when it is stale. A model trained on data that is months old may not reflect current conditions, especially in settings where behavior or operating conditions change quickly. Timely data matters for both real-time analysis and for keeping predictive models relevant.

Other common difficulties include:

  • Unreliable sources: Data may be incomplete, inconsistent, or collected under unclear conditions.

  • Volume and scale: Data sets can grow beyond what can be handled efficiently on a single machine or with traditional tools.

  • Infrastructure overhead: Maintaining pipelines, storage systems, and processing environments takes time away from analysis and model development.

  • Changing data: Formats, schemas, and data-generating processes evolve, so systems must adapt rather than assume data remains fixed.

These problems are connected. A complicated data architecture can create delays and errors, which can make data less reliable or less current. The architecture used to store and process data therefore affects the quality of the analysis built on top of it.


How Data Architectures Have Evolved

Data warehouses

Traditional data warehouses were designed primarily for structured data, SQL queries, and business intelligence. Data from operational databases was typically prepared through extract, transform, and load (ETL) processes and then placed into warehouse tables.

Warehouse designs offered capabilities suited to reliable reporting:

  • Data was organized into structured tables with defined schemas.

  • Indexes, caching, and other query-optimization techniques supported fast SQL queries.

  • Transaction management helped ensure that operations either succeeded consistently or failed without leaving partially applied changes.

  • Versioning or historical access could make it possible to examine earlier data states.

These strengths made warehouses effective for many reporting workloads. However, data scientists and machine-learning teams often needed data and computation that did not fit naturally into a SQL-centered environment. Complex transformations could require exporting data to separate systems, adding processing steps and delays. Warehouses were also less suited to the growing variety and volume of data.

The rise of diverse and large-scale data

As internet services and connected systems expanded, organizations began handling more than conventional structured records. Data increasingly included:

  • Semi-structured formats such as JSON and XML.

  • Time-series records and server or device logs.

  • Images, documents, and other unstructured data.

  • Large data sets used to train, test, and repeatedly update machine-learning models.

A warehouse optimized for structured tables could be costly or difficult to adapt to all these data types and scales. Machine-learning workloads also required broader support for programming languages, libraries, distributed processing, and repeated experimentation.

Data lakes

A data lake provides a flexible, scalable place to store data in many formats. It commonly uses relatively low-cost, horizontally scalable storage, including cloud storage, and may store data in open file formats such as Parquet.

The separation of storage and computation in cloud systems makes it possible to keep large amounts of data in shared storage while using different compute engines for different tasks. For example:

  • Machine-learning frameworks can read files directly from the lake.

  • A subset of data can be prepared or loaded into a warehouse for SQL reporting.

  • Other systems can process selected data for real-time applications.

This flexibility solves important storage and format problems, but a basic data lake does not automatically provide the management features associated with a warehouse. Files may be updated or deleted without a unified mechanism to determine which files make up the current, valid version of a table.


Why Separate Data Systems Can Create Problems

Organizations may use a lake for raw data, a warehouse for reporting, and additional databases for real-time workloads. Moving data between them often requires multiple ETL processes. This creates duplicated data preparation: one process may prepare data for machine learning while another prepares it for reporting or operational databases.

Multiple copies and pipelines can lead to:

  • Inconsistency: Different systems may contain different versions of the data.

  • Bugs: Every transformation and transfer adds opportunities for errors.

  • Latency: Data may take hours or days to move through pipelines, leaving downstream users with stale information.

  • Higher engineering costs: Teams must build, monitor, repair, and coordinate additional pipelines.

  • Reduced reproducibility: It may be difficult to determine which exact data version was used in an analysis or model.

A data lake can therefore provide scalable storage without, by itself, ensuring that data is current, transactionally consistent, or easy to govern. The architectural challenge is to retain the lake’s flexibility while supplying stronger management and query capabilities.


The Lakehouse Approach

A lakehouse combines a data lake’s flexible, scalable storage with management and performance features commonly associated with data warehouses. The goal is to give different workloads access to a shared data foundation rather than require each workload to depend on separate copies and pipelines.

A lakehouse generally includes:

  1. A scalable storage layer that holds data in open file formats.

  2. A management layer that tracks table contents, versions, transactions, and other metadata.

  3. Access interfaces and compute engines that support SQL, analytics, streaming, data science, and machine learning.

Applications can request a table through the management layer instead of determining independently which files constitute the table. The management layer identifies the relevant files and version, while the application or query engine performs the required processing.

The intended benefits include:

  • Less duplicated ETL and fewer inconsistent copies.

  • Fresher access to shared data.

  • Support for both data-science and SQL workloads.

  • More reliable management of concurrent reads and writes.

  • A common foundation for multiple data-team roles.

The lakehouse is not simply a large collection of files. Its management and compute layers are essential to making the data usable and reliable at scale.


Table Management, Transactions, and Delta Lake

The role of a metadata and transaction layer

A basic collection of files does not inherently tell a reader which files form the current table, which version is valid, or whether a write has completed. A metadata and transaction layer records those facts. It can make a collection of files behave more like a managed table while retaining the flexibility of lake storage.

A transaction log can record changes to a table over time. When an application requests a particular version, the management layer identifies the files belonging to that version. Concurrent operations can then be coordinated so that one application’s changes do not silently corrupt another application’s view.

The source describes ACID-style transactions as an important management capability:

  • Atomicity: An operation is treated as a complete unit rather than a partial change.

  • Consistency: Operations preserve defined rules and data constraints.

  • Isolation: Concurrent operations are managed so they do not interfere improperly.

  • Durability: Completed changes are retained.

These capabilities are valuable when multiple applications read or modify shared data.

Delta Lake capabilities

Delta Lake is presented as an open-source table-management layer for data lakes. Its capabilities include:

  • Versioned tables: Table changes are recorded so that readers can identify a specific table state.

  • Concurrent access: Multiple applications can work with a table while the transaction mechanism maintains a consistent view.

  • Time travel: Users can query or retrieve an earlier table version.

  • Schema enforcement and evolution: Incoming data can be checked against a defined schema, while schema changes can be managed rather than silently producing inconsistent results.

  • Data manipulation operations: Tables can support inserts, updates, deletes, merges, and upserts.

  • Streaming integration: A table can participate in streaming workflows as well as batch processing.

Time travel is particularly useful for reproducibility. If a model or analysis needs to be recreated later, a team can identify the table version used rather than relying on a mutable collection of files. This makes it easier to investigate results, compare experiments, or understand why a model behaved as it did.

Schema management also supports data quality. If new records do not match expectations, the system can detect or manage the mismatch instead of allowing incompatible data to blend invisibly into a table. When a schema changes, the change can be handled explicitly so that older and newer data remain interpretable.

Other systems can provide related table-management approaches. The important architectural idea is that the lake’s files are accompanied by a layer that records how those files form tables and how those tables change.


Query Performance on Lakehouse Storage

Flexible storage alone does not guarantee fast queries. Lakehouse query engines use techniques that are also familiar from database and distributed-system design.

Caching and storage layout

Frequently accessed data can be cached in memory or on fast storage such as solid-state drives. Caching reduces repeated reads from slower underlying storage.

Data layout also affects performance. If records commonly accessed together are clustered, sorted, or partitioned appropriately, query engines can avoid reading unnecessary data. Physical organization thus matters even when the underlying file format is open.

Statistics, indexes, and data skipping

A query engine can use statistics or other auxiliary data structures to avoid scanning files that cannot contain relevant records. For example, if a query filters for a date range and a file’s recorded date range does not overlap with it, the engine may skip that file. This is often called data pruning or data skipping.

Such techniques reduce the amount of data that must be read, which is especially important for large tables.

Vectorized execution

Modern query engines can use vectorized execution, which processes groups of values efficiently and can take advantage of CPU capabilities. Rather than treating every record as an entirely separate operation, the engine performs operations over batches of data in a way that can improve throughput.

Together, caching, careful layout, statistics, pruning, and vectorized execution help lakehouse query engines pursue warehouse-like query performance while operating over scalable lake storage. Performance depends on the workload, data layout, and engine; the architectural aim is to make large-scale SQL and analytics practical on the shared data layer.


Supporting Data Science and Machine Learning Workloads

Machine-learning tools often read files directly from a data lake, but efficient access requires coordination with the table-management and query layers. An application should not have to guess which files represent the correct data or scan every file unnecessarily.

A data-processing interface, such as a DataFrame API, can express transformations using relational operations. The engine can translate those operations into a query plan and optimize them. It may push filters or other work down toward the storage and management layers so that only the necessary data is read.

This provides two important advantages:

  • Correctness: The application receives data from the appropriate managed table version.

  • Efficiency: The system can use metadata, layout, and query optimizations to limit unnecessary work.

Open file formats and declarative interfaces also make it easier for different tools to work with the same data foundation, rather than forcing every team to create its own isolated copy.


Why Machine Learning Is Operationally Complex

Machine-learning difficulty does not arise only from mathematical complexity. High-level libraries often provide convenient APIs for common models, but building a useful model involves an iterative, data-dependent process.

Traditional software and machine learning

In traditional software development, a team generally implements a specification. Quality is evaluated through factors such as correctness, defects, and service-level performance.

Machine learning has a different objective: a model must achieve an appropriate business or predictive metric, such as accuracy or another task-specific measure. Model quality depends not only on code but also on the data, chosen features, algorithm, and tuning decisions. Because data changes, a successful model may need to be reviewed or retrained later.

Machine-learning work is therefore experimental:

  1. Prepare data.

  2. Choose candidate algorithms and settings.

  3. Train models.

  4. Evaluate them using suitable metrics.

  5. Compare results and refine the approach.

  6. Select, package, approve, deploy, and monitor a model.

Different steps may use different languages, libraries, compute systems, and deployment environments. A team may also need distributed training or repeated experiments over large data sets. That variety makes it difficult to track exactly which data, code, parameters, and environment produced a particular result.

Reproducibility, deployment, and governance

A model that performs well in an experiment still needs to be transferred reliably into a production environment. Teams need to know whether the deployed artifact is the same model that was tested and approved.

A complete process should make it possible to determine:

  • Which data and features were used.

  • Which code, libraries, and parameters produced the model.

  • What metrics were obtained.

  • Who created, tested, reviewed, and approved it.

  • Which version was deployed and where.

  • How the model can be reproduced or rolled back.

This information supports reproducibility, collaboration, debugging, and governance.


MLflow and the Machine-Learning Lifecycle

MLflow is an open-source platform for managing machine-learning experiments and models. It organizes parts of the lifecycle into components that help teams record, reproduce, package, and govern their work.

Experiment tracking

Experiment tracking records information about model runs, such as:

  • Parameters: Settings used to train or evaluate a model.

  • Metrics: Results used to compare model performance.

  • Artifacts: Files produced by a run, which may include models and other outputs.

When teams conduct many experiments, a tracking interface helps them compare results and identify which run performed best according to their chosen criteria. Automatic logging can reduce the amount of information researchers must record manually.

A metric such as accuracy is meaningful only in relation to the task and evaluation data. Tracking it alongside parameters and artifacts makes the result more interpretable than recording a score alone.

Projects and reproducible runs

A project can package code, configuration, dependencies, and other execution details needed to run an experiment. This helps another person execute the same work locally or remotely and reduces the chance that differences in environments will produce inconsistent results.

Reproducibility depends on recording the relevant inputs and environment, not just saving the final model file. A model without its supporting code, configuration, or data context may be difficult to recreate or validate.

Models and deployment formats

The model component provides a way to package models produced with different machine-learning libraries. A common model format or framework-specific “flavor” can make a model easier to load and deploy in different environments.

The purpose is to separate the model user from some of the implementation details of the original training library. A downstream application can use the model through a supported interface rather than having to reconstruct the full training setup.

Model registry

A model registry is a centralized repository for named models and their versions. It can record descriptions, history, and lifecycle stages, such as:

  • Development or an initial, unassigned stage.

  • Staging, where a candidate model is tested.

  • Production, where an approved model is used.

  • Archived, for versions no longer in active use.

The registry supports collaboration between developers, reviewers, and downstream teams. A developer can register a model; a reviewer can retrieve and test it; and an authorized person can promote it after it meets the required criteria. The registry’s version and history records help teams identify who created a model and what state it is in.

Multiple versions can be kept for comparison or A/B testing. The registry can also store descriptions and documentation that help establish a model’s provenance.

Connecting MLflow to CI/CD and MLOps

Continuous integration and continuous delivery/deployment (CI/CD) practices can automate parts of the model lifecycle. Registry events and workflow APIs can connect model transitions to tests or deployment jobs. For example:

  1. A model is registered and placed in staging.

  2. An automated process runs validation tests.

  3. If the model satisfies the required checks, an authorized workflow promotes it.

  4. A deployment process makes the approved version available to an application or service.

  5. The deployment and its results are monitored.

This is part of MLOps: applying operational practices to the development, deployment, and maintenance of machine-learning systems. Automation can make model handling more repeatable, but it does not remove the need for appropriate evaluation, review, and governance. Promotion decisions should be based on defined requirements rather than simply on the fact that a model was registered.


Monitoring and Model Drift

Models are trained using data that reflects a particular period and environment. When the data changes, the model’s behavior or predictive performance may change as well. This can involve data drift or a broader decline in model performance.

Monitoring can compare incoming data and model results with expected patterns. If the model no longer meets its requirements, teams may investigate the change, retrain the model, or replace it with another version.

A CI/CD workflow can connect a monitoring signal to an investigation or retraining process. However, an observed change should be assessed rather than treated as an automatic instruction to deploy a new model. New models still need validation and appropriate approval.


Automated Machine Learning

Automated machine learning (AutoML) can automate parts of model selection and experimentation. A user may provide a data set, identify a task such as regression, select candidate algorithms, and specify evaluation preferences. The system can then train candidate models, collect metrics, and rank the results.

AutoML is useful for reducing repetitive work and making comparisons across algorithms more systematic. It is not a universal “one-button” solution. Its usefulness depends on:

  • Whether the task has been specified appropriately.

  • Which data and candidate algorithms are supplied.

  • Whether the evaluation metric matches the real goal.

  • Whether the results are reviewed for errors, bias, or unsuitable assumptions.

A transparent, lower-code workflow is preferable to treating AutoML as an unexplained black box. Users benefit from being able to inspect which algorithms were evaluated, how they performed, and why one was selected.


Governance, Ethics, and Responsible Data Use

Data and models can affect decisions about people, including decisions in health care, finance, and other high-impact settings. Teams therefore need to consider not only model performance but also how data was collected, what features were used, who can access the data, and how decisions can be explained or reviewed.

Privacy and access control

Sensitive data may require encryption, anonymization, and carefully limited access. A management layer can support role-based access control, in which access depends on a person’s role and permissions. Different users may be allowed to see different tables, rows, or columns.

Access controls can help limit exposure, but they are only one part of data governance. Organizations also need policies about what data to collect, how to use it, how long to retain it, and how to protect it. Healthcare data, for example, must be handled in accordance with applicable privacy and security requirements.

Provenance and interpretability

Governance benefits from knowing how a model was created and deployed. A model registry can preserve versions, descriptions, reviews, and approvals, while tracking systems can preserve parameters and metrics.

Interpretability can help reviewers understand which features influenced a prediction. Feature importance or other explanation methods may provide evidence about a model’s behavior. Such tools support scrutiny, but they do not alone establish that a model is fair, appropriate, or ethical. The choice and quality of data, the decision process, and the intended use still require human evaluation.

Selling or sharing insights derived from data is a separate organizational and ethical decision from the storage technology itself. Data platforms can provide security and management mechanisms, but the organization using the data remains responsible for how it is used and disclosed.


Distributed and Federated Learning

Large-scale learning may involve distributing computation across machines or learning from data that is held in different locations. Federated learning is relevant when data should remain local rather than being gathered into one central store. It can be used alongside distributed computing approaches, but it does not remove the need to consider privacy, data quality, or governance.

Teams must still ask:

  • What data is collected, and for what purpose?

  • How are data and model updates protected?

  • Does the training process introduce or reinforce bias?

  • Can decisions be examined and explained appropriately?

  • Are the results valid across the different populations or locations represented?

Distributed learning changes where computation and data reside; it does not make responsible data practices unnecessary.


Healthcare and Large-Scale Genomic Analysis

Healthcare provides a clear example of both the promise and the demands of large-scale data processing. Genomic analysis can involve very large data sets, and processing them can support research such as drug discovery. Specialized distributed tools and pipelines can help researchers analyze this data at scale.

Healthcare applications also heighten the importance of privacy, access control, anonymization, and careful governance. A system may need to support different levels of access for different users while ensuring that sensitive records are not exposed unnecessarily. The combination of large-scale analysis and sensitive information makes architecture and policy equally important.


SQL Querying on Lakehouse Data

A lakehouse aims to support SQL-style analysis directly on lake storage, rather than requiring every query workload to move data into a separate warehouse. A management layer supplies consistent table information, and a query engine applies optimizations such as caching, pruning, and vectorized execution.

The goal is to combine:

  • Scalable, flexible storage.

  • Managed table semantics and transactions.

  • High-performance SQL and analytics.

  • Access to the same data for machine learning and other workloads.

Whether a given system meets a particular performance need depends on its implementation and workload. The key idea is architectural: SQL access, machine learning, and other analytics can share a managed data foundation.


Edge Inference

Not all machine-learning processing needs to occur in a central data center. Edge inference runs a trained model near the device or location where data is generated. This can be useful when connectivity is limited, response time matters, or transmitting every raw observation is impractical.

A common workflow is:

  1. A model is trained using more powerful centralized or distributed resources.

  2. A compact model is deployed to an edge device.

  3. The device evaluates local sensor or image data and responds when a relevant condition is detected.

  4. Selected data may later be uploaded for centralized analysis or retraining.

  5. An updated model can then be deployed back to the edge.

Edge devices may have limited power, storage, and compute, so they often perform inference rather than full model training. Applications can include sensor monitoring and object detection, such as detecting wildlife or potential threats in remote settings.

This approach reduces the need to send all data to a central location, but it does not eliminate the value of central processing. Central systems can still collect selected observations, evaluate model performance, train updates, and distribute new models.


Key Takeaways

  • Data quality and freshness are foundational to trustworthy analytics and useful machine-learning models.

  • Traditional warehouses support structured SQL workloads well, while data lakes provide flexible, scalable storage for diverse data.

  • Multiple independent storage systems and ETL pipelines can create delays, inconsistencies, and substantial maintenance work.

  • A lakehouse combines scalable lake storage with table management, transactions, governance, and query performance features.

  • Delta Lake adds capabilities such as versioning, time travel, schema management, concurrent access, and table updates to lake storage.

  • Query performance depends on more than storage: caching, data layout, pruning, statistics, and vectorized execution also matter.

  • Machine-learning systems require experiment tracking, reproducibility, packaging, deployment, monitoring, and governance.

  • MLflow supports these tasks through experiment tracking, projects, model packaging, and a versioned model registry.

  • AutoML can automate candidate comparisons, but users still need to inspect methods, metrics, and results.

  • Responsible machine learning requires attention to privacy, access control, provenance, bias, and interpretability.

  • Edge inference allows trained models to act near data sources, while centralized systems can still support training, monitoring, and model updates.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent