Development Cycle #
At any time, a running Cloudlet can be stopped and its engine can be replaced with an updated version present in the Engine models section. 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 engine.
An example procedure for updating a Cloudlet might look like the following:
In the following example, the engine currently installed on the Cloudlet (Thesfor) is replaced by a new version in the Engine models section, the Thesfor-NEW-ENGINE engine, Triggering the checker and possibly generating a report of compatibility issues.
Alignment between database and engine #
Let’s see now in detail all the phases in which the platform controls the alignment between engine and database:
When an engine model is installed on a Cloudlet, even before checking for any alignment issues with the database, the Designer ensures in real time that the engine 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 engine from being saved until such issues have been resolved.
After the user has saved the changes, the platform checks that the structure and constraints of the engine are compatible with the database installed on the Cloudlet. An action plan is then developed to update the database:
- 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 engine structure. This check is performed every time the engine 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.
- 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 engine structure. This check is performed every time the engine is modified or following an explicit command launched by the user (
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.
Report alignment problems #
Alignment problems are classified into three types. The icon () represents the Cloudlet’s database; when it is free of warning, engine 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 Resolve all issues
button (bottom right) allows you to automatically align engine and Database by performing the necessary operations.
Misalignment scenarios between engine 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 engine element #
Type | Scenario | Severity |
---|---|---|
Class created | Creating a [class] (/en/guide/modeling/database-schema/classes/classes-definition/) | |
Attribute created | Creating an [attribute] (/en/guide/modeling/database-schema/attributes/attribute-definition/) non [required](/en/guide/modeling/database-schema/attributes/native-attributes/# constraints-of-integrity) | |
Attribute created | Creation of a required attribute in class without objects | |
Relation created | Creating a relation with a required Foreign key in a table without data | |
Relation created | Creating a relationship with Foreign key not required | |
Unique constraint added | Creating a unique constraint in a table without data | |
Unique constraint added | Creating a unique constraint in a table that respects this constraint | |
Index constraint created | Creating an index on the class | |
Attribute NOT NULL constraint added | Creating an integrity constraint for an attribute in a class with no objects or where the attribute is valued for all records in the table |
Engine element deleted #
Type | Scenario | Severity |
---|---|---|
Class deleted | Deleting a class without objects | |
Class deleted | Deleting a class with at least one object | |
Attribute deleted | Deleting an attribute in a class without objects | |
Attribute deleted | Deleting an attribute in a class with at least one object | |
Relationship deleted | Deleting a relationship where the Foreign key points to a table with no data | |
Relationship deleted | Deleting a relation where the Foreign key points to a table with data | |
Unique constraint deleted | Elimination of a unique constraint | |
Index constraint deleted | Deleting a constraint on an index | |
Attribute NOT NULL constraint deleted | Deleting a required attribute |
Engine element renamed #
Type | Scenario | Severity |
---|---|---|
Class renamed | Renaming a Class | |
Attribute renamed | Renaming an attribute | |
Role renamed | Renaming a role |
Attribute modified #
Type | Scenario | Severity |
---|---|---|
Attribute type modified | Attribute type change with data type conversion possible | |
Attribute definition modified | Renaming an attribute with data type conversion possible | |
Attribute definition modified | Renaming a required attribute in a class without objects | |
Attribute definition modified | Renaming an attribute with a domain constraint | |
Attribute domain modified | Edit 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 #
Type | Scenario | Severity |
---|---|---|
Relation cardinality modified | Changing the [multiplicity] (/en/guide/modeling/database-schema/relationships/relationships-definition/#multiplicity) of a relationship | |
Relation cardinality modified | Multiplicity Loosening (e.g. 01-01 → 0N-0N ) | |
Relation cardinality modified | Tightening of multiplicity (e.g. 0N-0N → 01-01 ) for a relation that has no data or whose data respect the new multiplicity | |
Relation navigability modified | Changing [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 composition | Association turned into composition | |
Composition transformed in association | Composition turned into association |
Enum literals modified #
Type | Scenario | Severity |
---|---|---|
Enum literals modified | Modifying the literals of an Enum |
Engine constraint violated #
Type | Scenario | Severity |
---|---|---|
Unique constraint violated | Unique constraint not met by class data (verified via issue Unique constraint added) | |
Attribute NOT NULL constraint violated | Required attribute not valued by class data (verified by issue Attribute NOT NULL constraint added) | |
Composition data corrupted | Composition cannot be created/eliminated as you would have part classes without whole classes | |
Attribute type incompatible | Data type of an incompatible attribute (verified by issue Attribute type modified) | |
Attribute domain constraint violated | Violation of an attribute domain restriction (verified via issue Attribute domain modified) | |
Relation cardinality incompatible | non-compatible multiplicity (verified by issue Relation cardinality modified or Relation created) |
Orphan database element #
Type | Scenario | Severity |
---|---|---|
Orphan table | Orphan table (without an equivalent in the engine) | |
Orphan column | Orphan column (without an equivalent in the engine) |
Orphan engine element #
Type | Scenario | Severity |
---|---|---|
Orphan class | Orphan class (without an equivalent in the engine) | |
Orphan attribute | Orphan attribute (without an equivalent in the engine) | |
Engine element versioned #
Some operations are not supported if versioning is enabled on the:
Type | Scenario | Severity |
---|---|---|
System versioning class added | Adding versioning to a class | |
System versioning class removed | Removing versioning on a class | |
System versioning not supported | Adding a versioning on a class in a database that does not support versioning | |
Attribute type modified not supported | Changing the data type of an unsupported attribute due to the presence of versioning on the class | |
Attribute definition modified not supported | Unsupported attribute modification due to the presence of versioning on the class | |
Relation modified not supported | Modification of an unsupported relation due to the presence of versioning on the class | |
Part class system versioning not supported | Modification of an unsupported part class due to the presence of versioning on the class | |
Composition created not supported | Creation of an unsupported composition due to the presence of versioning on the class |