Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8866515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:48:13+00:00 2026-06-14T16:48:13+00:00

If you use schemaless database (particularly document-oriented databases like CouchDB, Couchbase, MongoDB) and want

  • 0

If you use schemaless database (particularly document-oriented databases like CouchDB, Couchbase, MongoDB) and want to change format of data representation for a particular object you may leave existing records with old format and create new records in new format. It’s declared as one of major advantages of schemaless databases (I think because you can avoid downtime). On the other hand it’s inconvenient and inefficient to deal with many formats of the same kind of data. So what are the good approaches/strategies to migrate data from one format to another in schemaless databases?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:48:14+00:00Added an answer on June 14, 2026 at 4:48 pm

    Like everything there are many different ways to handle this. In schemaless development, you generally are cognizant of the data you are storing. It’s not that the schema is missing, all data has an implicit schema, so what we are really saying is that the database is not enforcing a schema. If I have a user object with 10 instance variables that I store in json, there IS a schema there!

    Case 1: values might have different possibilities, single value, array, or a nested structure

    Case 2: value needs to be changed from one format to another, ex. from single value to array of values

    Case 3: existence or non-existence of a json key, this is pretty straightforward

    For Case 1: if you are expecting variety in a json value, the variety of a particular value will need to be written into your App Code logic, if it’s a string, do this, if it’s an array, do that.

    For Case 2: One approach can be to handle this as an “On Request” or “On Demand” so that you bake in the transformation logic into your class methods, so that data is transformed from one format to another format. This means that you transform data from one format to another when it is retrieved. You can also flag it to indicate you have transformed it. Since it’s On Demand, you could have data that isn’t “transformed” in your document store, but if it does get requested, it’ll be transformed.

    Alternative approach for Case 2: Iterate through and transform the data through worker processes. So rather than wait for it to be requested, you actually create a job to change data as you want it to be changed, baking in the transformation logic into the workers themselves (which can use the same class definitions in your App Code). In Couchbase you can create a View (Secondary Index) or use Elastic Search to iterate through documents of a particular type. If you create a workflow system, you can do a lot of this in parallel with many workers.

    >>>>
    When I do transformations I generally transform one json k/v into another json k/v in a non-destructive way so that if I have made an error in my process, I do not alter original data. I can then have a later phase to remove old json k/v “On Demand”, if I even feel that is necessary. This is a safer approach to this type of operation.

    Appended

    Case 1 & 2: Data Transformation

    Original JSON Document

    user::101        
    { 
      "uid": 1234,
      "type": user,
      "my_comment": "the quick brown fox jumped over the lazy dog"
      "version": 1.00
    }
    

    Now let’s say I want to change it in a non-destructive way, I can easily just add a new json key that has the transformed data:

    user::101        
    { 
      "uid": 1234,
      "type": user,
      "my_new_comment": ["the quick brown fox jumped over the lazy dog", "comment2"]
      "my_comment": "the quick brown fox jumped over the lazy dog",
      "version": 1.01
    
    }
    

    Notice it’s non-destructive, the old json key is still there, alternatively I can do this, save the old data as a new key, and change the expected json key to a new format (array) instead of a string:

    user::101        
    { 
      "uid": 1234,
      "type": user,
      "my_comment": ["the quick brown fox jumped over the lazy dog", "comment2"],
      "my_comment_v1.00": "the quick brown fox jumped over the lazy dog",
      "version": 1.01
    }
    

    Obviously there are quite a variety of different schemes you could use, depending on your preferences.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like an idea of document oriented databases like CouchDB. I am looking for
Use case: we have some project meta-data files which we want tracked, but are
use C#,want to upload excel file on google doc. bellow syntax use to upload
use strict; use warnings; use Data::Dumper; my %h; my $undef = undef; $h{''}='test2'; $h{$undef}
use LWP::UserAgent; use Data::Dumper; my $ua = new LWP::UserAgent; $ua->agent(AgentName/0.1 . $ua->agent); my $req
I recently played with MongoDB in Rails using Mongoid . I like the ability
Use MongoDB GridFS store images and images stored directly on disk What are the
First, I'd like to say that I really love NoSQL & MongoDB but I've
use 5.010; use strict; use warnings; use JSON::XS; use YAML::XS; my %data = ();
Use default: <input type=radio name=restype value=resdef onfocus=document.getElementById('resupload').disabled = true; document.getElementById('resadres').disabled = true; checked=checked /><br

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.