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

No content on Response: Add the ability to have operation return no content from Cosmos DB #1439

Merged
merged 16 commits into from
May 8, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Apr 27, 2020

Pull Request Template

Description

This adds a flag to get a no content response from Cosmos DB service. This means that create, replace, and upsert operations will have a null response content. This can be lead to a huge improvement in performance by reducing networking traffic and overhead of serializing an object that will never be used.

This is only being exposed on item operations. Two flags are added to make it clear to users that Read can also return with no content. This is great to check if a document exists or not. This also makes it easier in the future to make no content on writes as a default while leaving reads on by default.

public class ItemRequestOptions
{
public virtual bool? NoContentResponseOnWrite {get; set;}
....
}

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Closing issues

closes #1203

@j82w j82w added the feature-request New feature or request label Apr 27, 2020
@j82w j82w self-assigned this Apr 27, 2020
abhijitpai
abhijitpai previously approved these changes Apr 28, 2020
ealsur
ealsur previously approved these changes Apr 28, 2020
Copy link
Member

@ealsur ealsur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool feature, hoping to see some perf results for Bulk with this on/off

@pentp
Copy link
Contributor

pentp commented Apr 28, 2020

This looks great.
Updated ItemResponse.ETag values are still available as they are part of response headers, right?

Copy link
Member

@kirankumarkolli kirankumarkolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it even makes sense for Feed/Query/Sproc?
If not can it be rooted to ItemReqeustOptions instead?

@j82w j82w changed the title Minimal Response: Add the ability to have operation return no content from Cosmos DB No body on Response: Add the ability to have operation return no content from Cosmos DB Apr 29, 2020
@j82w j82w dismissed stale reviews from ealsur and abhijitpai via ebab57e May 4, 2020 19:14
@j82w
Copy link
Contributor Author

j82w commented May 5, 2020

This looks great.
Updated ItemResponse.ETag values are still available as they are part of response headers, right?

@pentp Yes, etags are still available. I added tests for it.

ealsur
ealsur previously approved these changes May 5, 2020
kirankumarkolli
kirankumarkolli previously approved these changes May 6, 2020
@j82w j82w changed the title No body on Response: Add the ability to have operation return no content from Cosmos DB No content on Response: Add the ability to have operation return no content from Cosmos DB May 7, 2020
@j82w j82w merged commit a0f8ecc into master May 8, 2020
@j82w j82w deleted the users/jawilley/feature/minimalResponse branch May 8, 2020 12:06
@jbt00000
Copy link

Eureka! It works. Just set the flag and am using it. This is a HUGE perf win. Next up, data compression!?!??!

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

Successfully merging this pull request may close these issues.

Fire and forget
8 participants