IP Library › Granted Patent US 9,898,492
Granted Patent B2
US 9,898,492 · App. 14/488,204 · Granted Feb 20, 2018

Managing data with flexible schema

Inventors: Liang Chen (Beijing, CN); Philip A. Bernstein (Bellevue, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F17/30345G06F17/30292G06F17/30297G06F17/30306
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,898,492
App. No.
14/488,204
Granted
Feb 20, 2018
Kind
B2
Abstract

The subject matter described herein relates to managing data with flexible schema. A method, computer storage medium, and system are provided for managing data with flexible schema. In one embodiment, the method comprises providing a logical view for logical tables of a database; and managing mappings between the logical tables and a physical table according to predefined mapping constraints, each of the logical tables mapped as a part of the physical table. The mapping constraints at least specify that (i) a logical column in the logical tables is mapped to at least one physical column in the physical table, and (ii) distinct logical columns in one of the logical tables are mapped to distinct physical columns in the physical table. As a result, schema evolution may be done with minimized data migration.

Claims (67)

1. A method implemented at least in part by a computer comprising:

providing a logical view for logical tables of a database;

managing a physical table, including at least one of the following:

reducing a storage space for a physical column in the physical table responsive to determining that a density of the physical column is below a predefined threshold; and

reusing the physical column when a logical column of the logical tables is mapped into the physical table; and

managing a mapping between the logical tables and a physical table according to predefined mapping constraints, each of the logical tables mapped to a part of the physical table, wherein managing the mapping comprises:

managing associations between records in the physical table and the logical tables based on identifiers of the logical tables, the associations enabling each of the logical tables to have a plurality of identifiers, and each of the logical tables sharing an identifier, and

the mapping constraints at least specifying that (i) a logical column in the logical tables is mapped to at least one physical column in the physical table, and (ii) distinct logical columns in one of the logical tables are mapped to distinct physical columns in the physical table.

2. The method of claim 1 , further comprising:

determining a width of the physical table at least in part based on number of logical columns in the logical tables and number of distinct data types of the logical columns.

3. The method of claim 1 , further comprising:

receiving, through the logical view, a query over at least one of the logical tables; and

translating the received query to a query over the physical table at least in part based on the mapping.

4. The method of claim 1 , further comprising:

receiving, through the logical view, a first transaction that includes a request for evolution of a schema for at least one of the logical tables; and

evolving the schema at least in part based on the mapping, such that migrations of data in the at least one logical table are minimized during the evolving.

5. The method of claim 4 , wherein the request for the evolution includes a primitive for the evolution, and wherein evolving the schema comprises:

translating the primitive into at least one statement that updates the mapping.

6. The method of claim 4 , further comprising:

determining whether the at least one logical table is accessed by a second transaction, the second transaction initiated prior to the first transaction and overlapped with the first transaction; and

responsive to determining that the at least one logical table is accessed by the second transaction, controlling concurrency between the first and second transactions depending on whether the evolution of the schema causes a migration of the data in the at least one logical table.

7. The method of claim 6 , wherein controlling the concurrency between the first and second transactions comprises:

responsive to determining that the evolution of the schema causes the migration of the data, preventing the data in the at least one logical table from being modified or migrated by the second transaction during the migration of the data.

8. In a computing environment, a system comprising: at least a processor;

a logical view manager configured to provide a logical view for logical tables of a database;

the processor configured to:

manage a physical table, including at least one of the following:

reducing a storage space for a physical column in the physical table responsive to determining that a density of the physical column is below a predefined threshold; and

reusing the physical column when a logical column of the logical tables is mapped into the physical table; and

manage a mapping between the logical tables and a physical table according to predefined mapping constraints, each of the logical tables mapped as a part of the physical table, wherein managing the mapping comprises:

managing associations between records in the physical table and the logical tables based on identifiers of the logical tables, the associations enabling each of the logical tables to have a plurality of identifiers, and

each of the logical tables sharing an identifier, and

the mapping constraints at least specifying that (i) a logical column in the logical tables is mapped to at least one physical column in the physical table, and (ii) distinct logical columns in one of the logical tables are mapped to distinct physical columns in the physical table.

9. The system of claim 8 , wherein a width of the physical table is determined at least in part based on number of logical columns in the logical tables and number of distinct data types of the logical columns.

10. The system of claim 8 , further comprising a query manager configured to:

receive, through the logical view, a query over at least one of the logical tables; and

translate the received query to a query over the physical table at least in part based on the mapping.

11. The system of claim 8 , further comprising a schema manager configured to:

receive, through the logical view, a first transaction that includes a request for evolution of a schema for at least one of the logical tables; and

evolve the schema at least in part based on the mapping to minimize migrations of data in the at least one logical table.

12. The system of claim 11 , wherein the request for the evolution includes a primitive for the evolution, and wherein the schema manager is configured to:

translate the primitive into at least one statement that updates the mapping.

13. The system of claim 11 , further comprising a transaction manager configured to:

determine whether the at least one logical table is accessed by a second transaction, the second transaction initiated prior to the first transaction and overlapped with the first transaction; and

responsive to determining that the at least one logical table is accessed by the second transaction, control concurrency between the first and second transactions depending on whether the evolution of the schema causes a migration of the data in the at least one logical table.

14. The system of claim 13 , wherein the transaction manager is configured to:

responsive to determining that the evolution of the schema causes the migration of the data, prevent the data in the at least one logical table from being modified or migrated by the second transaction during the migration of the data.

15. A computer hardware storage device having computer-executable instructions, which when executed perform actions comprising:

providing a logical view for logical tables of a database;

managing a physical table, including at least one of the following:

reducing a storage space for a physical column in the physical table responsive to determining that a density of the physical column is below a predefined threshold; and

reusing the physical column when a logical column of the logical tables is mapped into the physical table; and

managing a mapping between the logical tables and the physical table according to predefined mapping constraints, each of the logical tables mapped as a part of the physical table,

wherein managing the mapping comprises:

managing associations between records in the physical table and the logical tables based on identifiers of the logical tables, the associations enabling each of the logical tables to have a plurality of identifiers, and each of the logical tables sharing an identifier, and

the mapping constraints at least specifying that (i) a logical column in the logical tables is mapped to at least one physical column in the physical table, and (ii) distinct logical columns in one of the logical: tables are mapped to distinct physical columns in the physical table.

16. The computer hardware storage device of claim 15 , wherein the computer-executable instructions, which when executed further perform actions comprising:

receiving, through the logical view, a first transaction that includes a request for evolution of a schema for at least one of the logical tables; and

evolving the schema at least in part based on the mapping, such that migrations of data in the at least one logical table are minimized during the evolving.

17. The computer hardware storage device of claim 15 , wherein the request for the evolution includes a primitive for the evolution, and wherein evolving the schema comprises:

translating the primitive into at least one statement that updates the mapping.

18. The computer hardware storage device of claim 16 , have further computer executable instructions, which when executed perform actions comprising:

determining whether the at least one logical table is accessed by a second transaction, the second transaction initiated prior to the first transaction and overlapped with the first transaction; and

responsive to determining that the at least one logical table is accessed by the second transaction, controlling concurrency between the first and second transactions depending on whether the evolution of the schema causes a migration of the data in the at least one logical table.

19. The computer hardware storage device of claim 18 , wherein controlling the concurrency between the first and second transactions comprises:

responsive to determining that the evolution of the schema causes the migration of the data, preventing the data in the at least one logical table from being modified or migrated by the second transaction during the migration of the data.

20. The computer hardware storage device of claim 15 , have further computer instructions, which when executed perform actions comprising determining a width of the physical table at least in part based on number of logical columns in the logical tables and number of distinct data types of the logical columns.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 9, 2015
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 039025/0454 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2014
From: BERNSTEIN, PHILIP A.; CHEN, LIANG
To: MICROSOFT CORPORATION
Reel/Frame 033753/0273 →
Continuity (1)
Related Publication 20150379058A1 · Dec 31, 2015