Home
%3CLINGO-SUB%20id%3D%22lingo-sub-970436%22%20slang%3D%22en-US%22%3ERe%3A%20Architecting%20petabyte-scale%20analytics%20by%20scaling%20out%20Postgres%20on%20Azure%20with%20the%20Citus%20extension%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-970436%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20Sharing%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-969685%22%20slang%3D%22en-US%22%3EArchitecting%20petabyte-scale%20analytics%20by%20scaling%20out%20Postgres%20on%20Azure%20with%20the%20Citus%20extension%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-969685%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20you%20know%20if%20the%20next%20update%20to%20your%20software%20is%20ready%20for%20hundreds%20of%20millions%20of%20customers%3F%20It%20starts%20with%20data.%20And%20when%20it%20comes%20to%20Windows%2C%20we%E2%80%99re%20talking%20lots%20of%20data.%20The%20%3CA%20href%3D%22https%3A%2F%2Fblogs.windows.com%2Fwindowsexperience%2F2019%2F03%2F06%2Fdata-insights-and-listening-to-improve-the-customer-experience%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20team%20measures%20the%20quality%3C%2FA%3E%20of%20new%20software%20builds%20by%20scrutinizing%2020%2C000%20diagnostic%20metrics%20based%20on%20data%20flowing%20in%20from%20800%20million%20Windows%20devices.%20At%20the%20same%20time%2C%20the%20team%20evaluates%20feedback%20from%20Microsoft%20engineers%20who%20are%20using%20pre-release%20versions%20of%20Windows%20updates.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20Microsoft%2C%20the%20Windows%20diagnostic%20metrics%20are%20displayed%20on%20a%20real-time%20analytics%20dashboard%20called%20%E2%80%9CRelease%20Quality%20View%E2%80%9D%20(RQV)%2C%20which%20helps%20the%20internal%20%E2%80%9Cship-room%E2%80%9D%20team%20assess%20the%20quality%20of%20the%20customer%20experience%20before%20each%20new%20Windows%20update%20is%20released.%20Given%20the%20importance%20of%20Windows%20for%20Microsoft%E2%80%99s%20customers%2C%20the%20RQV%20analytics%20dashboard%20is%20a%20critical%20tool%20for%20Windows%20engineers%2C%20program%20managers%2C%20and%20execs.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENot%20surprisingly%2C%20the%20real-time%20analytics%20dashboard%20is%20heavily%20used.%20%E2%80%9CWe%20have%20hundreds%20of%20active%20users%20every%20day%2C%20and%20thousands%20every%20month%2C%E2%80%9D%20says%20Min%20Wei%2C%20principal%20engineer%20at%20Microsoft.%20%E2%80%9CDelivering%20a%20new%20operating%20system%20update%20is%20like%20producing%20a%20Broadway%20show%E2%80%94there%20are%20so%20many%20people%20working%20behind%20the%20scenes%20to%20prepare.%20The%20RQV%20analytics%20dashboard%20helps%20ensure%20the%20curtain%20goes%20up%20on%20time%E2%80%94and%20that%20we%20deliver%20what%20the%20audience%20wants.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F152547i0EC103FF6F361EB4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Screenshot-RQV-Analytics-Dashboard-Windows.jpg%22%20title%3D%22Screenshot-RQV-Analytics-Dashboard-Windows.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2010px%3B%22%3E%3CEM%3E%3CFONT%20size%3D%222%22%3E%3CSTRONG%3EFigure%201%3C%2FSTRONG%3E%3A%20The%20internal%20RQV%20analytics%20dashboard%20at%20Microsoft%20helps%20the%20Windows%20team%20to%20assess%20the%20quality%20of%20upcoming%20Windows%20releases.%20The%20RQV%20dashboard%20tracks%2020%2C000%20diagnostic%20and%20quality%20metrics%2C%20and%20currently%20supports%20over%206%20million%20queries%20per%20day%2C%20with%20hundreds%20of%20concurrent%20users.%20The%20RQV%20analytics%20dashboard%20relies%20on%20Postgres%E2%80%94along%20with%20the%20Citus%20extension%20to%20Postgres%20to%20scale%20out%20horizontally%E2%80%94and%20is%20deployed%20on%20Microsoft%20Azure%3C%2FFONT%3E.%3C%2FEM%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1850801210%22%20id%3D%22toc-hId-1850801210%22%3ETwo%20days%20to%20%E2%80%9Ccook%E2%80%9D%20the%20data%20was%20unacceptable%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Windows%20Data%20and%20Intelligence%20team%20had%20been%20using%20a%20Lambda%20architecture%20for%20the%20Online%20Analytical%20Processing%20(OLAP)%20cubing%20workloads%20that%20powered%20the%20RQV%20analytics%20dashboard.%20%E2%80%9COLAP%20cubing%E2%80%9D%20is%20the%20term%20for%20the%20multi-dimensional%20analysis%20that%20data%20scientists%20and%20engineers%20often%20use%20to%20derive%20insights%20from%20large%20swaths%20of%20data.%20(In%20the%20context%20of%20analytics%20with%20a%20database%20like%20Postgres%2C%20some%20developers%20refer%20to%20%E2%80%9Ccubing%E2%80%9D%20as%20%E2%80%9Crollups%E2%80%9D%20or%20%E2%80%9Cpre-aggregations%E2%80%9D%20or%20%E2%80%9Caggregate%20tables.%E2%80%9D%20There%20are%20several%20different%20names%20but%20the%20idea%20is%20the%20same%3A%20if%20you%20know%20that%20your%20user%20will%20query%20the%20data%20in%20a%20certain%20way%2C%20it%20makes%20sense%20to%20do%20the%20calculations%20in%20advance.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnfortunately%2C%20the%20architecture%20they%20were%20using%20for%20OLAP%20cubing%20workloads%20had%20encountered%20a%20significant%20obstacle.%20%E2%80%9COur%20OLAP%20cubing%20was%20running%20out%20of%20steam%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CWe%20were%20generating%20hundreds%20of%20millions%20of%20cubes%20every%20day%20through%20a%20MapReduce%20job.%20But%20as%20we%20added%20dimensions%2C%20we%20encountered%20the%20%E2%80%98curse%20of%20dimensionality%E2%80%99.%20We%20ran%20out%20of%20memory%20on%20some%20of%20the%20nodes%2C%20and%20the%20cubing%20jobs%20took%20longer%20and%20longer%20to%20finish.%E2%80%9D%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECubing%20delays%20(delays%20creating%20the%20rollups%20and%20report%20tables)%20meant%20that%20the%20Windows%20team%20wasn%E2%80%99t%20able%20to%20get%20the%20insights%20they%20needed%20when%20they%20needed%20them.%20%E2%80%9CIt%20was%20taking%2024%20to%2048%20hours%20to%20%E2%80%98cook%E2%80%99%E2%80%94or%20prepare%E2%80%94the%20data%2C%20which%20could%20leave%20the%20analytics%20reporting%20two%20to%20three%20days%20behind%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CThose%20kinds%20of%20delays%20made%20it%20difficult%20to%20meet%20tight%20Windows%20release%20deadlines.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--701355751%22%20id%3D%22toc-hId--701355751%22%3ENeeded%3A%20a%20way%20to%20analyze%20data%20in%20dynamic%20response%20to%20users%20needs%E2%80%94what%20is%20called%20%E2%80%9Cdynamic%20OLAP%20cubing%E2%80%9D%26nbsp%3B%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20diagnostic%20metrics%20growing%20at%20an%20exponential%20rate%2C%20Wei%20realized%20he%20couldn%E2%80%99t%20simply%20deploy%20more%20servers%20and%20more%20hardware%20to%20solve%20the%20cubing%20problem.%20The%20growth%20of%20the%20Windows%20user%20base%20and%20all%20the%20metrics%20being%20generated%20would%20quickly%20outpace%20the%20resources%20of%20any%20new%20servers%20that%20he%20provisioned.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInstead%20of%20adding%20more%20servers%2C%20Wei%20decided%20to%20investigate%20dynamic%20cubing.%20%E2%80%9CWe%20were%20creating%20hundreds%20of%20millions%20of%20OLAP%20cubes%2C%20but%20often%20users%20only%20need%20a%20small%20subset%20of%20the%20OLAP%20cubes%20for%20the%20dashboard%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CI%20saw%20an%20opportunity%20to%20address%20the%20performance%20issue%20by%20dynamically%20generating%20only%20the%20cubes%20people%20need%2C%20as%20they%20need%20them.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20realized%20he%20would%20need%20a%20new%20type%20of%20database%20to%20deliver%20the%20scale%20and%20performance%20required%20by%20dynamic%20OLAP%20cubing.%20And%20Wei%20realized%20that%20this%20new%20database%20should%20also%20help%20increase%20data%20durability.%20%E2%80%9CIn%20two%20years%2C%20people%20should%20be%20able%20to%20look%20at%20the%20data%20model%20and%20understand%20it%2C%E2%80%9D%20says%20Wei.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1041454584%22%20id%3D%22toc-hId-1041454584%22%3EFinding%20a%20database%20for%20an%20analytics%20dashboard%20that%20could%20address%20the%20%E2%80%98curse%20of%20dimensionality%E2%80%99%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20began%20to%20assess%20different%20databases%2C%20including%20open%20source%20databases%20such%20as%20Apache%20Pinot%2C%20Apache%20Kylin%2C%20and%20Apache%20Druid.%20But%20these%20databases%20had%20limited%20SQL%20support%20and%20could%20not%20support%20extensible%20data%20types.%20Nor%20could%20they%20support%20the%20concurrent%20query%20performance%20needed%20to%20drive%20the%20large-scale%20RQV%20analytics%20dashboard.%20And%20they%20didn%E2%80%99t%20permit%20updates%20to%20fix%20incorrect%20data.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20recognized%20that%20a%20relational%20database%20management%20system%20(RDBMS)%20could%20overcome%20the%20drawbacks%20of%20several%20of%20these%20databases.%20Most%20importantly%2C%20an%20RDBMS%20could%20deliver%20the%20performance%20needed%20for%20dynamic%20cubing%20while%20also%20meeting%20his%20data%20durability%20requirements.%20%E2%80%9CI%20became%20determined%20to%20build%20or%20buy%20an%20RDBMS%2C%E2%80%9D%20says%20Wei.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20Wei%20began%20to%20search%20for%20the%20right%20RDBMS%2C%20he%20realized%20that%20a%20horizontal%2C%20distributed%20relational%20database%20made%20the%20most%20sense.%20%E2%80%9CWe%E2%80%99re%20not%20going%20to%20see%20individual%20servers%20with%2010%20TB%20of%20memory%20any%20time%20soon%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CA%20distributed%20memory%20architecture%20will%20be%20the%20best%20choice%20for%20at%20least%20the%20next%20decade.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20also%20wanted%20an%20RDBMS%20to%20do%20OLAP%20cubing%20in%20a%20way%20that%20would%20help%20compress%20fast-growing%20data%20volumes%20through%20rollup-style%20aggregation%20of%20data.%20%E2%80%9CWindows%20diagnostics%20generate%20tens%20of%20billions%20of%20rows%20of%20data%20every%20day.%20With%20an%20append-only%20data%20store%2C%20you%20are%20accumulating%20all%20of%20those%20rows%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CI%20wanted%20to%20use%20rollups%2C%20to%20implement%20a%20sort%20of%20%E2%80%98semantic%20compression%E2%80%99%20that%20could%20reduce%20the%20amount%20of%20data%20in%20the%20database.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20also%20required%20indexing%20and%20transactional%20%E2%80%9Cupsert%E2%80%9D%20(insert%20and%20update)%20capabilities.%20In%20addition%2C%20he%20wanted%20support%20for%20extensible%20data%20types%2C%20including%20JSON%2C%20key-value%20types%2C%20%26nbsp%3BHyperLogLog%20(HLL)%2C%20and%20t-digest.%20Wei%20considered%20building%20a%20brand%20new%20distributed%20database%2C%20but%20he%20realized%20that%20implementing%20it%20would%20be%20a%20long-term%20project.%20%E2%80%9CI%20would%20need%20to%20build%20a%20database%20engine%20on%20top%E2%80%94and%20for%20one%20person%20with%20a%20deadline%20of%20one%20year%2C%20that%20approach%20wasn%E2%80%99t%20feasible%2C%E2%80%9D%20says%20Wei.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CFONT%20size%3D%225%22%20color%3D%22%23000000%22%3E%3CEM%3E%E2%80%9CDistributed%20PostgreSQL%20is%20a%20game%20changer.%E2%80%9D%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CFONT%20size%3D%223%22%3E%E2%80%94%3CSTRONG%3EMin%20Wei%3C%2FSTRONG%3E%2C%20Principal%20Engineer%20at%20Microsoft%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1510702377%22%20id%3D%22toc-hId--1510702377%22%3EWei%20discovered%20the%20open%20source%20Citus%20extension%20to%20Postgres%20by%20listening%20to%20a%20recorded%20conference%20talk%20on%20his%20drive%20home%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20Wei%E2%80%99s%20search%20for%20the%20right%20database%20continued%2C%20he%20discovered%20an%20open%20source%20extension%20to%20Postgres%20(called%20Citus)%20while%20listening%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxJghcPs0ibQ%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Evideo%20on%20scaling%20out%20PostgreSQL%3C%2FA%3E.%20Principal%20Engineer%20Marco%20Slot%20from%20Citus%20Data%20had%20given%20the%20presentation%20at%20the%20dotScale%202017%20conference%20in%20Paris.%20%E2%80%9CI%20learned%20that%20Citus%20was%20a%20distributed%20SQL%20platform%20that%20could%20meet%20my%20requirements%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CI%20realized%20I%20really%20needed%20to%20check%20out%20Citus.%E2%80%9D%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20began%20building%20a%20prototype%20to%20validate%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fcitusdata%2Fcitus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECitus%20extension%20to%20Postgres%3C%2FA%3E.%20%E2%80%9CI%20was%20learning%20%3CA%20href%3D%22https%3A%2F%2Fwww.postgresql.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPostgres%3C%2FA%3E%20as%20I%20built%20the%20prototype.%20At%20that%20point%2C%20I%20had%20little%20operational%20experience%20with%20Postgres%2C%20and%20there%20was%20no%20one%20to%20ask.%20I%20was%20playing%20with%20hundreds%20of%20different%20parameters%20and%20doing%20AB%20testing%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CAnd%20as%20I%20explored%20Citus%20support%20for%20partitioning%2C%20index-only%20scans%2C%20and%20partial%20covering%20index%2C%20I%20saw%20that%20I%20could%20solve%20several%20problems%20using%20Citus.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20fact%20that%20Postgres%20and%20the%20Citus%20extension%20are%20open%20source%20was%20important.%20%E2%80%9CIn%20our%20Data%20and%20Intelligence%20team%2C%20data%20is%20the%20most%20important%20asset%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CAnd%20with%20a%20popular%20database%20platform%20like%20Postgres%20and%20Citus%2C%20I%20could%20trust%20that%20the%20code%20would%20outlive%20the%20professional%20lives%20of%20the%20current%20developers.%20This%20gave%20me%20confidence%20that%20the%20architecture%20would%20survive%20the%20test%20of%20time.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EImpressed%20with%20the%20early%20results%2C%20he%20transitioned%20the%20project%20from%20a%20proof%20of%20concept%20into%20an%20official%20project.%20%E2%80%9CI%20started%20talking%20to%20the%20Microsoft%20Azure%20teams%2C%20and%20I%20told%20them%20that%20we%20needed%20a%20distributed%20RDBMS%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CA%20few%20months%20later%2C%20I%20was%20happy%20to%20learn%20that%20%3CA%20href%3D%22https%3A%2F%2Fwww.citusdata.com%2Fblog%2F2019%2F01%2F24%2Fmicrosoft-acquires-citus-data%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20had%20acquired%20Citus%20Data%3C%2FA%3E.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F152550i7F9872986CF83E22%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Diagram-of-VeniceDB-architecture-using-Postgres-and-Citus.png%22%20title%3D%22Diagram-of-VeniceDB-architecture-using-Postgres-and-Citus.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CFONT%20size%3D%222%22%3E%3CSTRONG%3EFigure%202%3A%3C%2FSTRONG%3E%20The%20Windows%20team%E2%80%99s%20ship-room%20decisions%20employ%20an%20architecture%20that%20relies%20on%20the%20open%20source%20Postgres%20database%2C%20and%20uses%20Citus%20to%20scale%20out%20Postgres%20horizontally.%20The%20%E2%80%9CVeniceDB%E2%80%9D%20(code%20name)%20system%20captures%20over%2020K%20types%20of%20metrics%20from%20over%20800M%20devices%3B%201.5%20PB%20(petabytes)%20of%20Azure%20blob%20storage%20for%20the%20raw%20Windows%20event%20data%20and%20staging%20queue%3B%20and%20the%20Citus%20database%20clusters%20include%2044%20nodes%20with%20a%20total%20of%202%2C816%20cores%2C%2018.7%20TB%20of%20memory%2C%20and%201.5%20PB%20(yes%2C%20petabytes)%20of%20SSD%20storage.%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-232107958%22%20id%3D%22toc-hId-232107958%22%3EBuilding%20a%20Citus%20database%20cluster%20on%20Microsoft%20Azure%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20chose%20Postgres%20for%20his%20new%20database%E2%80%94and%20is%20using%20Citus%20to%20scale%20out%20Postgres%20horizontally%20on%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Azure%3C%2FA%3E%2C%20leveraging%20Ubuntu%2FLinux%20VMs.%20(The%20code%20name%20for%20Wei%E2%80%99s%20system%20is%20%E2%80%9CVeniceDB.%E2%80%9D)%20The%20VeniceDB%20system%20contains%202%20Citus%20database%20clusters%20that%20both%20serve%20the%20RQV%20Analytics%20Dashboard%20and%20associated%20APIs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEach%20Citus%20cluster%20currently%20includes%2022%20nodes%20(total%20of%2044%20nodes)%2C%20and%20together%20the%20clusters%20have%20a%20total%20of%202%2C816%20cores%20and%2018.7%20TB%20of%20memory.%20Wei%20uses%201.5%20PB%20(yes%2C%20petabytes)%20of%20Azure%20Premium%20SSD%20Managed%20Disks%20for%20the%20database.%20And%20Wei%20uses%20another%201.5%20PB%20of%20Azure%20blob%20storage%20for%20the%20staging%20queue%20and%20raw%20Windows%20event%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20say%20%E2%80%9Ccurrently%E2%80%9D%20because%20Wei%20expects%20to%20upgrade%20the%20Citus%20database%20clusters%20to%20add%20more%20nodes%20and%20more%20resources%20later%20this%20year.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20and%20his%20team%20began%20using%20Postgres%20and%20Citus%20in%20production%20and%20on%20Azure%20before%20Citus%20was%20integrated%20as%20a%20built-in%20feature%20in%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fservices%2Fpostgresql%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Database%20for%20PostgreSQL%3C%2FA%3E.%20As%20a%20result%2C%20Wei%20and%20his%20team%20had%20to%20manage%20the%20Postgres%20database%20and%20the%20Citus%20extension%20by%20themselves%2C%20from%20the%20very%20beginning.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20the%20good%20news%20is%20that%20today%2C%20if%20you%E2%80%99re%20a%20new%20user%20considering%20which%20cloud%20database%20to%20use%20for%20Postgres%2C%20Microsoft%20offers%20a%20fully-managed%20database%20as%20a%20service%20for%20Postgres.%20And%20Azure%20Database%20for%20PostgreSQL%20now%20includes%20Citus%20as%20a%20built-in%20deployment%20option%2C%20called%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fpostgresql%2Fquickstart-create-hyperscale-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHyperscale%20(Citus)%3C%2FA%3E.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20addition%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.citusdata.com%2Fproduct%2Fcommunity%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECitus%20open%20source%3C%2FA%3E%20extension%20to%20Postgres%2C%20Wei%20also%20uses%20several%20other%20Postgres%20extensions.%20For%20example%2C%20he%20uses%20%E2%80%98%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fcitusdata%2Fpostgresql-topn%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epostgresql-topn%3C%2FA%3E%E2%80%99%20to%20calculate%20top%20occurring%20items%20in%20the%20data%3B%20%E2%80%98pg_cron%E2%80%99%20to%20schedule%20database%20tasks%3B%20%E2%80%98intarray%E2%80%99%20for%20manipulating%20null-free%20integer%20arrays%3B%20and%20%E2%80%98%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fcitusdata%2Fpostgresql-hll%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epostgresql-hll%3C%2FA%3E%E2%80%99%2C%20which%20offers%20HyperLogLog%20data%20structures%20as%20a%20native%20data%20type.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20Wei%E2%80%99s%20team%20has%20upgraded%20Postgres%20fairly%20often%2C%20too.%20The%20%E2%80%9CVeniceDB%E2%80%9D%20system%20launched%20using%20Postgres%2010%3B%20today%20the%20production%20Citus%20database%20clusters%20are%20running%20Postgres%2011.5%3B%20and%20Wei%20has%20begun%20testing%20with%20%3CA%20href%3D%22https%3A%2F%2Fwww.postgresql.org%2Fabout%2Fnews%2F1976%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPostgres%2012%3C%2FA%3E%20and%20Citus%209.x.%20Says%20Wei%2C%20%E2%80%9CI%20can%20see%20and%20feel%20the%20Postgres%20and%20Citus%20improvements%20over%20the%20past%20two%20years.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CFONT%20size%3D%225%22%3E%3CEM%3E%E2%80%9CWe%20can%20support%20hundreds%20of%20concurrent%20users%20and%20more%20than%206%20million%20queries%20every%20day%E2%80%A6.With%20Citus%2C%20response%20times%20for%2075%20percent%20of%20queries%20are%20200%20milliseconds%20or%20less.%E2%80%9D%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CFONT%20size%3D%223%22%3E%E2%80%94%3CSTRONG%3EMin%20Wei%3C%2FSTRONG%3E%2C%20Principal%20Engineer%20at%20Microsoft%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1974918293%22%20id%3D%22toc-hId-1974918293%22%3EPowering%20more%20than%206M%20queries%2Fday%20on%20the%20analytics%20dashboard%E2%80%94with%20ultra-low%20latency%20response%20times%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20using%20the%20Citus%20extension%20to%20Postgres%20to%20scale%20out%20Postgres%2C%20Wei%E2%80%99s%20team%20now%20has%20the%20I%2FO%20performance%20they%20need%20to%20ingest%20the%20large%20data%20sets%20generated%20by%20Windows%20diagnostic%20tests%20and%20user%20feedback.%20%E2%80%9CMy%20RQV%20analytics%20use%20case%20is%20very%20write-intensive%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CWe%20ingest%208%20to%2010%20TB%20of%20data%20into%20our%20Postgres%20database%20every%20day%2C%20and%20because%20of%20regulatory%20requirements%2C%20we%20delete%20about%20an%20equal%20amount%20each%20day.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20system%20is%20also%20very%20read-intensive.%20While%20other%20databases%20might%20hold%205%20TB%20of%20%E2%80%9Cdead%E2%80%9D%20data%20that%20is%20rarely%20read%2C%20Wei%E2%80%99s%20users%20query%20up%20to%20200%20TB%20of%20diagnostic%20data%20continuously%2C%20as%20they%20consume%20the%20data%20on%20the%20RQV%20analytics%20dashboard.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CWe%20can%20support%20hundreds%20of%20concurrent%20users%20and%20more%20than%206%20million%20queries%20every%20day%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CDashboards%20might%20refresh%20every%2020%20to%2025%20minutes.%20As%20a%20result%2C%20the%20database%20must%20read%20between%20150%20and%20200%20TB%20of%20data%E2%80%94hundreds%20of%20times%2C%20daily.%20With%20Citus%2C%20response%20times%20for%2075%20percent%20of%20queries%20are%20less%20than%20200%20milliseconds.%20For%20some%20types%20of%20queries%2C%20the%20P75%20response%20times%20are%20less%20than%2090%20milliseconds.%20And%20response%20times%20for%2095%25%20of%20queries%20are%20less%20than%201%20second%20on%20one%20Citus%20cluster%3B%20and%20less%20than%203%20seconds%20on%20the%20other%20Citus%20cluster.%E2%80%9D%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--577238668%22%20id%3D%22toc-hId--577238668%22%3EScaling%20out%20Postgres%20on%20Azure%20with%20the%20Citus%20extension%E2%80%94to%20power%20dynamic%20OLAP%20cubing%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20using%20Citus%20to%20scale%20out%20Postgres%20across%20multiple%20nodes%2C%20Wei%E2%80%99s%20team%20is%20able%20to%20harness%20more%20memory%20and%20compute%2C%20as%20well%20as%20to%20benefit%20from%20the%20massive%20parallelism%20that%20Citus%20provides.%20The%20result%3A%20Wei%20now%20has%20the%20performance%20and%20response%20times%20required%20to%20do%20the%20dynamic%20cubing%20and%20create%20the%20rollups.%20Oh%2C%20and%20with%20Citus%2C%20Wei%E2%80%99s%20team%20also%20has%20the%20ability%20to%20compute%20the%20cubes%2Frollups%20incrementally%20as%20new%20data%20comes%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CDistributed%20PostgreSQL%20is%20a%20game%20changer%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CWith%20Citus%20on%20Azure%2C%20we%20can%20create%20OLAP%20cubes%20on%20demand.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20no%20longer%20takes%20two%20to%20three%20days%20for%20new%20data%20to%20be%20%E2%80%9Ccooked%E2%80%9D%20and%20added%20to%20the%20dashboard.%20%E2%80%9CWe%20can%20make%20sure%20our%20RQV%20analytics%20dashboard%20users%20have%20the%20latest%20data%20about%20Windows%20quality%20right%20at%20their%20fingertips%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CAs%20a%20result%2C%20they%20can%20strengthen%20product%20quality%20and%20meet%20their%20tight%20release%20deadlines.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CEM%3E%3CFONT%20size%3D%225%22%3E%E2%80%9CCitus%20is%20a%20petabyte-scale%20Postgres%20database%20that%20can%20drive%20a%20large%2C%20executive%20analytics%20dashboard%20and%20support%20hundreds%20of%20concurrent%20queries.%20Using%20the%20combination%20of%20Citus%20and%20Postgres%20on%20Azure%20was%20the%20right%20approach%20for%20us%20at%20Microsoft%E2%80%94and%20I%20believe%20it%20will%20be%20the%20right%20approach%20for%20many%20other%20organizations.%E2%80%9D%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%E2%80%94Min%20Wei%2C%20Principal%20Engineer%20at%20Microsoft%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1165571667%22%20id%3D%22toc-hId-1165571667%22%3EGetting%20control%20over%20your%20data%20with%20massively%20parallel%20transactions%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20engineers%20and%20other%20team%20members%20relying%20on%20the%20RQV%20analytics%20dashboard%20to%20make%20important%20ship-room%20decisions%20for%20Windows%20releases%2C%20the%20data%20in%20the%20database%20must%20be%20accurate.%20But%20what%20happens%20when%20bad%20data%20is%20accidentally%20entered%20into%20the%20dashboard%E2%80%99s%20underlying%20database%3F%26nbsp%3BWei%20told%20this%20story%20in%20his%20%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAeMaBwd90SI%26amp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Etalk%20at%20PostgresOpen%202018%3C%2FA%3E%2C%20on%20lessons%20learned%20building%20his%20real-time%20analytics%20database%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CSometimes%20you%20ingest%20the%20wrong%20data%2C%20and%20it%20can%20be%20very%20costly%20to%20fix%20the%20error%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CIn%20one%20case%2C%20I%20had%20swallowed%20almost%20two%20weeks%20of%20bad%20data.%20There%20was%20a%20column%20that%20was%20just%20wrong.%20I%20was%20between%20a%20rock%20and%20a%20hard%20place.%20I%20knew%20that%20dropping%20the%20table%20would%20take%20me%20about%207%20days.%20But%20then%20I%20realized%20that%20it%E2%80%99s%20Postgres%2C%20and%20I%20can%20do%20updates.%20And%20because%20of%20the%20distributed%20nature%20of%20Citus%2C%20I%20could%20do%20updates%20fast.%20So%20I%20picked%20a%20weekend%2C%20because%20query%20times%20are%20low%20on%20weekends.%20And%20with%20Postgres%20and%20Citus%2C%20I%20was%20able%20to%20update%2026%20billion%20rows%20in%20just%2010%20hours.%20I%20was%20really%20impressed.%20Other%20distributed%20databases%20don%E2%80%99t%20give%20you%20anywhere%20near%20this%20ability%20to%20update%20the%20data%20and%20improve%20its%20accuracy.%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1386585294%22%20id%3D%22toc-hId--1386585294%22%3ESupporting%20a%20petabyte-scale%20database%20with%20Citus%20on%20Azure%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWei%20wholeheartedly%20recommends%20using%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fcitusdata%2Fcitus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECitus%20to%20scale%20out%20Postgres%3C%2FA%3E.%20%E2%80%9CSome%20organizations%20build%20data%20lakes%20when%20they%20need%20a%20large-scale%20data%20warehouse%2C%20but%20instead%20I%20think%20they%20should%20take%20a%20serious%20look%20at%20Citus%2C%E2%80%9D%20says%20Wei.%20%E2%80%9CCitus%20is%20a%20petabyte-scale%20Postgres%20database%20that%20can%20drive%20a%20large%2C%20executive%20analytics%20dashboard%20and%20support%20hundreds%20of%20concurrent%20queries.%20Using%20the%20combination%20of%20Citus%20and%20Postgres%20on%20Azure%20was%20the%20right%20approach%20for%20us%20at%20Microsoft%E2%80%94and%20I%20believe%20it%20will%20be%20the%20right%20approach%20for%20many%20other%20organizations.%E2%80%9D%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20now%20that%20Citus%20is%20available%20as%20a%20built-in%20deployment%20option%20in%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fservices%2Fpostgresql%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Database%20for%20PostgreSQL%3C%2FA%3E%E2%80%94called%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fpostgresql%2Fquickstart-create-hyperscale-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHyperscale%20(Citus)%3C%2FA%3E%E2%80%94you%20too%20can%20scale%20out%20Postgres%20horizontally%20on%20Azure%2C%20just%20like%20Min%20Wei%20and%20the%20Windows%20Data%20and%20Intelligence%20team%20have%20done%2C%20but%20without%20having%20to%20spend%20your%20valuable%20engineering%20cycles%20managing%20your%20database.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20center%3B%22%3E**********%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3EBig%20thank%20you%20%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%20to%20Min%20Wei%2C%20Teresa%20Giacomini%2C%20Greg%20Thomas%2C%20Marco%20Slot%2C%20Jose%20Miguel%20Parrella%2C%20Craig%20Kerstiens%2C%20Samay%20Sharma%2C%20and%20Umur%20Cubukcu%20for%20their%20reviews%2C%20edits%2C%20and%20collaboration%20in%20creating%20this%20story.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-969685%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20does%20the%20Windows%20team%20at%20Microsoft%20assess%20the%20quality%20of%20new%20software%20builds%20to%20decide%20if%20the%20next%20software%20update%20is%20ready%20to%20ship%3F%20And%20how%20do%20they%20scale%20out%20Postgres%20on%20Azure%E2%80%94using%20Citus%E2%80%94to%20power%20a%20petabyte-scale%20analytics%20dashboard%2C%20analyzing%2020K%20types%20of%20metrics%20from%20over%20800M%20Windows%20devices%3F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158888iFB905481181C9830%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Min-Wei-customer-blog-1120x800-2.png%22%20title%3D%22Min-Wei-customer-blog-1120x800-2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-969685%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDatabases%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Epostgres%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Epostgresql%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

How do you know if the next update to your software is ready for hundreds of millions of customers? It starts with data. And when it comes to Windows, we’re talking lots of data. The Windows team measures the quality of new software builds by scrutinizing 20,000 diagnostic metrics based on data flowing in from 800 million Windows devices. At the same time, the team evaluates feedback from Microsoft engineers who are using pre-release versions of Windows updates. 

 

At Microsoft, the Windows diagnostic metrics are displayed on a real-time analytics dashboard called “Release Quality View” (RQV), which helps the internal “ship-room” team assess the quality of the customer experience before each new Windows update is released. Given the importance of Windows for Microsoft’s customers, the RQV analytics dashboard is a critical tool for Windows engineers, program managers, and execs. 

 

Not surprisingly, the real-time analytics dashboard is heavily used. “We have hundreds of active users every day, and thousands every month,” says Min Wei, principal engineer at Microsoft. “Delivering a new operating system update is like producing a Broadway show—there are so many people working behind the scenes to prepare. The RQV analytics dashboard helps ensure the curtain goes up on time—and that we deliver what the audience wants.”

 

Screenshot-RQV-Analytics-Dashboard-Windows.jpg

Figure 1: The internal RQV analytics dashboard at Microsoft helps the Windows team to assess the quality of upcoming Windows releases. The RQV dashboard tracks 20,000 diagnostic and quality metrics, and currently supports over 6 million queries per day, with hundreds of concurrent users. The RQV analytics dashboard relies on Postgres—along with the Citus extension to Postgres to scale out horizontally—and is deployed on Microsoft Azure. 

 

Two days to “cook” the data was unacceptable

 

The Windows Data and Intelligence team had been using a Lambda architecture for the Online Analytical Processing (OLAP) cubing workloads that powered the RQV analytics dashboard. “OLAP cubing” is the term for the multi-dimensional analysis that data scientists and engineers often use to derive insights from large swaths of data. (In the context of analytics with a database like Postgres, some developers refer to “cubing” as “rollups” or “pre-aggregations” or “aggregate tables.” There are several different names but the idea is the same: if you know that your user will query the data in a certain way, it makes sense to do the calculations in advance.)

 

Unfortunately, the architecture they were using for OLAP cubing workloads had encountered a significant obstacle. “Our OLAP cubing was running out of steam,” says Wei. “We were generating hundreds of millions of cubes every day through a MapReduce job. But as we added dimensions, we encountered the ‘curse of dimensionality’. We ran out of memory on some of the nodes, and the cubing jobs took longer and longer to finish.” 

 

Cubing delays (delays creating the rollups and report tables) meant that the Windows team wasn’t able to get the insights they needed when they needed them. “It was taking 24 to 48 hours to ‘cook’—or prepare—the data, which could leave the analytics reporting two to three days behind,” says Wei. “Those kinds of delays made it difficult to meet tight Windows release deadlines.”

 

Needed: a way to analyze data in dynamic response to users needs—what is called “dynamic OLAP cubing” 

 

With diagnostic metrics growing at an exponential rate, Wei realized he couldn’t simply deploy more servers and more hardware to solve the cubing problem. The growth of the Windows user base and all the metrics being generated would quickly outpace the resources of any new servers that he provisioned. 

 

Instead of adding more servers, Wei decided to investigate dynamic cubing. “We were creating hundreds of millions of OLAP cubes, but often users only need a small subset of the OLAP cubes for the dashboard,” says Wei. “I saw an opportunity to address the performance issue by dynamically generating only the cubes people need, as they need them.”

 

Wei realized he would need a new type of database to deliver the scale and performance required by dynamic OLAP cubing. And Wei realized that this new database should also help increase data durability. “In two years, people should be able to look at the data model and understand it,” says Wei. 

 

Finding a database for an analytics dashboard that could address the ‘curse of dimensionality’

 

Wei began to assess different databases, including open source databases such as Apache Pinot, Apache Kylin, and Apache Druid. But these databases had limited SQL support and could not support extensible data types. Nor could they support the concurrent query performance needed to drive the large-scale RQV analytics dashboard. And they didn’t permit updates to fix incorrect data. 

 

Wei recognized that a relational database management system (RDBMS) could overcome the drawbacks of several of these databases. Most importantly, an RDBMS could deliver the performance needed for dynamic cubing while also meeting his data durability requirements. “I became determined to build or buy an RDBMS,” says Wei. 

 

As Wei began to search for the right RDBMS, he realized that a horizontal, distributed relational database made the most sense. “We’re not going to see individual servers with 10 TB of memory any time soon,” says Wei. “A distributed memory architecture will be the best choice for at least the next decade.”

 

Wei also wanted an RDBMS to do OLAP cubing in a way that would help compress fast-growing data volumes through rollup-style aggregation of data. “Windows diagnostics generate tens of billions of rows of data every day. With an append-only data store, you are accumulating all of those rows,” says Wei. “I wanted to use rollups, to implement a sort of ‘semantic compression’ that could reduce the amount of data in the database.”

 

Wei also required indexing and transactional “upsert” (insert and update) capabilities. In addition, he wanted support for extensible data types, including JSON, key-value types,  HyperLogLog (HLL), and t-digest. Wei considered building a brand new distributed database, but he realized that implementing it would be a long-term project. “I would need to build a database engine on top—and for one person with a deadline of one year, that approach wasn’t feasible,” says Wei. 

 

“Distributed PostgreSQL is a game changer.”

 

Min Wei, Principal Engineer at Microsoft

 

Wei discovered the open source Citus extension to Postgres by listening to a recorded conference talk on his drive home

 

As Wei’s search for the right database continued, he discovered an open source extension to Postgres (called Citus) while listening to the video on scaling out PostgreSQL. Principal Engineer Marco Slot from Citus Data had given the presentation at the dotScale 2017 conference in Paris. “I learned that Citus was a distributed SQL platform that could meet my requirements,” says Wei. “I realized I really needed to check out Citus.” 

 

Wei began building a prototype to validate the Citus extension to Postgres. “I was learning Postgres as I built the prototype. At that point, I had little operational experience with Postgres, and there was no one to ask. I was playing with hundreds of different parameters and doing AB testing,” says Wei. “And as I explored Citus support for partitioning, index-only scans, and partial covering index, I saw that I could solve several problems using Citus.”

 

The fact that Postgres and the Citus extension are open source was important. “In our Data and Intelligence team, data is the most important asset,” says Wei. “And with a popular database platform like Postgres and Citus, I could trust that the code would outlive the professional lives of the current developers. This gave me confidence that the architecture would survive the test of time.”

 

Impressed with the early results, he transitioned the project from a proof of concept into an official project. “I started talking to the Microsoft Azure teams, and I told them that we needed a distributed RDBMS,” says Wei. “A few months later, I was happy to learn that Microsoft had acquired Citus Data.”

 

Diagram-of-VeniceDB-architecture-using-Postgres-and-Citus.png

Figure 2: The Windows team’s ship-room decisions employ an architecture that relies on the open source Postgres database, and uses Citus to scale out Postgres horizontally. The “VeniceDB” (code name) system captures over 20K types of metrics from over 800M devices; 1.5 PB (petabytes) of Azure blob storage for the raw Windows event data and staging queue; and the Citus database clusters include 44 nodes with a total of 2,816 cores, 18.7 TB of memory, and 1.5 PB (yes, petabytes) of SSD storage.

 

Building a Citus database cluster on Microsoft Azure

 

Wei chose Postgres for his new database—and is using Citus to scale out Postgres horizontally on Microsoft Azure, leveraging Ubuntu/Linux VMs. (The code name for Wei’s system is “VeniceDB.”) The VeniceDB system contains 2 Citus database clusters that both serve the RQV Analytics Dashboard and associated APIs.

 

Each Citus cluster currently includes 22 nodes (total of 44 nodes), and together the clusters have a total of 2,816 cores and 18.7 TB of memory. Wei uses 1.5 PB (yes, petabytes) of Azure Premium SSD Managed Disks for the database. And Wei uses another 1.5 PB of Azure blob storage for the staging queue and raw Windows event data.

 

I say “currently” because Wei expects to upgrade the Citus database clusters to add more nodes and more resources later this year.

 

Wei and his team began using Postgres and Citus in production and on Azure before Citus was integrated as a built-in feature in Azure Database for PostgreSQL. As a result, Wei and his team had to manage the Postgres database and the Citus extension by themselves, from the very beginning.

 

But the good news is that today, if you’re a new user considering which cloud database to use for Postgres, Microsoft offers a fully-managed database as a service for Postgres. And Azure Database for PostgreSQL now includes Citus as a built-in deployment option, called Hyperscale (Citus)

 

In addition to the Citus open source extension to Postgres, Wei also uses several other Postgres extensions. For example, he uses ‘postgresql-topn’ to calculate top occurring items in the data; ‘pg_cron’ to schedule database tasks; ‘intarray’ for manipulating null-free integer arrays; and ‘postgresql-hll’, which offers HyperLogLog data structures as a native data type. 

 

And Wei’s team has upgraded Postgres fairly often, too. The “VeniceDB” system launched using Postgres 10; today the production Citus database clusters are running Postgres 11.5; and Wei has begun testing with Postgres 12 and Citus 9.x. Says Wei, “I can see and feel the Postgres and Citus improvements over the past two years.”

 

“We can support hundreds of concurrent users and more than 6 million queries every day….With Citus, response times for 75 percent of queries are 200 milliseconds or less.”

Min Wei, Principal Engineer at Microsoft

 

Powering more than 6M queries/day on the analytics dashboard—with ultra-low latency response times

 

By using the Citus extension to Postgres to scale out Postgres, Wei’s team now has the I/O performance they need to ingest the large data sets generated by Windows diagnostic tests and user feedback. “My RQV analytics use case is very write-intensive,” says Wei. “We ingest 8 to 10 TB of data into our Postgres database every day, and because of regulatory requirements, we delete about an equal amount each day.”

 

The system is also very read-intensive. While other databases might hold 5 TB of “dead” data that is rarely read, Wei’s users query up to 200 TB of diagnostic data continuously, as they consume the data on the RQV analytics dashboard. 

 

“We can support hundreds of concurrent users and more than 6 million queries every day,” says Wei. “Dashboards might refresh every 20 to 25 minutes. As a result, the database must read between 150 and 200 TB of data—hundreds of times, daily. With Citus, response times for 75 percent of queries are less than 200 milliseconds. For some types of queries, the P75 response times are less than 90 milliseconds. And response times for 95% of queries are less than 1 second on one Citus cluster; and less than 3 seconds on the other Citus cluster.” 

  

Scaling out Postgres on Azure with the Citus extension—to power dynamic OLAP cubing

  

By using Citus to scale out Postgres across multiple nodes, Wei’s team is able to harness more memory and compute, as well as to benefit from the massive parallelism that Citus provides. The result: Wei now has the performance and response times required to do the dynamic cubing and create the rollups. Oh, and with Citus, Wei’s team also has the ability to compute the cubes/rollups incrementally as new data comes in.

 

“Distributed PostgreSQL is a game changer,” says Wei. “With Citus on Azure, we can create OLAP cubes on demand.”

 

It no longer takes two to three days for new data to be “cooked” and added to the dashboard. “We can make sure our RQV analytics dashboard users have the latest data about Windows quality right at their fingertips,” says Wei. “As a result, they can strengthen product quality and meet their tight release deadlines.”

 

“Citus is a petabyte-scale Postgres database that can drive a large, executive analytics dashboard and support hundreds of concurrent queries. Using the combination of Citus and Postgres on Azure was the right approach for us at Microsoft—and I believe it will be the right approach for many other organizations.”

 

Min Wei, Principal Engineer at Microsoft

 

Getting control over your data with massively parallel transactions

 

With engineers and other team members relying on the RQV analytics dashboard to make important ship-room decisions for Windows releases, the data in the database must be accurate. But what happens when bad data is accidentally entered into the dashboard’s underlying database? Wei told this story in his talk at PostgresOpen 2018, on lessons learned building his real-time analytics database:

 

“Sometimes you ingest the wrong data, and it can be very costly to fix the error,” says Wei. “In one case, I had swallowed almost two weeks of bad data. There was a column that was just wrong. I was between a rock and a hard place. I knew that dropping the table would take me about 7 days. But then I realized that it’s Postgres, and I can do updates. And because of the distributed nature of Citus, I could do updates fast. So I picked a weekend, because query times are low on weekends. And with Postgres and Citus, I was able to update 26 billion rows in just 10 hours. I was really impressed. Other distributed databases don’t give you anywhere near this ability to update the data and improve its accuracy.”

 

Supporting a petabyte-scale database with Citus on Azure

 

Wei wholeheartedly recommends using Citus to scale out Postgres. “Some organizations build data lakes when they need a large-scale data warehouse, but instead I think they should take a serious look at Citus,” says Wei. “Citus is a petabyte-scale Postgres database that can drive a large, executive analytics dashboard and support hundreds of concurrent queries. Using the combination of Citus and Postgres on Azure was the right approach for us at Microsoft—and I believe it will be the right approach for many other organizations.” 

 

And now that Citus is available as a built-in deployment option in Azure Database for PostgreSQL—called Hyperscale (Citus)—you too can scale out Postgres horizontally on Azure, just like Min Wei and the Windows Data and Intelligence team have done, but without having to spend your valuable engineering cycles managing your database. 

 

**********

Big thank you :smile: to Min Wei, Teresa Giacomini, Greg Thomas, Marco Slot, Jose Miguel Parrella, Craig Kerstiens, Samay Sharma, and Umur Cubukcu for their reviews, edits, and collaboration in creating this story.

1 Comment

Thanks for Sharing :cool: