DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

RavenDB 4.0 Features: Document Versioning

RavenDB has overhauled its document versioning strategy, trading off a bit of functionality for drastic improvements in ease of use.

Oren Eini user avatar by
Oren Eini
·
Apr. 12, 17 · News
Like (0)
Save
Tweet
Share
3.01K Views

Join the DZone community and get the full member experience.

Join For Free

After focusing for so long on the low level and performance of RavenDB 4.0, you might be forgiven for thinking that we were neglecting real, meaningful features in 4.0. That couldn’t be further from the truth. The problem is that this it is actually quite hard to talk about some features meaningfully before they have been through a complete round of implementing, testing, and wiring for UI and UX, and then beating them with a stick to see what falls apart.

Document versioning in RavenDB isn’t new. It has been a feature for several releases now. In RavenDB 4.0, we have decided to reimagine it completely. One of the strong points of RavenDB's design from the get-go was that triggers allowed you to build new features into the product without making core changes. That allowed users to quickly add new features, but it could cause issues with feature intersections.

With RavenDB 4.0, versions are now part of the core code. That means that they get special treatment. Here is how it looks like in the UI:

image

You can switch between versions of the document and see them as they were at various points in time.

Externally, this is pretty much all there is to it. Here is what it will look when you are looking at a revision.

image

In terms of the client API, there is little in the way of change: 

List<Product> revisions = session.Advanced.GetRevisionsFor<Product>("products/77");


So what did change?

Revisions are now stored separately from documents. Previously, we stored them as special documents, which led to some problems (indexes had to read to see that they weren’t interested in them, for example), and we had to special case a lot of stuff that was supposed to work on documents in order to not apply them to attachments. Making them their own unique thing simplifies everything significantly. We have also made sure that revisions can properly flow with replication and prevent the potential for versioning conflicts, which were tricky to solve. The downside of this is that desirable operations on revisions (load a revision with include, for example), will no longer work.

The whole thing is also significantly faster and cheaper to work with.  A major change we also made was to ensure that versioning is always on, so you don’t have to specify it at DB creation time. Instead, you can configure it whenever you want, without having to add a bundle at runtime and risk unsupported operations.

That means that if at some point you want to start versioning your documents, you can just flip a switch, and it will immediately start versioning all changes for you.

Document

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • mTLS Everywere
  • Apache Kafka Is NOT Real Real-Time Data Streaming!
  • Public Key and Private Key Pairs: Know the Technical Difference
  • OpenVPN With Radius and Multi-Factor Authentication

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: