Now that 2024 is behind us, we can see clearly how much change, innovation, and progress there was across the…
Databases
In today’s digital-first world, data is the lifeblood of innovation and decision-making. Yet, businesses often find themselves constrained by outdated…
PostgreSQL distinguishes itself from other relational databases through its extensibility and support for object-oriented design. This allows you to create…
The emergence of 5G network communication, IoT devices, edge computing, and AI have accelerated structural changes within the telecommunications industry,…
Data migration from Oracle Database to Amazon Relational Database Service (Amazon RDS) for PostgreSQL or Amazon Aurora PostgreSQL-Compatible Edition can…
Gamuda Berhad is a leading Malaysian engineering and construction company with operations across the world, including in Australia, Taiwan, Singapore,…
The retail industry has continued to evolve into an omnichannel marketplace since the 2020 pandemic sparked a surge of online…
Generative AI (gen AI) is changing retail in fascinating ways. It’s providing new avenues for IT leaders at retailers to…
Today’s customers expect a seamless shopping experience across both online and physical channels. The ability to Buy Online, Pick Up…
Vacasa, a leading vacation rental management platform in North America, is revolutionizing the vacation rental experience with advanced technology and…
MongoDB is excited to announce the availability of Search Demo Builder, the newest addition to the Atlas Search Playground. The…
As one of the world’s leading technology and media companies, Sony needs little introduction. Founded in 1954, Sony’s portfolio spans…
数据是企业的生命线,数据库的稳定性是企业业务稳定的基座,保障数据库稳定运行对于企业数据的安全性和可靠性至关重要。 知乎,中文互联网高质量的问答社区和创作者聚集的原创内容平台,于2011年1月正式上线,以“让人们更好的分享知识、经验和见解,找到自己的解答”为品牌使命。知乎从问答起步,在过去的13年中逐步成长为一个大规模的综合性内容平台。 在高并发场景下,如何提升写入吞吐量,保障在线实时业务的稳定运行? 随着数据规模的持续增长,如何有效地存储、管理和分析数据成为每个企业面临的重大挑战。作为数据管理的核心技术,数据库选型至关重要。在高并发的场景下,数据库的读写请求非常频繁,如果所有请求都集中到一个节点上,势必会导致性能瓶颈。随着用户访问量的急剧上升,如果数据库不能及时响应请求,将直接影响用户体验。 例如,知乎的核心业务场景——反作弊业务。这个业务场景通常需要实时对接,并及时地处理作弊内容和用户,迅速分析作弊原因并制定解决策略。作为一套用于反作弊的风控类业务,知乎反作弊业务要求有极高的并发写入吞吐量,甚至超过已读服务(根据资料显示,在2019年,知乎已读服务在高峰时间每秒写入超过4万条记录,日新增记录近30亿条);同时,索引的构建还会严重影响写入吞吐量。在高并发写入场景下,优化数据库的写入性能和事务处理效率是非常重要的一环。 为了满足在海量数据存储环境下,可伸缩、高吞吐、高并发、高可用以及毫秒级数据实时性等方面的要求,知乎选用MongoDB支撑底层数据,解决了安全业务中的数据量大、低延迟、表结构不稳定以及JSON数据处理等问题。 良好的架构设计,让业务更加流畅 数据库架构设计的质量直接影响着数据库系统的性能、可靠性和可扩展性。一个良好的数据库架构设计能够提高数据库系统的响应速度、降低数据冗余、保证数据的一致性和完整性,并且能够适应未来的业务增长和变化。通过使用MongoDB集群架构模式,知乎在安全反作弊业务中设置了副本集和分片集群上下衔接的方式,能够根据不同的业务场景需要去选择适合的集群,从而实现了业务审核的及时处理和内部分析。 在任何数据库中,索引是提升查询效能的必要手段。MongoDB提供了丰富的索引类型和功能,并支持对数据的复杂访问模式。 知乎通过MongoDB创建了符合自身需求的组合索引,从而有效减少了在线实时业务的低延迟。同时,MongoDB创建索引都是在后台执行的,避免了对线上业务产生不良影响。随着业务时时刻刻发生新变化,MongoDB还能够提供定期分析和优化索引,避免过度索引。代晓磊谈到,“有了这个索引优化,只要业务没有发生太大的变化,再结合一些参数调优,其实业务还是跑得挺好的。” 数据库的稳定性建设不可或缺 提高数据库的稳定性是确保数据安全、服务可靠和业务连续性的关键。在知乎的安全反作弊业务场景中,每天要承载很多来自业务请求的突发流量,可能导致大流量副本集抖动。问题一旦出现,对业务端来说会直接导致审核变慢,很快就会招致业务部门投诉。 虽然知乎数据库的监控项非常多,每个集群有多种监控项,但每个集群的负载不同,它触发的报警阈值也不同。在同一套报警触发阈值下,不同负载的集群可能会给监控人员频繁地发送预警信息。知乎通过MongoDB 监控平台,有效解决了集群情况监控的难题。 MongoDB提供了全面的监控功能,可以对实例各节点资源的运行情况进行监控,通过监控每个MongoDB数据库中的索引、文件、对象和集合,跟踪每个元素的内存和存储消耗,并相应地优化资源。此外,MongoDB提供的细颗粒度报警,对于运维人员而言,也是相当友好的。 如何确保数据库的可扩展性? 当大规模的数据存储和处理需求呈现出爆炸式增长态势时,这使得数据库的可扩展性成为了一个重要的考量因素。分片(Sharding)是一种跨多台机器分布数据的方法,通常都是使用分片来支持具有非常大的数据集和高吞吐量操作的部署。对于知乎而言,选取合适的分片均衡策略尤其重要。 MongoDB提供了两种思路:其一,通过划分区域(zone),把相关业务查询的近期数据全部集中放在一个分片中,避免在分片上汇聚数据,减轻数据库压力;其二,根据业务方反馈的字段规则,自动按年月分配标签(tag)并合理规划zone分配,最终实现自动化维护。 此外,依托于MongoDB压缩引擎,减少了磁盘空间的使用。经过测试,当未压缩数据为4.8T时,默认压缩方式snappy,占本地磁盘3.1T,压缩比例为64%;而测试压缩方式zstd,占本地磁盘1.9T,压缩比例为39%。显然,zstd压缩比例更好,最终帮助知乎将数据的使用空间压缩到一个合理的范围之内。 目前MongoDB不仅应用在知乎的安全反作弊业务场景中,还广泛应用在一些社区及其他业务线的部分集群中。代晓磊谈到,“未来,除了在更多场景中落地,我们还将继续通过MongoDB实现数据治理,通过云服务、多活能力、平台化建设进行版本升级,实现降本增效。”…
The IT landscape has evolved dramatically over the past decade. Cloud-native architectures, advanced analytics, and AI have reshaped the way…
Amazon DynamoDB enables you to back up your table data continuously by using point-in-time recovery (PITR). When you enable PITR,…
In Part 1 of this series we discussed dealing with multiple database engines or schemas that share data with each…
Primary keys and unique identifiers are fundamental to database design, as they provide a reliable way to uniquely identify and…
Data obfuscation, or data anonymization, refers to a collection of techniques used to disguise or alter sensitive data to minimize…
Bi-directional replication for Oracle databases is crucial for businesses because it provides high availability and supports disaster recovery. Additionally, it…
In this post, we walk you through how to make your Amazon Timestream for InfluxDB deployments more secure by offering…