Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1123403%22%20slang%3D%22en-US%22%3EAutomated%20Query%20Caching%20with%20the%20Heimdall%20Proxy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1123403%22%20slang%3D%22en-US%22%3E%3CP%3EApplication-database%20inefficiency%20(e.g.%20repeated%20queries%2C%20network%20latency)%20is%20a%20primary%20cause%20of%20performance%20bottlenecks.%20Query%20caching%20is%20used%20to%20improve%20responsiveness%20and%20scale.%20But%20caching%20has%20its%20challenges%20including%20knowing%20what%20to%20cache%20and%20when%20to%20invalidate.%20Moreover%2C%20caching%20requires%20manual%20code%20changes%20to%20the%20application.%20This%20blog%20walks%20you%20through%20the%20steps%20to%20configuring%20and%20automating%20query%20caching%20to%20the%20grid-cache%20of%20your%20choice%20(e.g.%20Azure%20for%20Redis%2C%20Hazelcast).%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EArchitecture%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EHeimdall%20offers%20two%20software%20packages%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDatabase%20Proxy%3A%20MySQL%2C%20MariaDB%2C%20Postgres%2C%20SQL%20Server%2C%20Azure%20Database%3C%2FLI%3E%0A%3CLI%3EJDBC%20Driver%3A%20Provides%20access%20to%20any%20JDBC-compliant%20database%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F166566i1A032A32BAFEC2AA%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_7.png%22%20title%3D%22clipboard_image_7.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EFigure%201%3A%20Software%20Package%20Options%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Heimdall%20Proxy%20can%20be%20deployed%20in%20two%20ways%3A%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EJDBC%20driver%3A%20Heimdall%20driver%20is%20inserted%20between%20your%20application%20and%20current%20vendor%20JDBC%20driver.%3C%2FLI%3E%0A%3CLI%3EAgent%3A%20Proxy%20is%20installed%20as%20a%20separate%20process%20on%20the%20client%2C%20server%20or%20a%20separate%20proxy%20tier.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20deployment%2C%20simply%20modify%20the%20host%2Fport%20or%20JDBC%20URL%20to%20route%20through%20the%20Heimdall%20proxy.%20No%20application%20changes%20are%20required.%20When%20downloaded%20from%20the%26nbsp%3BHeimdall%20is%20deployed%20as%20a%20proxy%20tier%20between%20the%20application%20and%20database%20as%20shown%20in%20Figure%202.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F161907iEB4ABCB0ED16FA95%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Slide7.PNG%22%20title%3D%22Slide7.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.heimdalldata.com%2Fquerycache%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3EFigure%202%3A%20Database%20Proxy%20Tier%20Architecture%3C%2FEM%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHow%20it%20works%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAs%20your%20application%20talks%20to%20the%20database%2C%20the%20proxy%20intercepts%20the%20queries%20and%20determines%20what%20SQL%20results%20to%20cache.%20Additionally%2C%20Heimdall%20routes%20queries%20to%20different%20servers%20(for%20load-balancing%20and%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-database-for-mysql%2Fusing-the-heimdall-proxy-to-split-reads-and-writes-for-mysql%2Fba-p%2F1067640%22%20target%3D%22_self%22%3Eread%2Fwrite%20split%3C%2FA%3E)%26nbsp%3Bto%20your%20backend%20database.%20Heimdall%E2%80%99s%20cache%20algorithms%20are%20based%20on%20real-time%20analysis%20of%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EQuery%20frequency%20and%20variability%3C%2FLI%3E%0A%3CLI%3EComparison%20of%20response%20times%20between%20cache%20vs.%20database%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWe%20track%20the%20entries%20in%20the%20cache%20and%20will%20never%20ask%20for%20data%20not%20contain%20therein%2C%20eliminating%20unnecessary%20round%20trips%3B%20there%20is%20never%20a%20cache%20miss.%20Query%20results%20will%20only%20be%20cached%20if%20it%20provides%20a%20performance%20benefit.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHow%20does%20Heimdall%20handle%20cache%20invalidations%3F%20When%20our%20proxy%20detects%20a%20change%20to%20the%20database%2C%20the%20proxy%20will%20invalidate%20the%20associated%20cache%20entries%20and%20optionally%20update%20the%20cache%20entry.%20Invalidation%20is%20automated%20and%20synchronized%20between%20Heimdall%20proxies.%20If%20required%2C%20you%20can%20always%20manually%20configure%20the%20TTL%20or%20expiry%20for%20each%20query%20cache.%20However%2C%20we%20have%20taken%20that%20burden%20away%20from%20you.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAzure%20Installation%20and%20Set%20up%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%201%3A%20%3C%2FSTRONG%3EThe%20following%20example%20shows%20you%20how%20to%20configure%20the%20Heimdall%20proxy%20with%20Azure%20Cache%20for%20Redis%20in%20a%20WordPress%2C%20MySQL%20environment.%3C%2FP%3E%0A%3CP%3EDownload%20the%20Heimdall%20proxy%20onto%20a%20VM%20instance%20from%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fazuremarketplace.microsoft.com%2Fen-us%2Fmarketplace%2Fapps%2Fheimdall-data.heimdall-data%3Fsrc%3Dtazure%26amp%3Btab%3DOverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Marketplace%3C%2FA%3E.%20The%20installation%20will%20include%20both%20the%20proxy%20and%20Central%20Console.%20For%20more%20information%2C%20visit%20our%26nbsp%3B%3CA%20href%3D%22http%3A%2F%2Fdemoa.heimdalldata.com%3A8087%2Fdocs%2Fenvironment%2Fazure.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Etechnical%20documentation%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%202%3A%20%3C%2FSTRONG%3EAccess%20the%20Heimdall%20Central%20Console%20with%20the%20server%20URL%20and%20post%208087.%20On%20the%20left%20panel%2C%20click%20%E2%80%9CWizard%E2%80%9D%2C%20and%20then%20click%20%E2%80%9CManual%20Configuration%E2%80%9D%20shown%20below.%20Our%20configuration%20wizard%20takes%20you%20step-by-step%20to%20successfully%20connect%20the%20Heimdall%20proxy%20to%20your%20Azure%20components%20(i.e.%20application%2C%20database%2C%20cache)%2C%20and%20configure%20features%20(e.g.%20Query%20caching%2C%20%3CFONT%20color%3D%22%230000FF%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-database-for-mysql%2Fusing-the-heimdall-proxy-to-split-reads-and-writes-for-mysql%2Fba-p%2F1067640%22%20target%3D%22_self%22%3ERead%2FWrite%20splitting%3C%2FA%3E%3C%2FFONT%3E%2C%20Load%20balancing).%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-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%2F166568i901C8A9E52B97737%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_9.png%22%20title%3D%22clipboard_image_9.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%203%3A%3C%2FSTRONG%3E%26nbsp%3BOnce%20you%20have%20completed%20the%20Configuration%20Wizard%2C%20review%20the%20configuration%20starting%20with%20the%26nbsp%3B%3CSTRONG%3EVirtual%20Databases%3C%2FSTRONG%3E%26nbsp%3Btab%2C%20which%20provides%20connection%20information%20for%20the%20application.%20See%20below%20for%20a%20screenshot%20preview.%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-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%2F166570i47C99FA183FB1101%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_10.jpeg%22%20title%3D%22clipboard_image_10.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%204%3A%26nbsp%3B%3C%2FSTRONG%3EConfirm%20the%20database%20connection%20settings%20in%20the%26nbsp%3B%3CSTRONG%3EData%20Sources%3C%2FSTRONG%3E%26nbsp%3Btab%2C%20which%20includes%20connection%20pooling%2C%20load%20balancing%2C%20automated%20failover%2C%20and%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-database-for-mysql%2Fusing-the-heimdall-proxy-to-split-reads-and-writes-for-mysql%2Fba-p%2F1067640%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eread%2Fwrite%20splitting%3C%2FA%3E.%20See%20below%20for%20another%20screenshot%20preview.%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-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%2F166572i7B72216470DC83A4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_11.jpeg%22%20title%3D%22clipboard_image_11.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%205%3A%26nbsp%3B%3C%2FSTRONG%3EThe%26nbsp%3B%3CSTRONG%3ERules%3C%2FSTRONG%3E%26nbsp%3Btab%20controls%20how%20queries%20are%20cached%2C%20routed%2C%20and%20transformed.%20The%20default%20configuration%20is%20to%201)%20Cache%20traffic%20NOT%20in%20transactions%2C%202)%20Forward%20selected%20traffic%20to%20a%20read-only%20source%2C%20and%203)%20Log%20query%20traffic.%20You%20can%20create%20custom%20rules%20without%20restarting%20the%20application%20or%20database.%20Make%20any%20rule%20configuration%20changes%20and%20click%26nbsp%3B%3CSTRONG%3ECommit%3C%2FSTRONG%3E%26nbsp%3Bto%20finalize.%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-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%2F166571iD706FF478013F45F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_12.jpeg%22%20title%3D%22clipboard_image_12.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%206%3A%3C%2FSTRONG%3E%26nbsp%3BConnect%20the%20application%20to%20the%20proxy%20by%20changing%20the%20database%20configuration%20to%20match%20the%20proxy%E2%80%99s%20host%20and%20port%2C%20as%20configured%20in%20the%20Virtual%20DB%20tab.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESummary%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20below%20dashboard%20provides%20information%20on%20query%20traffic%20and%20server%20performance%20for%20a%20WordPress%20application.%20Notice%20that%20the%20average%20query%20time%20from%20cache%20was%2050%20microseconds%20compared%20to1000%20microseconds%20from%20the%20database.%20Query%20caching%20resulted%20in%20a%20performance%20boost%20of%20over%2020x%20times!%20%26nbsp%3BWith%20a%2090%25%20cache%20hit%20rate%2C%20the%20database%20load%20was%20significantly%20reduced%20allowing%20for%20more%20users%20to%20be%20supported%20on%20the%20same%20database%20infrastructure.%3C%2FP%3E%0A%3CP%3EWe%20made%20no%20changes%20to%20the%20application%20besides%20the%20database%20URL%2Fhost%2Bport%20change%3B%20no%20database%20system%20changes%20were%20required.%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-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%2F166573i8F0159409C3806DD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_13.png%22%20title%3D%22clipboard_image_13.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EConclusion%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20Heimdall%20proxy%20transparently%20improves%20read%2Fwrite%20query%20performance.%20Our%20distributed%20caching%20offers%20a%20simple%2C%20low%20latency%20solution%20for%20users%20without%20disruption%20to%20the%20application%20or%20database.%26nbsp%3BCustomers%20will%20not%20only%20improve%20database%20scale%20but%20also%20save%20on%20operational%20and%20licensing%20costs%20up%20to%2050%25.%20%3CA%20href%3D%22https%3A%2F%2Fazuremarketplace.microsoft.com%2Fen-us%2Fmarketplace%2Fapps%2Fheimdall-data.heimdall-data%3Fsrc%3Dtazure%26amp%3Btab%3DOverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDownload%20a%20free%20trial%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EResources%20and%20links%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CA%20href%3D%22https%3A%2F%2Fazuremarketplace.microsoft.com%2Fen-us%2Fmarketplace%2Fapps%2Fheimdall-data.heimdall-data%3Fsrc%3Dtazure%26amp%3Btab%3DOverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Marketplace%3C%2FA%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3EBlog%3A%3CFONT%20color%3D%22%230000FF%22%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-database-for-mysql%2Faccelerate-mysql-performance-with-the-heimdall-proxy%2Fba-p%2F1063349%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EHeimdall%20Proxy%20Overview%20for%20Azure%3C%2FA%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3EBlog%3A%26nbsp%3B%3CFONT%20color%3D%22%230000FF%22%3E%3CA%20href%3D%22https%3A%2F%2Fblog.heimdalldata.com%2F2019%2F06%2F06%2Fimprove-read-replica-utilization-azure%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUsing%20the%20Heimdall%20Proxy%20to%20Split%20Reads%20and%20Writes%20for%20Azure%20Databases%3C%2FA%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3EContact%3A%20%3CFONT%20color%3D%22%230000FF%22%3E%3CA%20href%3D%22mailto%3Ainfo%40heimdalldata.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Einfo%40heimdalldata.com%3C%2FA%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CEM%3E%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EHeimdall%20Data%2C%20a%20Microsoft%20technology%20partner%2C%20offers%20a%20database%20proxy%20that%20helps%20developers%20and%20DBAs%20improve%20SQL%20performance%20and%20scale%20without%20application%20changes.%20Features%20include%20caching%2C%20read%2Fwrite%20splitting%2C%20connection%20pooling%2C%20and%20query%20routing.%20Save%20months%2Fyears%20of%20development%20and%20maintenance.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1123403%22%20slang%3D%22en-US%22%3E%3CP%3EImprove%20database%20scale%20with%20query%20caching%20and%20invalidation%3B%20no%20application%20changes%20required.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1123403%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECaching%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eproxy%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQueries%20and%20Connections%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Equery%20cache%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Equery%20performance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Equery%20routing%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

Application-database inefficiency (e.g. repeated queries, network latency) is a primary cause of performance bottlenecks. Query caching is used to improve responsiveness and scale. But caching has its challenges including knowing what to cache and when to invalidate. Moreover, caching requires manual code changes to the application. This blog walks you through the steps to configuring and automating query caching to the grid-cache of your choice (e.g. Azure for Redis, Hazelcast).

 

Architecture

Heimdall offers two software packages:

  • Database Proxy: MySQL, MariaDB, Postgres, SQL Server, Azure Database
  • JDBC Driver: Provides access to any JDBC-compliant database

clipboard_image_7.png

 

Figure 1: Software Package Options

 

The Heimdall Proxy can be deployed in two ways: 

  • JDBC driver: Heimdall driver is inserted between your application and current vendor JDBC driver.
  • Agent: Proxy is installed as a separate process on the client, server or a separate proxy tier.

 

For deployment, simply modify the host/port or JDBC URL to route through the Heimdall proxy. No application changes are required. When downloaded from the Heimdall is deployed as a proxy tier between the application and database as shown in Figure 2.

Slide7.PNG

 Figure 2: Database Proxy Tier Architecture

 

 

How it works

As your application talks to the database, the proxy intercepts the queries and determines what SQL results to cache. Additionally, Heimdall routes queries to different servers (for load-balancing and read/write split) to your backend database. Heimdall’s cache algorithms are based on real-time analysis of:

  • Query frequency and variability
  • Comparison of response times between cache vs. database

We track the entries in the cache and will never ask for data not contain therein, eliminating unnecessary round trips; there is never a cache miss. Query results will only be cached if it provides a performance benefit.

 

How does Heimdall handle cache invalidations? When our proxy detects a change to the database, the proxy will invalidate the associated cache entries and optionally update the cache entry. Invalidation is automated and synchronized between Heimdall proxies. If required, you can always manually configure the TTL or expiry for each query cache. However, we have taken that burden away from you.

 

Azure Installation and Set up

 

Step 1: The following example shows you how to configure the Heimdall proxy with Azure Cache for Redis in a WordPress, MySQL environment.

Download the Heimdall proxy onto a VM instance from the Azure Marketplace. The installation will include both the proxy and Central Console. For more information, visit our technical documentation.

 

Step 2: Access the Heimdall Central Console with the server URL and post 8087. On the left panel, click “Wizard”, and then click “Manual Configuration” shown below. Our configuration wizard takes you step-by-step to successfully connect the Heimdall proxy to your Azure components (i.e. application, database, cache), and configure features (e.g. Query caching, Read/Write splitting, Load balancing).

 

clipboard_image_9.png

 

 

Step 3: Once you have completed the Configuration Wizard, review the configuration starting with the Virtual Databases tab, which provides connection information for the application. See below for a screenshot preview.

 

clipboard_image_10.jpeg

 

 

Step 4: Confirm the database connection settings in the Data Sources tab, which includes connection pooling, load balancing, automated failover, and read/write splitting. See below for another screenshot preview.

 

clipboard_image_11.jpeg

 

 

Step 5: The Rules tab controls how queries are cached, routed, and transformed. The default configuration is to 1) Cache traffic NOT in transactions, 2) Forward selected traffic to a read-only source, and 3) Log query traffic. You can create custom rules without restarting the application or database. Make any rule configuration changes and click Commit to finalize.

 

clipboard_image_12.jpeg

 

 

Step 6: Connect the application to the proxy by changing the database configuration to match the proxy’s host and port, as configured in the Virtual DB tab.

 

 

Summary

The below dashboard provides information on query traffic and server performance for a WordPress application. Notice that the average query time from cache was 50 microseconds compared to1000 microseconds from the database. Query caching resulted in a performance boost of over 20x times!  With a 90% cache hit rate, the database load was significantly reduced allowing for more users to be supported on the same database infrastructure.

We made no changes to the application besides the database URL/host+port change; no database system changes were required.

 

clipboard_image_13.png

 

 

Conclusion

The Heimdall proxy transparently improves read/write query performance. Our distributed caching offers a simple, low latency solution for users without disruption to the application or database. Customers will not only improve database scale but also save on operational and licensing costs up to 50%. Download a free trial.

 

 

Resources and links:

 

Heimdall Data, a Microsoft technology partner, offers a database proxy that helps developers and DBAs improve SQL performance and scale without application changes. Features include caching, read/write splitting, connection pooling, and query routing. Save months/years of development and maintenance.