4 ms·
The absolute worst bug I have ever had to debug was using CosmosDB as table storage. Everything worked fine up until we hit about 1700 records in table storage.
by lkschubert8 8y ago
The absolute worst bug I have ever had to debug was using CosmosDB as table storage. Everything worked fine up until we hit about 1700 records in table storage. Once we hit that point it just stopped returning any records. We eventually find out that if you query using a field that isn't indexed instead of throwing an error or something sane like that it acts like everything is fine and returns an empty set of records.
- skrebbel 8y agoWoa, wtf. Is that indicative of the general quality level of cosmos?
- zzbzq 8y agoSort of. It doesn't really sanity-check anything, ever. It's more of a blank slate and you have to build whatever rules you want into your software layer. The default mode is to index every field, so you can't get into the OP's situation until you start trying to fine-tune it. He basically turned off the index and then tried to search by it. This is not expected for people who just bring their RDBMS assumptions in and try to wing it without reading any documentation whatsoever.
- lkschubert8 8y agoI dont know if something changed, but there were no default indexes back when this happened (a year and a half ago). I had done no performance tuning, just created the document collections and added items to them.
- AaronFriel 8y agoIt sounds like you inadvertently changed the index structure or deleted it. There have always been default indexes, and Microsoft's tuning advice is always to add special case indexes to the wildcard index they provision. If you know your data model well and want to improve write performance (RUs), you can delete the wildcard index. That's how the indexing policy has worked since the product launched. https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-indexing-policy https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-mana...
- manigandham 8y agoEverything is indexed by default, this has always been the case.
- dagss 8y agoWhat documentation though? Cosmos' documentation is appalling... it is not like you can learn these things from it. With Cosmos you are always on your own, trial and error, to figure out how it behaves
- manigandham 8y agoThis documentation: https://docs.microsoft.com/en-us/azure/cosmos-db/index-overview https://docs.microsoft.com/en-us/azure/cosmos-db/index-overv... There are dozens of pages there. It may not be perfectly organized but saying you can't learn anything from it is silly. And regarding indexing, the 2nd sentence on the page says this: "By default, Azure Cosmos DB automatically indexes all items in your container without requiring schema or secondary indexes from developers."
- eternalban 8y agoThat must be the famous Mognodb compatibility layer kicking in. ~/s
- Strom 8y agoGoogle Datastore [1] works the same way. I imagine it's because indexes can be configured per row. So for example if you have a boolean value and only ever query for it to be true then you might set the index on only if it's true. The reason you might want to use indexes scarcely is because they cost money. For Google Datastore they used to cost extra write operations and storage. Now they just cost storage. -- [1] https://cloud.google.com/datastore/ https://cloud.google.com/datastore/