How to partition Azure tables used for storing logs

后端 未结 4 631
日久生厌
日久生厌 2021-02-06 06:35

We have recently updated our logging to use Azure table storage, which owing to its low cost and high performance when querying by row and partition is highly suited to this pur

4条回答
  •  忘掉有多难
    2021-02-06 07:22

    There is a very general trick to avoid hot spots when writing while at the same time increasing read costs a bit.

    Define N partitions (like 10 or so). When writing a row stuff it into a random partition. Partitions can be sorted by time internally.

    When reading you need to read from all N partitions (possibly filtered and ordered by time) and merge the query results.

    This increases write scalability by a factor of N and increases query cost by the same number of round-trips and queries.

    Also, you could consider storing logs somewhere else. The very tight artificial limits on Azure products cause labor costs that you otherwise would not have.

    Choose N to be higher than needed to reach the 20,000 operations per second per account limit so that randomly occurring hotspots are unlikely. Picking N to be twice as high as minimally needed should be enough.

提交回复
热议问题