[12866] | 1 | .. _intro: |
---|
[12863] | 2 | |
---|
| 3 | Introduction |
---|
| 4 | ************ |
---|
| 5 | |
---|
[12866] | 6 | The Object Database |
---|
| 7 | =================== |
---|
| 8 | |
---|
[12870] | 9 | Most web portals store their data in a relational database like |
---|
| 10 | PostgreSQL, MySQL or Oracle. A relational database is organized in |
---|
| 11 | tables of rows and columns, with a unique key for each row. Each data |
---|
| 12 | entity gets its own table. Rows in tables can be linked to rows in |
---|
| 13 | other tables by storing the unique key of the row to which it should |
---|
| 14 | be linked. This sounds quite simple. Many computer users are familiar |
---|
| 15 | with this kind of data storage because they are used to spreadsheet |
---|
| 16 | programmes like Excel oder Calc which also organize data in tables. |
---|
| 17 | Kofa's persistent data are stored in a native object database designed |
---|
| 18 | for the Python programming language, the so-called ZODB_. An object |
---|
| 19 | database stores objects with attributes and not records as rows with |
---|
| 20 | columns in tables. These persistent objects can hold any kind of |
---|
| 21 | information in attributes and must not adhere to a specific schema |
---|
| 22 | like records in tables of a relational database. |
---|
[12863] | 23 | |
---|
[12870] | 24 | The ZODB_ also supports a hierarchical, treelike storage of objects. |
---|
| 25 | Objects can contain other objects if they are declared as containers. |
---|
| 26 | Objects are stored like folders and files in a filesystem. This makes |
---|
| 27 | the object handling very fast and transparent because we can access |
---|
| 28 | objects, or more precisely views of objects, by indicating their path |
---|
| 29 | in the database, i.e. by traversing the database tree to the object's |
---|
| 30 | location. Furthermore, we are accessing the views of objects through a |
---|
| 31 | web browser by entering a URL (Uniform Resource Locator). This |
---|
| 32 | publication path corresponds more or less to the traversal path of our |
---|
| 33 | objects. In Kofa the path always contains the object identifiers of |
---|
| 34 | all objects which are passed when traversing the database tree. |
---|
| 35 | Example: |
---|
[12863] | 36 | |
---|
| 37 | https://kofa-demo.waeup.org/students/K1000000/studycourse/100/DCO |
---|
| 38 | |
---|
[12870] | 39 | is the URL which requests a display view of a course ticket with id |
---|
| 40 | ``DCO``. This object is stored in a study level container object with |
---|
| 41 | id ``100``, stored in a study course container object with id |
---|
| 42 | ``studycourse``, stored in the student container object with id |
---|
| 43 | ``K1000000``, stored in the students root container, stored in the |
---|
| 44 | root container of the application, stored in the root of the database |
---|
| 45 | itself. |
---|
[12863] | 46 | |
---|
[12870] | 47 | This kind of storage requires that each object gets a unique object |
---|
| 48 | identifier (object id) within its container. The id string is visible |
---|
| 49 | in the browser address bar. Though it's technically possible for ids |
---|
| 50 | to contain spaces or slashes we do not allow these kinds of special |
---|
| 51 | characters in object ids to facilitate the readability of URLs. |
---|
[12863] | 52 | |
---|
[12866] | 53 | Batch Processing |
---|
| 54 | ================ |
---|
[12863] | 55 | |
---|
[12870] | 56 | Administrators of web portals, which store their data in relational |
---|
| 57 | databases, are used to getting direct access to the portal's database. |
---|
| 58 | There are even tools to handle the administration of these databases |
---|
| 59 | over the Internet, like phpMyAdmin or phpPgAdmin to handle MySQL or |
---|
| 60 | PostgreSQL databases respectively. These user interfaces bypass the |
---|
| 61 | portals' user interfaces and give direct access to the database. They |
---|
| 62 | allow to easily import or export (dump) data tables or the entire |
---|
| 63 | database structure into CSV or SQL files. What at first sight appears |
---|
| 64 | to be very helpful and administration-friendly proves to be very |
---|
| 65 | dangerous on closer inspection. Data structures can be easily damaged |
---|
| 66 | or destroyed, or data can be easily manipulated by circumventing the |
---|
| 67 | portal's security machinery or logging system. Kofa does not provide |
---|
| 68 | any external user interface to access the ZODB_ directly, neither for |
---|
| 69 | viewing nor for editing data. This includes also the export and import |
---|
| 70 | of sets of data. Exports and imports are handled via the Kofa user |
---|
| 71 | interface itself. This is called batch processing which means either |
---|
| 72 | producing CSV files (comma-separated values) from portal data (export) |
---|
| 73 | or processing CSV files in order to add, update or remove portal data |
---|
| 74 | (import). Main premise of Kofa's batch processing technology is that |
---|
| 75 | the data stored in the ZODB_ can be specifically backed up and |
---|
| 76 | restored by exporting and importing data. But that's not all. Batch |
---|
| 77 | processors can do much more. They are an integral part of the student |
---|
| 78 | registration management. |
---|
[12866] | 79 | |
---|
[12867] | 80 | .. note:: |
---|
[12866] | 81 | |
---|
[12870] | 82 | Although exporters are part of Kofa's batch processing module, we will |
---|
| 83 | not call them batch processors. Only importers are called batch |
---|
| 84 | processors. Exporters produce CSV files, importer process them. |
---|
[12867] | 85 | |
---|
| 86 | |
---|
[12863] | 87 | .. _ZODB: http://www.zodb.org/ |
---|