Blog/Case

YMatrix HTAP Transforms Month-End Closing for a 16,000-Store Pharma Chain

2025-09-18 · YMatrix Team
#Case

Preface\r\n\r\nAs market competition intensifies and enterprises scale up, the need for fine-grained financial management has never been higher—marking a pivotal step toward going All in YMatrix.\r\n\r\nThis article explores how a leading pharmaceutical retail group chose YMatrix as its core database to tackle spiking write loads, heavy data processing, and explosive data growth. With multi-node concurrent writes, adaptive compression, and an HTAP hyper-converged architecture, the company not only broke through legacy bottlenecks in ingestion and month-end closing, but also laid a solid, unified data foundation for future intelligent operations.\r\n\r\n## 01. Introduction\r\n\r\nHow does a pharma retail giant with more than 16,000 stores complete month-end closing efficiently? Amid the digital wave, the company’s legacy closing system struggled under business expansion—frequent UI freezes, delayed reports, and mounting data backlogs hampered timely decision-making. Leadership was forced to steer with outdated dashboards—this was the reality then. After adopting the YMatrix hyper-converged database, everything changed.\r\n\r\nPowered by its HTAP architecture, node-level concurrent writes, and adaptive compression, YMatrix cracked the month-end closing challenge and accelerated the company’s finance digital transformation—turning data into a true engine for decision-making.\r\n\r\n## 02. Company Overview\r\n\r\nFounded in 1999, this pharmaceutical group ranks among the top three in China’s drug retail chains. As of year-end 2022, it ranked 361st by market capitalization among 4,976 A-share–listed companies. By September 30, 2024, the group recorded RMB 19.024 billion (tax-inclusive) in revenue for the first three quarters of 2024, operated over 16,000 stores, and had O2O drug delivery services covering nearly ten thousand locations nationwide.\r\n\r\nThe group employs over 50,000 people, including nearly 20,000 pharmacy professionals. It has been recognized for years as “No. 2 by sales among China’s chain pharmacies,” a “Top 500 Service Enterprise in China,” a “Top 100 Comprehensive Strength Chain Pharmacy,” a “Top 100 Private Enterprise in Guangdong,” and an “Outstanding Enterprise in Guangzhou.” With chain-store growth as its core and strong digital operations, the company holds a significant position in pharma retail.\r\n\r\n## 03. Business Scenarios\r\n\r\nThe group uses the YonBIP enterprise digital platform for month-end closing, aiming to ensure timely, accurate monthly financials to support management decisions. Key scopes include:\r\n\r\nCore accounting: Expense reimbursements, corporate payments, fixed assets, payroll, and other voucher entries. Bank journal reconciliation is critical—large volumes of daily transactions must precisely match bank statements.\r\n\r\nClosing & reporting: During general ledger closing, the system processes massive data for profit carry-forward, exchange gains/losses, and multi-ledger conversions, then produces the balance sheet, income statement, and cash-flow statement—vital for internal strategy and external disclosure.\r\n\r\nBalance sheet: A clear view of assets, liabilities, and equity to gauge financial strength and solvency.\r\n\r\nIncome statement: Revenue, costs, and profit to reflect operating performance.\r\n\r\nCash-flow statement: Cash inflows/outflows to ensure a healthy, stable cash position.\r\n\r\nTax & compliance: Accurate calculation and on-time filing of taxes based on financial data, with complete documentation ready for audits. In addition, a monthly funds report covers cash flows from operating, investing, and financing activities to guide capital planning and allocation.\r\n\r\n## 04. System Challenges\r\n\r\n“Others read reports to decide—while we stare at progress bars and pray.” This was the prevailing sentiment.\r\n\r\nHistorically, the enterprise relied on Oracle for data storage and processing. With continued expansion, soaring store counts, and skyrocketing data volumes, growing demands for refined financial management exposed mounting issues—turning the once-reliable Oracle system into a “roadblock.”\r\n\r\nData deluge overwhelmed the system\r\nDaily nationwide activity generated massive volumes of vouchers (expenses, payments, payroll). New vouchers reached 30 million per month and 300 million per year, pushing storage to its limits and driving up costs.\r\n\r\nReal-time decisions became a luxury\r\nWith 16,600+ stores and complex, time-sensitive logic, generating balance sheets, income statements, and cash-flow statements stretched from minutes to hours—leadership lost real-time visibility into solvency and cash health.\r\n\r\nMonth-end turned into trench warfare\r\nAt crunch time the system often “went on strike.” Voucher writes were painfully slow; concurrent writes could freeze the system. Even simple queries took minutes; complex ones, half a day. Storage maintenance grew harder as data ballooned.\r\n\r\nThese issues impeded management’s access to, analysis of, and confidence in financial data—slowing improvements in merchandising, pricing, marketing, and operations.\r\n\r\n## 05. Why YMatrix\r\n\r\nAmong many database options, YMatrix stood out for superior product capabilities and precise alignment with the business scenario.\r\n\r\nA true hyper-converged database: YMatrix’s HTAP capabilities have been proven across multiple retail enterprises, demonstrating reliability and efficiency in complex settings. Rigorous technical due diligence showed YMatrix could fully meet month-end and other mission-critical needs.\r\n\r\n#### A two-birds-one-stone architecture\r\n\r\nHTAP: Transactions and analytics on one system—eliminating dual-stack redundancy and latency.\r\n\r\nTP (Transactional) domain: Handles in-month finance ops—GL management, fixed assets, and statement generation—for accuracy and timeliness.\r\n\r\nAP (Analytical) domain: Cross-period queries and multidimensional reporting—supporting month-end decisions with consistent, stable data.\r\n\r\n\r\n\r\nIn-database streaming engine: Data syncs in real time between TP (business) and AP (analytics) zones—pushing report generation into the sub-second/seconds era and keeping management fed with timely insights.\r\n\r\n#### Brute-force performance gains\r\n\r\nWrite storm: Millions/hour concurrent writes; peak withstands surges of 1,000,000 rows.\r\n\r\nCompression “magic”: Adaptive compression shrinks data to ~1/10—taming growth and cutting storage costs.\r\n\r\nYMatrix’s elastic scalability handles rapid business and data growth with ease.\r\n\r\n\r\n\r\nSeamless YonBIP compatibility is another edge—YMatrix integrates smoothly with the YonBIP platform, enabling a stable migration without major process changes, reducing costs and disruption, and ensuring business continuity.\r\n\r\nFinally, the experienced YMatrix engineering team provides end-to-end technical support and assurance throughout adoption and operations.\r\n\r\n## 06. How YMatrix + YonBIP Empowered the Enterprise\r\n\r\nYMatrix’s distributed HTAP solution unifies transactional processing and analytics, meeting dual needs for high-volume finance operations and timely reporting (e.g., data dashboards, balance analysis).\r\n\r\nAt the data-coordination layer, the Domino in-database streaming engine keeps TP and AP in real-time sync—an internal high-speed lane that delivers timely, accurate data for reports and balance analyses. Combined with the MARS3 storage engine’s adaptive compression, ODS data is stored in multi-tier compressed layers to reduce redundancy.\r\n\r\n\r\n\r\nAt the deployment layer, the cluster ran on five physical nodes:\r\none primary node for connection management and orchestration—the brain of the cluster; and four data nodes for storage and processing.\r\n\r\nTP data nodes focus on transactional workloads (voucher entry, asset accounting) to ensure high-frequency operations run efficiently.\r\n\r\nAP data nodes focus on data processing for financial reporting, analytics, and month-end calculations.\r\n\r\n\r\n\r\nWith YMatrix’s distributed HTAP architecture, YonBIP achieved integrated finance-operations data sharing, powering upper-layer modules (event accounting, financial accounting, intelligent analytics, etc.) with a unified data backbone. The result: efficient, stable transactions and real-time analytical processing—showcasing YMatrix’s strengths in high-volume writes and analytical performance.\r\n\r\nThe system no longer chases the business—data now propels the enterprise forward.\r\n\r\nProven in production:\r\nYMatrix sustained stable, efficient operations for 30 million new vouchers per month, ensuring multiple smooth month-end closes. Peak TPS exceeded 100,000+, while CPU and memory stayed safely within limits.\r\n\r\nEfficiency leap: Month-end cycles shrank to T+2; report generation sped up with real-time updates; finance teams no longer worked through the night.\r\n\r\nSmarter decisions: Leadership accessed timely data to fine-tune pricing; gross margin climbed by 15%.\r\n\r\nDeeper insights: Finance teams mined historical data to forecast funding needs and cash flows, enabling forward-looking planning.\r\n\r\nCost plunge: Hardware spending down 60%; Ops transformed from “firefighting” to “strategy,” saving tens of millions of RMB annually in O&M.\r\n\r\nWhat made this possible\r\n\r\nPeak-shaving writes: Parallelized ingestion; >100k TPS; supports 1M rows/hour concentrated writes; during month-end, data from 200 stores surged in parallel with zero freezes.\r\n\r\nAdaptive compression: MARS3 applies multi-level, type-aware compression—successfully handling a month-end growth spike from 753 GB to 1,244 GB (+65%) in February.\r\n\r\nReal-time in-DB streaming: Stream transforms/analytics inside the database—no external pipelines. Financial report queries respond in seconds, enabling true T+2 month-end.\r\n\r\nOne-stack HTAP: One database for both transactions and analytics—lowering technical complexity and maintenance costs.\r\n\r\nACID-grade consistency: A single source of truth avoids cross-system drift between OLTP and OLAP, ensuring accurate, reliable financial statements.\r\n\r\n## 07. HTAP Is Not Optional—It’s a Survival Imperative\r\n\r\nWhen the second hand keeps pace with business, growth no longer arrives late.\r\n\r\nFrom “praying to progress bars” to “winning by the second,” this victory belongs not only to technology, but also to the courage to reshape business with data. YMatrix will continue to innovate and optimize performance.\r\n\r\nLooking ahead, YMatrix will leverage resources even more efficiently and further enhance performance in ultra-large financial data scenarios—helping pharma retailers stand out in fierce competition and achieve greater success. As the company’s CIO concluded at an industry summit, “HTAP hyper-convergence is not a choice—it’s a survival imperative.”