question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FeedRange - Scaling out support

See original GitHub issue

With the new Change Feed pull model approaching and the use of FeedRange, one pending item is support for scaling out running iterators.

Currently, the flow is:

  1. User gets FeedRanges
  2. User starts 1 iterator per FeedRange on each machine/instance
  3. Some time later, some of the machines are running hot on CPU because possibly the ranges they are handling are hotter than the other machines (or those ranges had splits)

How do we allow users to scale out if they want to?

Open to discussion

One idea would be to have a method on the FeedRange itself, possibly List<FeedRange> FeedRange.Scale(int? ranges) that will attempt to split the range into the required # of ranges. If the parameter is not passed, we can either split using physical partition affinity or other limits.

Another idea would be to use it on the Continuation tokens. Since this is an scenario for when an iterator has been already running, we have a Continuation token. We could then take them as input and return new continuations after the split: List<string> FeedRange.Scale(string currentContinuationToken, int? expectedRanges).

Limits

Scale out operations can always face a limit. When EPK filtering is in place in the backend, a FeedRange cannot be split further than a single Partition Key value. Without EPK filtering in place, the limit is on the physical partition.

In any case, the API can always return a negative or “cannot scale out further” semantics.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
zbynek001commented, Sep 29, 2021

@ealsur @j82w Here is the new ticket: #2759

1reaction
bchong95commented, Jul 7, 2020

I believe we talked about this and voted to not go for a Scale method.

Instead you can have:

bool FeedRangeFactory.TrySplit(FeedRange source, out (FeedRange target1 FeedRange target2))
bool FeedRangeFactory.TryMerge((FeedRange source1, FeedRange source2), out FeedRange target)

The Try Pattern will naturally imply to the user that the operation may fail. You can add monadic overloads to return a reason for the failure:

TryCatch<(FeedRange, FeedRange)> FeedRangeFactory.Monadic.Split(FeedRange source)
TryCatch<FeedRange> FeedRangeFactory.Monadic.Merge((FeedRange source1, FeedRange source2))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reading Azure Cosmos DB change feed
This article describes different options available to read and access change feed in Azure Cosmos DB.
Read more >
Azure Cosmos DB Scale-Out Storage and Throughput
Scaling out storage in Cosmos DB is done by increasing the provisioned storage capacity of a container. This can be done by manually...
Read more >
Cosmos db is null. There are several things wrong with the a
A FeedRange represents a range of partition key values. Azure Cosmos DB uses partitioning to scale individual containers in a database to meet...
Read more >
Exam AZ-204 topic 4 question 33 discussion
Scale the API by using multiple Azure App Service instances. ... Use a FeedRange object to parallelize the processing of the change feed ......
Read more >
Poor performance on Azure web apps when scaling out
I'm experiencing poor on Azure web apps when scaling out. Azure automatically picks up an issue from a set of rules I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found