List of articles   Choose language


Bringing DBMS in line with modern communication requirements - SQL:2009


Today, when computers present at almost each work space, any average worker is on frontier - he must independently accept, send, or process data. It's comfortable to accumulate data in a database, but average person cannot:

This paper describes proposed solutions for the above problems, and author would be interested in opinions, comments and possible implementation. Details are stated in pdf-document (we will refer below to pages of that document). All problems, except 2-nd, can be solved with usage of proprietary formats of data transferring, and are formulated as transfer of XML only for unification with 2-nd problem.


Solution of 1-st problem - interface 'model - window system' - is described in previous publication. To direct DBMS to change its data format from XML to X11 and to take away invisible surfaces, postfix 'PROJECTING' is used in operator 'SELECT'. In particular case of two-dimensional data, objects must be written using data schema (what is understandable for users) instead of pretentious (and redundant) data types, which user does not master. Single difference from previous publication is that author proposes to send X11 data to client in XML-wrapper in purpose of unification with XML.

To solve 2-nd problem, it's necessary to provide possibility to install DBMS and immediately use it, like user install and use programs "Teleport", "FlashGet", browser, etc. DBMS itself must accept XML, and place data from it into tables under some agreements. My proposals about these agreements are:

It is impossible to avoid attention from reverse problem - problem of output of a record as xml-element. Usage of both SQL/XML-functions and syntax of proprietary web-server [3] gives very bulky code, in which user gets mixed up. At the same time, usually records are extracted, which already bound by foreign key. So we have a tree, already formed in schema of database. I propose elegant 'select a.b.c' to select data from tables 'a', 'b', 'c', already bound by foreign keys [4]. Let's name this by term 'XTree' - in analogy with 'XPath' (it's supposed, that tables refer to each other by only one foreign key, and that two tables don't refer to each other simultaneously [5]).

As for 3-rd problem, it's necessary to note, that SQL would be more flexible and convenient for distributed request (gathering data from several databases and scattering them into several databases), than branded programs; including more convenient for replication, than branded programs. But there is no necessary syntax:

In purpose of security, distributed requests must satisfy some requirements. I propose concept of whole mistrust of one database to another:

And concept of client simplicity:

So one database can't create and enter sql-command into other database neither directly, nor indirectly (asking client to forward command). And client can't construct new sql-command on base of parsing of entered sql-command.

First database sends special command to client, which force client to make substitution inside last sql-command, sent to first database and memorized in client stack, and to send result of transformation into second database. Special commands must be so limited, that to not allow appearance of sql-command, harm for second database [7].

To solve 4-th problem, it's enough to enter operator 'FREEZE (similar to 'DISCONNECT'), which saves transaction in current state; and operator 'UNFREEZE (similar to 'CONNECT'), which continues transaction from frozen state (instead starts new transaction, as 'CONNECT'). 'FREEZE' returns identifier of frozen transaction, which should be specified in 'UNFREEZE'.


[1] If two tables refer to each other, or one table refers to another by several foreign keys, than this ambiguity is solved in name of opening xml-tag: Sign '#' and name of necessary referring field (not name of constraint, i.e. name of foreign key) are specified after strictly name of table, containing necessary foreign key. It looks like new tag name with symbol '#' in the middle of the name (p.83-85). We shall name this specifying of referring field by term 'determination'

[2] If table refers to self by several foreign keys, than this ambiguity is also solved in name of opening xml-tag: Sign '$' and name of necessary referring field (not name of constraint, i.e. name of foreign key) are specified after strictly table name. It also looks like new tag name with symbol '$' in the middle of the name (p.86-87). We shall name this specifying of referring field by term 'determination' too. Determination must be specified in each of consecutively located xml-elements with the same name - including in the first element (that user think less). Different signs - '#' and '$' - are used in two different types of determination, that it would possible to use both types of determination simultaneously: 'tag#field1$field2'

[3] Turning all relational fields not into xml-attributes, but into xml-elements is suitable for browser, but does not suit for mash-up services and much languages, based on XML

[4] But it's very easy to bind two trees (BTT), as it's shown on p.25

[5] If two tables refer to each other, or one table refers to another by several foreign keys, than this ambiguity is solved in request of tree: Sign '#' and name of necessary referring field (not name of constraint, i.e. name of foreign key) are specified after strictly name of table, containing necessary foreign key. It looks like new table name with symbol '#' in the middle of the name (p.12-14). We shall name this specifying of referring field by term 'refinement'. Similarly, if table contains a list and refers to self by several foreign keys, than this ambiguity is also solved in request of tree: Sign '$' and name of necessary referring field (not name of constraint, i.e. name of foreign key) are specified after strictly table name. It also looks like new table name with symbol '$' in the middle of the name (p.15-16). We shall name this specifying of referring field by term 'refinement' too. Different signs - '#' and '$' - are used in two different types of refinement, that it would possible to use both types of refinement simultaneously: 'table#field1$field2'

[6] Thus one sql-statement with society means a great number of sql-statements with nicknames. Besides this, that nicknames (p.123), several societies or several mentions of one society (p.125) don't specify the same database simultaneously, we place symbol '%' before them; and that several mentions of one society always synchronously specify the same database, we place any word (identical) and symbol '%' before this mentions (p.128-130)

[7] I propose to formulate these special commands like xml as <?command/?> (p.135, 151, 173) to distinguish them both from sql-commands, and from xml-data (traditionally formulated as <element/>). Besides this, I propose operator 'POSTPONE' to freeze 2- and 3-phase 'COMMIT' (2PC and 3PC) on second phase, and operator 'ADJOURN' to freeze 3-phase 'COMMIT' (3PC) on third phase (p.180-181)

References:

  1. P.Scarponcini. SQL Multimedia and Application Packages - Part 3: Spatial. Bentley Transportation, 2000-03-26. http://www.wiscorp.com/sqlspat.zip
  2. SQL Standard - SQL/XML Functionality. ISO/IEC JTC1/SC32 #1293, 2005-04-22. http://jtc1sc32.org/doc/N1251-1300/32N1293-WG3-Presentation-for-SC32-20050418.pdf
  3. K.Kulkarni. Overview of SQL:2003. p.65, part 14 "SQL/XML", Silicon Valley Laboratory, IBM Corporation, San Jose, 2003-11-06. http://www.wiscorp.com/SQL2003Features.pdf
  4. Folksonomy. //Wikipedia. http://en.wikipedia.org/wiki/Folksonomy
  5. Mash-up, syndication. //Wikipedia. http://en.wikipedia.org/wiki/Web_2.0
  6. N.Mattos, H.Darwen, P.Cotton, P.Pistor, K.Kulkarni, S.Dessloch, K.Zeidenstein. SQL99, SQL/MM, and SQLJ: An Overview of the SQL standards. http://www.wiscorp.com/sql1999_c3.zip
  7. How to add style to XML. //W3C papers. http://www.w3.org/Style/styling-XML
  8. CSS vs. XSL. //W3C papers. http://www.w3.org/Style/CSS-vs-XSL
  9. XML Path Language (XPath). Version 1.0. //W3C Recommendation, 16 November 1999. http://www.w3.org/TR/xpath
  10. XML submission. //Web Forms 2.0, Working Draft, 12 October 2006. http://www.whatwg.org/specs/web-forms/current-work/#x-www-form-xml

Dima Turin, dmitryturin@yandex.ru



List of articles   Choose language