MarkLogic has two features that might suit your needs: document library services and bitemporal.
From the Understanding Library Services:
The Library Services enable you to create and maintain versions of managed documents in MarkLogic Server. Access to managed documents is controlled using a check-out/check-in model. ... When you initially put a document under Library Services management, it creates Version 1 of the document. Each time you update the document, a new version of the document is created. Old versions of the updated document are retained according to your retention policy, as described in Defining a Retention Policy.
And from Understanding Temporal Documents:
You can configure MarkLogic Server to manage and query bi-temporal data. Bi-temporal documents are associated with both a valid time that marks when a thing is known in the real world and a system time that marks when the thing is available for discovery in MarkLogic Server.
Bi-temporal data is necessary whenever there is a requirement to maintain snapshots of a transaction across various time dimensions. For example, financial and insurance industries use bitemporal data to track changes to contracts, policies, and events in a manner that adheres to strict regulation and compliance requirements.
@grtjn points out that as of MarkLogic 9, you can also store Uni-temporal documents.
A uni-temporal collection is configured to store temporal documents that only a system time axes. You can create a temporal collection to store system axes in one of two ways:
- The system axes in metadata.
- The system axes in the document.