Versioning best practices
Overview
This page details some best practices for version history in Cinchy. These recommendations are important because they can help:
- Minimize your database bloat/size.
- Make it easier to parse through version history when there aren't hundreds of redundant records.
Best practices
- When doing any type of update statement, it's best to include an opposite “where” clause to avoid creating unnecessary history for unchanged values.
- For example, if your update was set name to Marc, you would include a where name doesn't already equal Marc. Doing so prevents a redundant update in your version history.
UPDATE
[Contacts].[Employees]
SET [Name] = Marc
WHERE [Name] != Marc
- When writing an update statement, run it more than once. If it results in an update each time, return to your query and troubleshoot.
- This is relevant anywhere the statement can be run repeatedly, such as in APIs or Post Sync Scripts.
- In data syncs, ensure that your data types are matched properly.
- For example, if the source is text and the target is data, even if the values are the same, it will update and create unnecessary version history.
- When performing a data sync, run it more than once. If it creates an update each time, return to your configuration and troubleshoot.