FIELD OF THE INVENTION
This invention relates to database management systems and, more particularly to multi-user database systems which allow concurrent access to a relational database by an arbitrary number of database users.
BACKGROUND OF THE INVENTION
Collections of data called databases are well known. Computer systems which can be used by multiple users are also well known. When more than one user on a multi-user system attempts to access a database, problems may arise. If one user isreading from the database ,while another user is writing to the database, the data integrity of the data read by the first user is suspect. If two users are attempting to write data to the database, what is actually written is unpredictable and so dataintegrity is suspect. To minimize these and other data integrity problems, locking schemes were implemented, whereby only one user at a time was allowed to access the database.
Locking a database meant that, whenever a user was reading from or writing to the database, only that user was allowed to access that database, while all other users were locked out. Thus, the problem of one user writing data to a database whileanother prior user is reading the same data from the database was eliminated. The problem of two users simultaneously writing to a database was also eliminated.
However, locking still did not solve all data integrity problems. For example: User one reads from a database; User two writes data into the same database; and then, user one writes data back into the database. User one may have overwritten thedata which user two had written into the database without either user knowing that the data had been altered by the other.
In addition to data integrity problems, locking created system bottlenecks which severely impacted overall system performance, even in a small system with a small number of users. A single user could monopolize a database by gaining access andholding it locked. Other users were forced to wait for access until that first single user released the lock on the database. After the first user released the lock, a second user was free to gain access to the database and monopolize it just as thefirst user had. That time spent idly waiting was unproductive, wasted and, therefore, impaired system performance. For a larger system with a large number of users attempting to access the same database, the effective result was the same regardless ofwhether a single user was monopolizing the database. That was because even if no single user attempted to monopolize a single database, the aggregate time spent by all of the users attempting to access the database meant that each user spent asignificant amount of time idly waiting for a turn in accessing the database.
In order to address this locking problem and to improve multi-user system performance by reducing the amount of time each user spent waiting for the same database, locks were distinguished based on the type of user access to the database. Thuslocks were distinguished as read locks or write locks. A user having a read lock merely prevented another user from writing to the database, while allowing other users to obtain read locks and, concurrently, to read from the same database. A userhaving a write lock excluded all access by other users until the user having the write lock released the write lock. A system having read locks and write locks to achieve concurrency is also known as "several readers and one writer" system.
This "several readers and one writer" system was inefficient for database applications wherein many users use the same data and, therefore, each user maintains a private copy of the database. One way in which the "many readers and one writer"system was inefficient was that building such a database was slow because only one user at a time could write data to the database in order to update the database. First data was written by the user to the user's private copy. Next, the usertransferred the updated private copy to a central master copy of the database. Then the updating user notified every other user of the update. Finally, each user copied the updated master copy into the user's private copy. The next user, wishing toupdate the database, repeated the steps taken by the previous user in updating the database. A user writing to the database was given a write lock which precluded other users from even reading the database during the write.
When a database is organized as a table, often each database user maintains a private copy. Databases organized as tables and called relations are described in C.F. Date, An Introduction to Database Systems, 4th edition; Addison-Wesley, 1986. A relation has rows called tuples and columns. Each column has a unique name called the column's attribute. Each element in a tuple (or row) is called an item. Each item is identified by the attribute for the column in which it resides. If each tuplehas an item or group of items which uniquely identify it, e.g., a row number, then the identifying item(s) is (are) called the tuple's key. If the key is a group of items, then the group is called a composite. Typically, whenever any user modified aprivate copy of a table, that user had to notify other users that the table was modified, and then send a copy of the altered database to each user. Consequently, each user was then required to update the private copy and, possibly to re-executecalculations or instructions that the user had already executed on the data in the prior copy. Because, very often, each user was only interested in a small subset of the data in an entire table, alterations made to a part of the table by one user mightnot affect most of the other users. However, regardless of whether alterations to a table affected a user's area of interest, every user holding a private copy was required to update it. Thus, it was more likely than not that the majority of users wereunnecessarily forced to update a private copy which wasted valuable computer time and resources. Furthermore, this waste was geometrically proportional to the size of the table and the number of concurrent users. This geometric increase results becauseevery user is required to store a large table each time even a single item in one of the private copies is altered.
Also, as the number of users and the size of the table increase, it is increasingly likely that alterations to the table made by one user would not affect every other concurrent user. Since for a very large database, each user, very likely, isusing only a portion of the table, other concurrent users, very likely, also were using different portions which would not include an altered portion. Thus, forcing every user to update or store an updated private copy of a large table regardless ofwhether the user is affected by the update wasted a significant amount of computer time and resources.
These problems are especially acute in designing highly complex, dense, integrated circuit chips wherein hundreds of designers (users) require concurrent access to design data stored in a single table. Allowing a single user to lock the tableduring a write delayed all of the other users. Further initially creating the table was slow because, although each of the hundreds of users could create part of the data simultaneously, e.g., one row, only one user at a time could store the datacreated. Data was stored in the table by copying the table, altering the copy and then storing the altered copy. So, to store data from hundreds of users, the table had to be copied, altered and stored hundreds of times. Each user had to wait for aturn to update the table. Sequentially storing data in the table was both inefficient and time consuming. It was also inefficient to prevent users from reading data which may remain unaltered even after the table is updated.
OBJECTS OF THE INVENTION
It is an object of this invention to reduce integrated circuit chip design time.
It is another object of this invention to improve relational database management.
It is still another object of this invention to reduce waste of valuable computer time and resources.
It is still another object of this invention to improve database system performance.
It is still another object of this invention to improve relational database integrity for concurrently used multi-user databases.
It is still another object of this invention to minimize relational database locking by a single user.
It is still another object of this invention to reduce interference among concurrent relational database users.
It is still another object of this invention to increase relational database availability for concurrent use by more concurrent users.
It is still another object of this invention t increase the number of users that may concurrently use a relational database in a multi-user database system.
It is still another object of this invention to increase the number of designers that may concurrently work on the same integrated circuit chip design.
It is still another object of this invention to improve relational database management, database system performance, and relational database integrity.
It is still another object of this invention to increase the number of users that may concurrently use a relational database, while reducing interference to database use.
It is still another object of this invention to improve relational database integrity, system performance and management, while increasing relational database availability for use by a larger number of concurrent users in a multi-user databasesystem.
It is still another object of this invention to reduce integrated circuit chip design time while increasing the number of chip designers that may concurrently work on designing the same integrated circuit chip and reducing interference betweenchip designers.
SUMMARY OF THE INVENTION
In accordance with the objects of this invention a relational database system for use in designing integrated circuit chips is provided, which allows concurrent use of large tabular databases by a large number of designers and other users.
A single master copy of a large table is stored and maintained. The table has a plurality of rows and columns. Each row has a time-date stamp in three columns which contains the time and date of the last modification to any of the items in therow and the identification of the user that made that modification. Each table user is given a private copy of the table called the user's virtual copy. To alter or update the master copy, a user first alters a display of a portion of the virtual copyand then attempts to store the altered display row into the master copy. If the time-date stamp for the Master Table row does not match the time-date stamp for the corresponding row in the altering user's virtual copy, then, the Virtual Table row isupdated from the Master Table row and the user is notified that the attempt to update the Master Table was unsuccessful. Otherwise, if the time-date stamp in the Master Table row matches the time-date stamp for the corresponding row in the user'sVirtual Table, then the time-date stamp is updated and the altered data is transferred from the display to the Virtual Table and to the Master Table.
BRIEF DESCRIPTION OF THE DRAWINGS
While the specification concludes with claims particularly pointing out and distinctly claiming that which is regarded as the present invention, details of the preferred embodiment of the present invention may be more readily ascertained from thefollowing when read in conjunction with the following drawings wherein:
FIG. 1 is an example of a computer display of a portion of a TIME managed database.
FIG. 2 is a flow diagram of how a user enters the relational database management system of the present invention.
FIG. 3 is a flow diagram of how a user updates a database managed by the relational database management system of the present invention.
TECHNICAL DESCRIPTION OF THE PREFERRED EMBODIMENT
The preferred embodiment of the present invention is a Relational Database management method and system for use in design of integrated circuit chips and is called the "Technology Information Management Enhancer" or TIME. TIME is intended forany general purpose computer capable of multiprocessing and concurrent data access by multiple user's. However, the preferred computer is the IBM System 390 operating under the Multiple Virtual Storage (MVS) operating system. A user refers generally toany person, processor, or program being executed by a processor, capable of using data stored in a database. The above list is not intended to be an exclusive list of users, but merely to be an illustrative list of potential TIME users.
FIG. 1 is an example of a computer display of a portion of a TIME managed Table 50. A row 52 of the relational database (table) 50 of the preferred method and system has 100 items 54 as data fields and 3 items 56 , 58 and 60 called the row's"time-date stamp", which contain the date 56 and time 58 of the last modification and the identification 60 of the user that made that modification. Whenever a change is made to one of a row's data field items, the row's time-date stamp is updated withthe time and date of the change and identification of the user making the change. Although, a row of the preferred table organization is 103 items, it is contemplated that the number of items in a row may be varied without significantly departing fromthe spirit of the invention. In particular the number of items provided as data fields may be much more or much less than 100. Also, the time, date and identification items or fields may be mixed, combined or further distinguished without departingfrom the spirit of the invention.
Each user to a TIME managed database holds and maintains a copy of the database. The copy is called the user's Virtual Table. TIME also maintains one master copy of the database called the Master Table. TIME has a single lock for the MasterTable which is sequentially granted to users for updating or for reading the Master Table. When the lock is granted to a user, all other users are locked out of the Master Table and the Master Table is said to be in use. However, since each user has aVirtual Table, locking the Master Table only interferes with users attempting to access, i.e., trying to read from or write to, the Master Table. FIG. 2 is a flow diagram of how a user enters TIME 100 and thus creates a Virtual Table.
Upon entering TIME, i.e., to obtain a virtual copy of a TIME managed relational database, TIME checks to determine if any user has a lock on the Master Table 102. Another user may have a lock on the Master Table either because the user isupdating data in the table or, because the user is copying the Master Table into the user's Virtual Table. If the Master Table is in use (locked), then the user attempting to enter TIME must wait until it is no longer in use. If the Master Table is notin use or, once the Master Table is no longer in use, the user is given a lock on the Master Table. Once the user has the lock, the user "opens" the Master Table 104. "Opening the Master Table" 104 means that the user can read from or write to theMaster Table. Next, the user creates an empty virtual table in the user's memory space with each column having the same attributes as corresponding columns in the Master Table and then, the user copies the Master Table into the empty virtual table 106. After copying the Master Table 106, the user releases the lock on the Master Table 108. Thus, the user has a complete current copy of the Master Table in the user's Virtual Table. Finally, the Virtual Table is displayed for the user 110. In thepreferred embodiment, the Virtual Table is displayed 110 at a computer terminal. However, use of the term display is meant to be illustrative and not restrictive and it is contemplated that "display" includes storage of a portion of the Virtual Table ina display buffer, in working registers or, any form of display suitable to the Virtual Table user is within the spirit and scope of the invention.
Once the Virtual Table is displayed 110, the user has complete uninterrupted use of the Virtual Table. The user is free to read from or write to the Virtual Table without interfering with other users and without interference from other users. All alterations are first made to displayed data and then, if data integrity would not be affected, transferred to the Master Table. Alterations made to the Master Table by a user are reflected in the user's Virtual Table. However, a user's VirtualTable is not updated as the result of another user altering the Master Table until the time-date stamp for the row of the Master Table intended for alteration does not match the time-date stamp for the corresponding row in the updating user's VirtualTable. If the time-date stamps match then the time-date stamp is updated in both rows and the alterations are then transferred from the displayed data to the Master Table row and the updating user's Virtual Table. Otherwise, the updating user isnotified that the row has been altered; the row is updated in the user's Virtual Table, and the user is allowed to alter the updated row. See FIG. 3 for a flow diagram of how the Master Table and the updating user's Virtual Table are updated.
When a user alters the displayed data 120, TIME checks to determine if the Master Table is locked 122. If the Master Table is locked, then TIME waits until the lock is released. Once the lock is released or, if the Master Table is not in use,then TIME opens the Master Table 124. Next, TIME selects the row in the Master Table which contains the altered data 126. The time-date stamp for the selected row is compared against the time-date stamp for the corresponding row in the user's VirtualTable 128. If the two time-date stamps match, then the selected row has not been altered since the user last copied it, i.e. the user's Virtual Table copy of the row was current and correct. If the time-date stamps match, then TIME alters the selectedMaster Table row with the changes from the altered display data, modifies the Master Table row's time-date stamp, and closes the Master Table 130. After closing the Master Table 130, TIME modifies the corresponding row in the user's Virtual Table toaccurately reflect the updated row in the Master Table 134 and displays the updated Virtual Table 136.
However, if, TIME compares the two time-date stamps 128, and they do not match, then another prior user had already altered the selected Master Table row and the corresponding Virtual Table row is stale. The data integrity problems describedabove would occur by allowing a user to update a Master Table row while ignoring updates to the same row by a prior user. So, if the time/date stamps do not match 128 TIME sends the updating user an error message 132 which indicates that another userhad modified some of the data in the selected row. Instead of updating the Master Table row 130, the Master Table row is copied into the Virtual Table 134 and the corrected Virtual Table is displayed 136. The error message 132 also notifies the userthat the row was not updated with the user's intended alterations. If the user still wishes to alter the row, then the user must re-alter the corrected row and update the Master Table as provided above.
Thus the TIME system reduces wasted computer resources and time by supplying each user with an individual copy of a Table which is updated only if the update affects the user and only for the portion of the Table affecting the user.
Although the preferred embodiment of the present invention is herein described, variations and modifications thereof will occur to those skilled in the art. Therefore, it is intended that the appended claims shall be construed to include thepreferred embodiment and all such variations and modifications in form and detail that fall within the spirit and scope of the invention.
* * * * *