none
Gremlin graph read region

    Question

  • We are using Cosmos DB Graph and, as recommended by Microsoft, we are using Gremlin.Net NuGet.

    We have configured two locations: write - East US, read - East US, North Europe. However North Europe location is never being used. All writes and reads always go to East US even though we are located in Europe.

    How can we make it read from nearby read location instead of always accessing write location?

    • Edited by Kaba Zaoshi Friday, February 8, 2019 7:45 AM
    Friday, February 8, 2019 7:41 AM

Answers

All replies

  • Hi Kaba,

    Can you provide an excerpt from your client code with the connection details, minus the sensitive data. I am looking to see if you are passing region specific property values to indicate which regions are read/write and which are read only.

    Thanks,

    Mike

    Tuesday, February 12, 2019 12:48 AM
    Moderator
  • Hello Mike,

    I am definitely not passing any region specific values. I know I should pass it for Document DB client (or enable automatic discovery) but I have failed to find any similar information in regards to Gremlin/Graph API.

    Our client code (minus sensitive data) looks like this:

    var gremlinEndpoint = new Uri("https://cosmosdb_resource.gremlin.cosmosdb.azure.com:443/"); // url copy/pasted from Azure Portal
    var username = ...;
    var password = ...;
    var gremlinServer = new GremlinServer(gremlinEndpoint.DnsSafeHost, gremlinEndpoint.Port, true, username, password);

    Thanks,
    Kaba


    • Edited by Kaba Zaoshi Tuesday, February 12, 2019 3:05 PM
    Tuesday, February 12, 2019 3:04 PM
  • Please take a look at the following:

    How to configure multi-master in your applications in Azure Cosmos DB

    Configure clients for multi-homing

    Still looking around for other content.

    Thanks,

    Mike

    Tuesday, February 12, 2019 9:40 PM
    Moderator
  • These articles are for Document DB client. Gremlin.Net client does not have such options.

    Regards,
    Kaba

    Wednesday, February 13, 2019 3:11 PM
  • Hi Kaba,

    I realize this but in reaching out to the product group, implementation is similar but through a set of different property values: Cosmos DB Graph/Gremlin API How To: Configuring preferred read/write regions with Gremlin clients

    This should address your request.

    Thanks,

    Mike

    Thursday, February 14, 2019 10:28 PM
    Moderator
  • Hi Mike,

    This is working. Thanks!

    However I have some questions regarding that. Cosmos DB allows me to write into read-only region and it seems to redirect writes to write region. What is the recommended approach in this case? Should I write directly to write region? Is there any penalty or benefit when writing to read-only / write-only region?

    Thanks,
    Kaba

    Monday, February 18, 2019 2:52 PM