Client processing for binary XML in a database system

Information

  • Patent Application
  • 20070208752
  • Publication Number
    20070208752
  • Date Filed
    November 16, 2006
    18 years ago
  • Date Published
    September 06, 2007
    17 years ago
Abstract
Techniques are provided for encoding/decoding binary XML data in a client program before sending/receiving the XML to/from a database server. By encoding the binary XML at the client, the overhead of parsing the XML text is avoided by the database server, thus improving database server scalability. Also, the XML data is sent by the server to the client in the binary form, and the binary format is decoded by the client program to perform the necessary operations.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:



FIG. 1 is a block diagram of a system that uses server-side translation of binary XML;



FIG. 2 is a block diagram of a system that uses client-side translation of binary XML, according to an embodiment of the invention;



FIG. 3 is a flowchart that illustrates steps for client-side encoding of binary XML, according to an embodiment of the invention;



FIG. 4 is a block diagram that illustrates client-side decoding of binary XML, according to an embodiment of the invention; and



FIG. 5 is a block diagram that illustrates a computer system upon which an embodiment of the invention may be implemented.


Claims
  • 1. A method comprising performing a machine-executed operation involving instructions, wherein said instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform certain steps including: sending from a client to a database server a request for binary XML data;receiving the binary XML data from the server at the client; andproducing text XML data by decoding the binary XML data at the client based on translation information obtained from the database server;
  • 2. The method of claim 1 wherein the step of producing Text XML data includes: checking a client-side cache for the translation information;upon detecting that the client-side cache does not include the translation information required to produce said text XML, requesting the translation information from the database server; andupon receiving the translation information from the database server, storing the translation information in the client-side cache.
  • 3. The method of claim 2 wherein the step of checking the client-side cache for translation information includes: determining a namespace associated with the binary data; anddetermining whether the client-side cache includes token mappings for said namespace.
  • 4. The method of claim 1 wherein the step of producing Text XML data includes: checking a client-side cache for the translation information;upon detecting that the client-side cache includes the translation information, determining whether a dirty flag associated with the translation information is set;upon detecting that the dirty flag associated with the translation information is set, refreshing the translation information in the client-side cache by requesting a refreshed version of the translation information from the database server;upon receiving the refreshed version of the translation information from the database server, storing the refreshed version of the translation information in the client-side cache.
  • 5. The method of claim 1 wherein the step of producing Text XML data includes: checking a client-side cache for the translation information;upon detecting that the client-side cache includes the translation information, beginning the decoding of the binary XML data based on the translation information in the client-side cache;upon detecting an unknown replacement value in the binary XML data, refreshing the translation information in the client-side cache by requesting a refreshed version of the translation information from the database server; andupon receiving the refreshed version of the translation information from the database server, storing the refreshed version of the translation information in the client-side cache.
  • 6. The method of claim 1 wherein the client is a middleware layer in a communication path between a database client and the database server.
  • 7. A method comprising performing a machine-executed operation involving instructions, wherein said instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform certain steps including: obtaining, at a client, text XML data to be stored as binary XML data in a database managed by a database server;producing binary XML data at the client by encoding the text XML data at the client based, at least in part, on translation information obtained from the database server; andproviding the binary XML data from the client to the server;
  • 8. The method of claim 7 wherein the step of producing binary XML data includes: checking a client-side cache for the translation information;upon detecting that the client-side cache does not include the translation information required to produce said binary XML data, requesting the translation information from the database server; andupon receiving the translation information from the database server, storing the translation information in the client-side cache.
  • 9. The method of claim 8 wherein the step of checking the client-side cache includes: determining a namespace associated with the text XML data; anddetermining whether the client-side cache includes token mappings for said namespace.
  • 10. The method of claim 7 wherein the step of producing binary XML data includes: beginning the encoding of the text XML data based on translation information in a client-side cache; andupon detecting an unknown token in the text XML data, (a) generating a client-generated token mapping for the unknown token, and (b) marking as dirty the translation information, within the client-side cache, that is being used to encode said text XML data.
  • 11. The method of claim 7 wherein the step of producing binary XML data includes: checking a client-side cache for the translation information;upon detecting that the client-side cache includes the translation information, determining whether a dirty flag associated with the translation information is set;upon detecting that the dirty flag associated with the translation information is set, refreshing the translation information in the client-side cache by requesting a refreshed version of the translation information from the database server; andupon receiving the refreshed version of the translation information from the database server, storing the refreshed version of the translation information in the client-side cache.
  • 12. The method of claim 7 wherein the step of producing binary XML data includes: beginning the encoding of the text XML data based on translation information in a client-side cache; andupon detecting an unknown token in the text XML data, sending the database server the unknown token and receiving from the database server a token mapping for said unknown token.
  • 13. The method of claim 7 wherein the client is a middleware layer in a communication path between a database client and the database server.
  • 14. A method comprising performing a machine-executed operation involving instructions, wherein said instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform certain steps including: receiving from a client at a database server a request for binary XML data;sending the binary XML data from the database server to the client; andsending translation information from the database server to the client to enable the client to produce text XML data by decoding the binary XML data at the client based on the translation information;
  • 15. The method of claim 14 wherein the step of sending translation information is performed before sending the database server receives the request from the client, enabling the client to produce the text XML data by decoding the binary XML data based on a copy of the translation information that is stored in a client-side cache.
  • 16. A method comprising performing a machine-executed operation involving instructions, wherein said instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform certain steps including: sending from a database server, to a client, translation information obtained from a database managed by the database server to enable to the client to produce binary XML data based, at least in part, on the translation information;receiving the binary XML data from the client at the server; andstoring the binary XML data in the database;
  • 17. The method of claim 16 wherein: the translation information does not include a token mapping for a particular token; andthe certain steps include: receiving, from the client, a client-generated token mapping for said particular token; andthe server storing the client generated token mapping in the database as part of the translation information.
  • 18. The method of claim 16 wherein: the client is one of a plurality of clients to which the database server provides the translation information;the translation information does not include a token mapping for a particular token; andthe certain steps include: receiving, from two or more of said plurality of clients, conflicting client-generated token mappings for said particular token;choosing, at the server, one of the plurality of client-generated token mappings; andremapping, at the server, binary XML data that encodes said token based on client-generated token mappings other than the chosen client-generated token mapping.