What Is Database Virtualization?什么是数据库虚拟化?
For the full topic map and the neighboring methods that support this workflow, continue with the federated queries and data virtualization guide.
如需查看完整主题结构以及支撑本流程的相邻方法,请继续阅读联邦查询与数据虚拟化指南。
Database virtualization is a logical access layer that presents governed views across multiple databases without requiring consumers to query every source separately or consolidate all data first. Connectors translate requests to source-native operations; a catalog and semantic layer define shared names, keys, types, and policies; a query engine coordinates pushdown, joins, and results.
数据库虚拟化是在多个数据库之上提供受治理视图的逻辑访问层,使用者无需分别查询每个来源,也不必先集中全部数据。连接器把请求转换为来源原生操作;目录和语义层定义共享名称、键、类型与策略;查询引擎协调下推、连接和结果。
This page uses the term in the cross-database query sense used for federated data access. Some vendors also use “database virtualization” for copy-on-write clones or virtual machines. That is a different environment-provisioning intent. State the meaning explicitly in requirements, product evaluations, and architecture diagrams.
本页按联邦数据访问主题使用“跨数据库查询”含义。部分厂商也把“数据库虚拟化”用于写时复制克隆或虚拟机,那属于不同的环境供应意图。应在需求、产品评估和架构图中明确说明含义。
Use the label carefully in navigation and internal links. Readers seeking clone provisioning expect snapshots, masking, and rewind; readers seeking cross-database access expect virtual schemas, connectors, and federated queries. The page title, lead, examples, and related links must consistently signal the second intent.
在导航和内链中也要谨慎使用该名称。寻找克隆供应的读者期待快照、脱敏与回退;希望跨数据库访问的读者则期待虚拟Schema、连接器和联邦查询。标题、导语、示例与相关链接必须始终明确第二种意图。
Design the Virtual Query Architecture设计虚拟查询架构
Published SQL views or APIs expose stable business concepts, not raw source quirks. Every view declares grain, keys, units, time semantics, and owner.
发布的SQL视图或API应暴露稳定业务概念,而不是来源细节。每个视图都要声明粒度、键、单位、时间语义和负责人。
Metadata maps global fields to source objects. The planner rewrites requests, estimates cost, chooses pushdown, and decides where cross-source work executes.
元数据把全局字段映射到来源对象。规划器重写请求、估算成本、选择下推,并决定跨源工作在哪里执行。
Connectors handle dialects, credentials, types, capabilities, pagination, retries, and source-specific limits. Capability claims require execution-plan evidence.
连接器处理方言、凭据、类型、能力、分页、重试和来源限制。能力声明必须由执行计划证明。
Sources keep local ownership, policy, transactions, and operations. Virtualization does not erase source availability, consistency, or performance boundaries.
来源保留本地责任、策略、事务与运维。虚拟化不会消除来源的可用性、一致性或性能边界。
Make the contract observable. Record which connector answered each field, the source snapshot or observation time, the transformations applied, and whether a value came from a cache. Expose query identifiers so an analyst can move from a dashboard cell to the virtual plan and then to source evidence. Without this path, the abstraction improves convenience while weakening accountability.
让契约具备可观测性。记录每个字段由哪个连接器回答、来源快照或观察时间、所应用转换,以及值是否来自缓存。暴露查询标识,使分析师能从仪表盘单元格追溯到虚拟计划和来源证据。缺少这条路径时,抽象只提高便利性,却会削弱责任与可验证性。
Database Virtualization vs Nearby Patterns数据库虚拟化与相邻模式对比
| Pattern模式 | Primary outcome主要结果 | Data movement数据移动 | Best fit适合场景 |
|---|---|---|---|
| Database virtualization数据库虚拟化 | Stable logical views across databases跨数据库稳定逻辑视图 | Usually query in place; optional governed cache通常原位查询;可选受治理缓存 | Fresh, bounded cross-source access新鲜且有边界的跨源访问 |
| ETL or ELTETL或ELT | Curated physical target整理后的物理目标 | Scheduled or streaming copies批量或流式复制 | Heavy reuse, history, predictable performance高复用、历史和可预测性能 |
| Database federation数据库联邦 | Distributed queries over autonomous systems自治系统上的分布式查询 | In-place requests and intermediate results原位请求与中间结果 | Technical cross-source query execution技术层跨源查询执行 |
| Virtual database clone虚拟数据库克隆 | Isolated test or development environment隔离测试或开发环境 | Snapshot or copy-on-write blocks快照或写时复制数据块 | Provisioning, testing, recovery exercises供应、测试和恢复演练 |
Use more than one pattern when workloads differ. A fresh operational lookup may remain virtual, while a repeated historical aggregation is materialized into a warehouse. Document the routing rule, owner, refresh promise, and reconciliation test so consumers know which path answered the question. Hybrid architecture is safer than forcing every request through one technology.
工作负载不同时可以组合模式。新鲜的运营查询可保持虚拟访问,而重复执行的历史聚合可物化到数仓。应记录路由规则、负责人、刷新承诺和核对测试,让使用者知道问题由哪条路径回答。混合架构通常比强迫所有请求使用一种技术更安全。
Implement Database Virtualization Step by Step逐步实施数据库虚拟化
- Define one bounded question. Name consumers, sources, fields, grain, freshness, response time, result limits, and decisions. Do not start with “connect everything.”定义一个有边界的问题。明确使用者、来源、字段、粒度、新鲜度、响应时间、结果限制和决策,不要从“连接一切”开始。
- Inventory source contracts. Record owners, schemas, keys, types, time zones, permissions, rate limits, maintenance windows, and expected change.盘点来源契约。记录负责人、Schema、键、类型、时区、权限、速率限制、维护窗口和预期变更。
- Build the global model. Map local fields to shared concepts without pretending that similar labels are equivalent. Publish definitions and exception paths.建立全局模型。把本地字段映射到共享概念,不要把相似标签假定为等价,并发布定义与异常路径。
- Configure least-privilege connectors. Use read-only views where possible, restrict networks and rows, rotate secrets, and test type fidelity and cancellation.配置最小权限连接器。尽量使用只读视图,限制网络与行,轮换密钥,并测试类型保真和取消能力。
- Inspect query plans. Verify filter, projection, aggregation, and join pushdown with real plans. Set source-load budgets and reject unsafe shapes.检查查询计划。通过真实计划验证过滤、投影、聚合与连接下推,设置来源负载预算并拒绝不安全查询形态。
- Reconcile results. Compare virtual outputs with source-native control queries across nulls, duplicates, late records, currencies, time zones, and failures.核对结果。针对空值、重复、迟到记录、货币、时区和故障,把虚拟结果与来源原生控制查询比较。
- Release with observability. Monitor latency, bytes moved, pushdown ratio, connector errors, source pressure, freshness, cache use, denied access, and result-quality incidents.带可观测性发布。监控延迟、移动字节、下推率、连接器错误、来源压力、新鲜度、缓存使用、拒绝访问和结果质量事件。
Preserve Security and Governance Across Databases跨数据库保持安全与治理
Authenticate the consumer, authorize the published view, and enforce source permissions without accidental privilege expansion. Decide whether identity is delegated to each database or queries run through a service identity; document the consequence for row policies and audit attribution. Sensitive fields need consistent masking across views, caches, exports, logs, and error messages.
应验证使用者身份、授权已发布视图,并执行来源权限,避免意外扩大权限。需决定身份是委派到每个数据库,还是通过服务身份查询,并记录这对行策略和审计归属的影响。敏感字段必须在视图、缓存、导出、日志和错误消息中保持一致脱敏。
Keep lineage from every virtual field to its source expression. Review schema changes before they silently alter meaning. A virtual layer is an additional policy enforcement point, not a reason to remove controls from source systems.
应保留每个虚拟字段到来源表达式的血缘,并在Schema变更悄然改变含义前进行审查。虚拟层是额外策略执行点,不能成为移除来源控制的理由。
Treat metadata itself as sensitive. Catalogs can reveal table names, customer segments, regulated fields, and infrastructure topology even when row data is hidden. Limit discovery, redact errors, audit policy decisions, and test that a user cannot infer protected information through counts, timing, joins, or repeated small queries.
元数据本身也可能敏感。即使行数据被隐藏,目录仍可能暴露表名、客户分群、受监管字段和基础设施拓扑。应限制发现范围、清理错误信息、审计策略决策,并测试用户不能通过计数、时序、连接或重复小查询推断受保护信息。
Define Freshness, Consistency, and Failure Semantics定义新鲜度、一致性与故障语义
A cross-database result rarely represents one atomic instant. Record the observation time of each source, acceptable skew, cache age, and whether partial results are allowed. Label stale or incomplete outputs instead of presenting them as current and complete. If a source times out, choose explicitly between failing the request, returning a marked partial result, or using an approved cache.
跨数据库结果很少代表同一个原子时刻。应记录每个来源的观察时间、可接受偏差、缓存年龄,以及是否允许部分结果。过期或不完整输出必须标记,不能呈现为当前且完整。来源超时时,应明确选择请求失败、返回带标记的部分结果,或使用获批缓存。
Define recovery at the query-contract level. Test connector restarts, expired credentials, schema removal, network partitions, coordinator failover, stale caches, and a source returning a different type. For every condition, specify the visible error, retry rule, alert owner, and whether previously computed results remain usable.
应在查询契约层定义恢复。测试连接器重启、凭据过期、Schema删除、网络分区、协调器故障切换、缓存过期和来源返回不同类型。针对每种情况,明确可见错误、重试规则、告警负责人,以及此前计算结果是否仍可使用。
Control Pushdown, Joins, and Source Load控制下推、连接与来源负载
Push selective filters and projections to sources when semantics match. Avoid moving large tables to a coordinator for an unrestricted join. Prefer bounded keys, pre-aggregated source views, asynchronous materialization, or workload routing when a query cannot meet the source budget. Cost estimates are hypotheses; validate them with actual plans, bytes, rows, runtime, concurrency, and cancellation behavior.
当语义一致时,应把高选择性过滤和投影下推到来源,避免为无限制连接把大表移动到协调器。查询无法满足来源预算时,可使用有边界键、来源预聚合视图、异步物化或工作负载路由。成本估算只是判断,应通过实际计划、字节、行数、运行时间、并发和取消行为验证。
Protect interactive and production systems with concurrency pools, statement timeouts, result limits, admission control, and circuit breakers. Benchmark cold and warm paths separately. A fast cached demonstration does not prove acceptable first-query latency, and a single-user test does not prove safety under concurrency. Re-test after connector, source schema, statistics, or network changes.
通过并发池、语句超时、结果限制、准入控制和熔断器保护交互与生产系统。分别基准测试冷路径和热路径。快速缓存演示不能证明首次查询延迟可接受,单用户测试也不能证明并发安全。连接器、来源Schema、统计信息或网络变化后应重新测试。
Example: A Governed Customer Support View示例:受治理的客户支持视图
A support team needs current account status from PostgreSQL, recent invoices from a finance database, and open cases from a service platform. The virtual layer publishes one support view keyed by an approved customer identifier. It pushes account and date filters to each source, retrieves only required columns, joins bounded results, and records each source observation time.
支持团队需要PostgreSQL中的当前账户状态、财务数据库中的近期发票,以及服务平台中的未结工单。虚拟层以获批客户标识发布一个支持视图,把账户与日期过滤下推到各来源,只获取所需列,连接有边界结果,并记录每个来源的观察时间。
Before release, the team tests duplicate identities, missing invoices, closed accounts, different time zones, a slow source, and a denied row. Results are reconciled with source-native queries. The view fails closed when authorization cannot be verified and labels partial data when an approved source is temporarily unavailable.
发布前,团队测试重复身份、缺失发票、已关闭账户、不同时区、慢来源和被拒绝行,并用来源原生查询核对结果。无法验证授权时视图应关闭;获批来源暂时不可用时,应标记部分数据。
Analyze Approved Database Sources with InfiniSynapse使用InfiniSynapse分析获批数据库来源
InfiniSynapse supports bounded analysis across approved connected sources. Prepare owner approval, least-privilege connections, shared definitions, join keys, grain, privacy rules, freshness expectations, and control queries. Use the workspace for the supported analysis task; keep connector governance, source protection, and production query-serving responsibilities in their accountable systems.
InfiniSynapse支持在获批连接来源之间执行有边界分析。请准备负责人批准、最小权限连接、共享定义、连接键、粒度、隐私规则、新鲜度期望和控制查询。使用工作区完成受支持分析任务,并把连接器治理、来源保护和生产查询服务责任保留在对应系统中。
Database Virtualization FAQ数据库虚拟化常见问题
What does database virtualization mean on this page?
本页所说的数据库虚拟化是什么意思?
Database virtualization here means a logical query layer that presents governed views across independent databases while source data remains under local ownership. Some products use the same phrase for snapshot clones, so confirm the intended meaning before comparing architectures.
本页所说的数据库虚拟化,是在独立数据库之上建立逻辑查询层,在来源数据仍由本地负责的同时提供受治理视图。部分产品也用该词表示快照克隆,因此比较架构前必须确认语境。
Does database virtualization copy source data?
数据库虚拟化会复制来源数据吗?
The default pattern queries data in place through connectors and pushes safe work to each source. A platform may use bounded caches or materialized results for performance, but those copies must be explicit, governed, refreshed, and never confused with the source of truth.
默认模式通过连接器原位查询,并把安全工作下推到各来源。平台可以为性能使用有边界的缓存或物化结果,但这些副本必须显式治理、刷新,并且不能与事实来源混淆。
How is database virtualization different from database federation?
数据库虚拟化与数据库联邦有何区别?
Database federation describes autonomous sources and distributed query relationships. Database virtualization adds the consumer-facing abstraction: global schemas, business views, metadata, security, and a stable access contract. Implementations often combine both.
数据库联邦描述自治来源及分布式查询关系;数据库虚拟化进一步提供面向使用者的抽象,包括全局Schema、业务视图、元数据、安全和稳定访问契约。实际实现通常同时使用两者。
What makes a virtual database view trustworthy?
怎样让虚拟数据库视图可信?
A trustworthy view defines grain, keys, types, time semantics, null handling, ownership, freshness, access policy, and lineage. Teams must reconcile results against source queries and test failures, schema drift, and partial responses.
可信视图应定义粒度、键、类型、时间语义、空值处理、责任、新鲜度、访问策略和血缘。团队还要用来源查询核对结果,并测试故障、Schema漂移和部分响应。
What is the main operational risk?
主要运营风险是什么?
The main risk is hiding semantic and performance differences behind a convenient interface. Incorrect joins, stale metadata, unsafe pushdown, source overload, or broader permissions can produce plausible but wrong or disruptive results.
主要风险是便捷接口掩盖语义和性能差异。错误连接、过期元数据、不安全下推、来源过载或权限扩大,都可能产生看似合理但错误或具有破坏性的结果。
Official Sources and Verification Notes官方来源与验证说明
- AWS overview of logical data virtualizationAWS逻辑数据虚拟化概述
- IBM data virtualization architecture and use casesIBM数据虚拟化架构与用例
- Trino documentation for query pushdownTrino查询下推文档
- Microsoft PolyBase data virtualization guideMicrosoft PolyBase数据虚拟化指南
- PostgreSQL foreign-data access documentationPostgreSQL外部数据访问文档
Capabilities vary by engine and connector. Verify exact source support, type mappings, pushdown, identity propagation, transaction behavior, caching, and commercial terms for the deployed version.
不同引擎和连接器的能力不同。应针对部署版本验证具体来源支持、类型映射、下推、身份传递、事务行为、缓存和商业条款。
