skip to main content

Evolutionary Maintenance

The Livebase platform supports the modeler in the evolutionary maintenance phase of the Cloudlet, verifying following changes made to the model the consistency in the structure and quality of the data present at that time on the database.

Development Cycle #

At any time, a running Cloudlet can be stopped and its engine can be replaced with an updated version present in the library (Engine library). This operation is called evolutionary maintenance and it makes it possible to make changes to an existing Livebase application while eliminating the risk of losing data in the database.
Every time changes are made to the Cloudlet engine or database, the Database checker verifies the compatibility between these two elements, detecting and cataloging any alignment problems between the data present and the structure of the model.

An example procedure for updating a Cloudlet might look like the following:

Cloudlet management

An example of a Livebase application development cycle

In the following example, the engine currently installed on the Cloudlet (Thesfor) is replaced by a new version in the library, the Thesfor-NEW-ENGINE engine, triggering checker checks and possibly generating a compatibility problem report.

Installing a new model on the Cloudlet

Installing a new model on a Cloudlet

Alignment between database and model #

Let’s see now in detail all the phases in which the platform controls the alignment between model and database:

  1. When a model is installed on a Cloudlet, even before checking for any alignment issues with the database, the Designer ensures in real time that the model is always valid and consistent: when there are issues that cannot be resolved automatically, or even more so issues that must necessarily be resolved manually, the platform prevents the model from being saved until such issues have been resolved.

  2. After the user has saved the changes, the platform checks that the structure and constraints of the model are compatible with the database installed on the Cloudlet. An action plan is then developed to update the database and the generated application:

    • initially, the DB Checker checks that the existing data is compatible with the new structure, identifying and cataloging any misalignment with the existing data and model structure. This check is performed every time the model is modified or following an explicit command launched by the user (Force check, accessible by right-clicking on the database icon in the tester version);
    • afterwards, the DB Updater updates the database structure by adding, modifying and removing structure-level elements.
  3. Once the alignment with the database is complete, you can restart the Cloudlet; at this stage, all parts of the application affected by the changes are regenerated.

Misalignment between engine and database

Misalignment between engine and database after installing a new version of the model on the Cloudlet

Report alignment problems #

Alignment problems are classified into three types. The icon () represents the Cloudlet’s database; when it is free of warning, model and database are perfectly aligned and the Cloudlet can be started without problems. In case of misalignment, however, the icon changes showing a different warning depending on their severity (severity):

  • Low severity issue: low impact change, which can be handled automatically by Livebase without data loss. Cloudlet can be restarted without any problems;
  • Medium severity issue: mismatch that can be resolved automatically by Livebase, but in some cases results in data loss. In the presence of this type of issue Livebase asks the user to review the changes and give explicit confirmation before proceeding;
  • High severity issue: severe alignment issue that cannot be fixed automatically. Livebase prevents starting Cloudlet and forces the user to manually resolve the error.

The compatibility issue report can be accessed by clicking on the database icon and selecting the Engine compatibility issues tab; within it you can see the severity of the problem (Severity), the type (Issue type), a brief description (description), and the action needed to resolve it (Required action).

The Engine compatibility issues tab

The Engine compatibility issues tab

The Resolve all issues button (bottom right) allows you to automatically align model and Database by performing the necessary operations.

Misalignment scenarios between model and database #

We list in this section all possible mismatch scenarios detectable by the Database checker, divided by categories. Next to the description is the severity of the related compatibility issue; some types of issue may have different levels of severity.

New model element #

TypeScenarioSeverity
Class createdCreating a [class] (/en/guide/modeling/database-schema/classes/classes-definition/)
Attribute createdCreating an [attribute] (/en/guide/modeling/database-schema/attributes/attribute-definition/) non [required](/en/guide/modeling/database-schema/attributes/native-attributes/# constraints-of-integrity)
Attribute createdCreation of a required attribute in class without objects
Relation createdCreating a relation with a required Foreign key in a table without data
Relation createdCreating a relationship with Foreign key not required
Unique constraint addedCreating a unique constraint in a table without data
Unique constraint addedCreating a unique constraint in a table that respects this constraint
Index constraint createdCreating an index on the class
Attribute NOT NULL constraint addedCreating an integrity constraint for an attribute in a class with no objects or where the attribute is valued for all records in the table

Model element deleted #

TypeScenarioSeverity
Class deletedDeleting a class without objects
Class deletedDeleting a class with at least one object
Attribute deletedDeleting an attribute in a class without objects
Attribute deletedDeleting an attribute in a class with at least one object
Relationship deletedDeleting a relationship where the Foreign key points to a table with no data
Relationship deletedDeleting a relation where the Foreign key points to a table with data
Unique constraint deletedElimination of a unique constraint
Index constraint deletedDeleting a constraint on an index
Attribute NOT NULL constraint deletedDeleting a required attribute

Model element renamed #

TypeScenarioSeverity
Class renamedRenaming a Class
Attribute renamedRenaming an attribute
Role renamedRenaming a role

Attribute modified #

TypeScenarioSeverity
Attribute type modifiedAttribute type change with data type conversion possible
Attribute definition modifiedRenaming an attribute with data type conversion possible
Attribute definition modifiedRenaming a required attribute in a class without objects
Attribute definition modifiedRenaming an attribute with a domain constraint
Attribute domain modifiedEdit on [domain restriction] (/en/guide/modeling/database-schema/attributes/native-attributes/#the-domain) of an attribute in a class without objects, or in which the records respect the new domain

Relation modified #

TypeScenarioSeverity
Relation cardinality modifiedChanging the [multiplicity] (/en/guide/modeling/database-schema/relationships/relationships-definition/#multiplicity) of a relationship
Relation cardinality modifiedMultiplicity Loosening (e.g. 01-010N-0N)
Relation cardinality modifiedTightening of multiplicity (e.g. 0N-0N01-01) for a relation that has no data or whose data respect the new multiplicity
Relation navigability modifiedChanging [navigability] (/en/guide/modeling/database-schema/relationships/relationships-definition/#navigability) of a relation which changes the source of the relation and therefore the side of the Foreign key
Association transformed in compositionAssociation turned into composition
Composition transformed in associationComposition turned into association

Enum literals modified #

TypeScenarioSeverity
Enum literals modifiedModifying the literals of an Enum

Model constraint violated #

TypeScenarioSeverity
Unique constraint violatedUnique constraint not met by class data (verified via issue Unique constraint added)
Attribute NOT NULL constraint violatedRequired attribute not valued by class data (verified by issue Attribute NOT NULL constraint added)
Composition data corruptedComposition cannot be created/eliminated as you would have part classes without whole classes
Attribute type incompatibleData type of an incompatible attribute (verified by issue Attribute type modified)
Attribute domain constraint violatedViolation of an attribute domain restriction (verified via issue Attribute domain modified)
Relation cardinality incompatiblenon-compatible multiplicity (verified by issue Relation cardinality modified or Relation created)

Orphan database element #

TypeScenarioSeverity
Orphan tableOrphan table (without an equivalent in the model)
Orphan columnOrphan column (without an equivalent in the model)

Orphan model element #

TypeScenarioSeverity
Orphan classOrphan class (without an equivalent in the model)
Orphan attributeOrphan attribute (without an equivalent in the model)

Model element versioned #

Some operations are not supported if versioning is enabled on the:

TypeScenarioSeverity
System versioning class addedAdding versioning to a class
System versioning class removedRemoving versioning on a class
System versioning not supportedAdding a versioning on a class in a database that does not support versioning
Attribute type modified not supportedChanging the data type of an unsupported attribute due to the presence of versioning on the class
Attribute definition modified not supportedUnsupported attribute modification due to the presence of versioning on the class
Relation modified not supportedModification of an unsupported relation due to the presence of versioning on the class
Part class system versioning not supportedModification of an unsupported part class due to the presence of versioning on the class
Composition created not supportedCreation of an unsupported composition due to the presence of versioning on the class