{"id":23589377,"url":"https://github.com/ewdlop/azurecosmosdbnoteapp","last_synced_at":"2025-11-03T21:30:34.278Z","repository":{"id":243454032,"uuid":"812082128","full_name":"ewdlop/AzureCosmosDBNoteApp","owner":"ewdlop","description":"太空漫遊; Did you kids play with the Cosmos DB RU slider, and get you charge 6 figures in what platform?","archived":false,"fork":false,"pushed_at":"2025-02-12T22:14:31.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T23:22:52.239Z","etag":null,"topics":["azure-cosmosdb","bulk-operation","no-sql"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewdlop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T23:22:39.000Z","updated_at":"2025-02-12T22:14:35.000Z","dependencies_parsed_at":"2024-12-02T22:18:53.823Z","dependency_job_id":"61bdc81d-e535-4f0b-be60-4937c3ace7e3","html_url":"https://github.com/ewdlop/AzureCosmosDBNoteApp","commit_stats":null,"previous_names":["ewdlop/azurecosmosdbnoteapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewdlop%2FAzureCosmosDBNoteApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewdlop%2FAzureCosmosDBNoteApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewdlop%2FAzureCosmosDBNoteApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewdlop%2FAzureCosmosDBNoteApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewdlop","download_url":"https://codeload.github.com/ewdlop/AzureCosmosDBNoteApp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239420057,"owners_count":19635501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-cosmosdb","bulk-operation","no-sql"],"created_at":"2024-12-27T06:13:54.195Z","updated_at":"2025-02-18T06:25:41.570Z","avatar_url":"https://github.com/ewdlop.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AzureCosmosDBNoteApp\n\n```markdown\nTo Build the sln locally, please clone the following repository to your local machine.\n\n(not submoduled)\nProject Reference: https://github.com/ewdlop/CosmosDBPartialUpdateTypeConverter\n\n#Client sideeeeeeeee\nhttps://learn.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted?tabs=dotnet\nhttps://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/always-encrypted-cryptography?view=sql-server-ver16#step-1-generating-the-initialization-vector-iv\n\nhttps://www.ezpassnj.com/en/home/index.shtml \u003c---shtml!?\nhttps://en.wikipedia.org/wiki/Server_Side_Includes\n\nhttps://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/always-encrypted-cryptography?view=sql-server-ver16#step-1-generating-the-initialization-vector-iv\n```\n\n## Performance?\n```markdown\nhttps://learn.microsoft.com/en-us/azure/cosmos-db/nosql/materialized-views?tabs=azure-portal#Previewing\n\n```\n## 08/14/2024 Upate\n```markdown\nhttps://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-migrate-from-bulk-executor-library\n```cs\nBulkOperations\u003cMyItem\u003e bulkOperations = new BulkOperations\u003cMyItem\u003e(documentsToWorkWith.Count);\nforeach (MyItem document in documentsToWorkWith)\n{\n    document.operationCounter++;\n    bulkOperations.Tasks.Add(CaptureOperationResponse(container.ReplaceItemAsync(document, document.id, new PartitionKey(document.pk)), document));\n}\n```\n```\nprivate static async Task\u003cOperationResponse\u003cT\u003e\u003e CaptureOperationResponse\u003cT\u003e(Task\u003cItemResponse\u003cT\u003e\u003e task, T item)\n{\n    try\n    {\n        ItemResponse\u003cT\u003e response = await task;\n        return new OperationResponse\u003cT\u003e()\n        {\n            Item = item,\n            IsSuccessful = true,\n            RequestUnitsConsumed = task.Result.RequestCharge\n        };\n    }\n    catch (Exception ex)\n    {\n        if (ex is CosmosException cosmosException)\n        {\n            return new OperationResponse\u003cT\u003e()\n            {\n                Item = item,\n                RequestUnitsConsumed = cosmosException.RequestCharge,\n                IsSuccessful = false,\n                CosmosException = cosmosException\n            };\n        }\n\n        return new OperationResponse\u003cT\u003e()\n        {\n            Item = item,\n            IsSuccessful = false,\n            CosmosException = ex\n        };\n    }\n}\n```\n```cs\nBulkOperations\u003cMyItem\u003e bulkOperations = new BulkOperations\u003cMyItem\u003e(documentsToWorkWith.Count);\nforeach (MyItem document in documentsToWorkWith)\n{\n    document.operationCounter++;\n    bulkOperations.Tasks.Add(CaptureOperationResponse(container.DeleteItemAsync\u003cMyItem\u003e(document.id, new PartitionKey(document.pk)), document));\n}\n```\n\n# Session-State-and-Caching-Provider\nhttps://learn.microsoft.com/en-us/azure/cosmos-db/nosql/session-state-and-caching-provider\n\n```cs\npublic class MyBusinessClass\n{\n    private readonly IDistributedCache cache;\n\n    public MyBusinessClass(IDistributedCache cache)\n    {\n        this.cache = cache;\n    }\n    \n    public async Task SomeOperationAsync()\n    {\n        string someCachedValue = await this.cache.GetStringAsync(\"someKey\");\n        /* Use the cache */\n    }\n}\n```\n\n```cs\nvoid captureDiagnostics(CosmosDiagnostics diagnostics)\n{\n    if (diagnostics.GetClientElapsedTime() \u003e SomePredefinedThresholdTime)\n    {\n        Console.WriteLine(diagnostics.ToString());\n    }\n}\n\nservices.AddCosmosCache((CosmosCacheOptions cacheOptions) =\u003e\n{\n    cacheOptions.DiagnosticsHandler = captureDiagnostics;\n    /* other options */\n});\n```\n\n## Also NOSQL \n\nhttps://www.youtube.com/watch?v=D5xU7_98jWc\n![image](https://github.com/user-attachments/assets/982d6f6e-286b-4c94-88e4-d3e71330af9e)\n\n\n## geo-redundancy\n\n\u003chttps://www.infobip.com/glossary/geo-redundancy\u003e\n\n\u003chttps://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.cosmosdb.fluent.models.location?view=azure-dotnet-legacy\u003e\n\n\u003chttps://learn.microsoft.com/en-us/java/api/com.microsoft.azure.management.cosmosdb.location?view=azure-java-legacy\u003e\n\n## pusedo-Reference\n\n\u003e microsoft docs, course lectures, books, videos, by professionals\n\n## Azure Cosmsdb Emulator is not free.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewdlop%2Fazurecosmosdbnoteapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewdlop%2Fazurecosmosdbnoteapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewdlop%2Fazurecosmosdbnoteapp/lists"}