Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InsertStream/UpsertStream #121

Open
morikat1509 opened this issue Mar 29, 2024 · 1 comment
Open

InsertStream/UpsertStream #121

morikat1509 opened this issue Mar 29, 2024 · 1 comment

Comments

@morikat1509
Copy link

morikat1509 commented Mar 29, 2024

Hi, I upgraded the old tool to the new repo with release2.1.4. When trying to run the tool to import records from json to comsos db insert/upsert is working while insert stream and upsert stream are not doing any import(the records count still the same). I am using the CLI command and not the settings file.

Here is the command args for the tool:

string source = "json";
string sink = "cosmos-nosql";

string sourceSettingJson = "https://raw.githubusercontent.com/azure-samples/cosmos-db-migration-sample-data/main/nosql-data.json";

string targetDbConnnectionString = "AccountEndpoint=https://localhost:8081/;blabla";
string targetDatabaseName = "Database";
string targetCollectionName = "Prod8";

int retry = 2;
int batchSize = 100;

string cmdArgs = 
             $"--source {source} --sink {sink} " +
             $"--SourceSettings:FilePath={sourceSettingJson} " +
             $"--SinkSettings:ConnectionString=\"{targetDbConnnectionString}\" "+
             $"--SinkSettings:Database={targetDatabaseName} " +
             $"--SinkSettings:Container={targetCollectionName} " +
             $"--SinkSettings:PartitionKeyPath=\"/partitionKey\" " +
             $"--SinkSettings:MaxRetryCount= {retry}" +
             $"--SinkSettings:BatchSize={batchSize} " +
             $"--SinkSettings:WriteMode=InsertStream";

The tool is not failing but no documents are imported when using streams, what could be wrong with this setup if the insert and upsert are working? Are the streams logic ready to use?

@bowencode
Copy link
Collaborator

The -Stream modes can be slightly more performant but also less compatible. Depending on network specifics, ConnectionMode=Direct and WriteMode=InsertStream should be the fastest, but may also fail to transmit data. At the opposite end, ConnectionMode=Gateway and WriteMode=Upsert should be the most compatible set of options but also the least performant.

Outside of actual transfer performance, Stream modes also require different JSON serialization during transfer so there may be an issue specific to your data that is only causing problems with that serialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants