分布式数据库设计的要点
当前key-value的数据库分布式数据库应用非常广泛。在互联网的企业或者大的服务提供商,很多数据都采用key-value的形式存储,包括图片,索引,网页评论,博客等。 key-value的分布式数据库的特点是访问稳定一致,不会受到随着数据量增大性能严重下降的困扰,
当前key-value的数据库分布式数据库应用非常广泛。在互联网的企业或者大的服务提供商,很多数据都采用key-value的形式存储,包括图片,索引,网页评论,博客等。
key-value的分布式数据库的特点是访问稳定一致,不会受到随着数据量增大性能严重下降的困扰,传统的关系数据库无法消除这个困扰。key-value的数据库一个key对应一条记录,其指标就是这个数据库能容纳的最大key数量,value的最大值,平均值等。数据存储大小对性能是否有影响等,总的存储量多大,磁盘利用率多大等,访问速度在其次。只要控制在一次访问在10ms以内,就行了。实际上成熟的数据库一般都是有读写cache的。因此,好的数据库的访问性能不是瓶颈。比较数据库的优缺点主要是容量,安全性,容灾性能,分布性能和磁盘利用率。
分布式数据库的设计要点:
1.路由机制
既然是分布式,那么数据的存储肯定是分布式在不同的机器,或者不同的机房,甚至不懂的IDC。路由机制的可靠好完善是数据安全性的保证。也是分布第一要解决的问题。路由机制保证容灾、迁移的正常进行。
2.数据库的cache机制
数据库必须是读写cache的,否则就没有价值可言,一个初期的数据库可能直接用机器来堆出访问量支撑,可能不需要cache。但是随着数据库的大规模使用,如果不做cache成本根本无法承受,就包括腾讯、百度、淘宝这些巨头都无法承受没有cache的数据库的使用。这些巨头的访问量都是上亿级别的。没有那个数据库能在没有cache的情况下支撑那么大的访问量,那得多少机器呀!
写cache是后台服务器设计中最复杂的内容之一。写cache复杂之处不是其cache算法以及cahche节点的编程,而是在于其容灾和数据恢复,以及写多份数据的相互更新的安全性。设计写cache必须考虑每个可能异常以及最极端的情况下的数据恢复,记住一个要点就是,每个过程都有可能被中断。
3.数据库的磁盘组织,多份数据的校验和相互更新安全性
磁盘往往会损坏,出现坏道坏磁头等现象,多份数据能在磁盘损坏的情况下保证数据的正常读写,但是多份数据带来了写cache的逻辑复杂性。数据库的容灾一般是靠active和standby模式来进行灾备。多份数据的校验和相互更新也是逻辑层的最复杂逻辑之一。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

According to news on April 17, HMD teamed up with the well-known beer brand Heineken and the creative company Bodega to launch a unique flip phone - The Boring Phone. This phone is not only full of innovation in design, but also returns to nature in terms of functionality, aiming to lead people back to real interpersonal interactions and enjoy the pure time of drinking with friends. Boring mobile phone adopts a unique transparent flip design, showing a simple yet elegant aesthetic. It is equipped with a 2.8-inch QVGA display inside and a 1.77-inch display outside, providing users with a basic visual interaction experience. In terms of photography, although it is only equipped with a 30-megapixel camera, it is enough to handle simple daily tasks.

According to news on April 26, ZTE’s 5G portable Wi-Fi U50S is now officially on sale, starting at 899 yuan. In terms of appearance design, ZTE U50S Portable Wi-Fi is simple and stylish, easy to hold and pack. Its size is 159/73/18mm and is easy to carry, allowing you to enjoy 5G high-speed network anytime and anywhere, achieving an unimpeded mobile office and entertainment experience. ZTE 5G portable Wi-Fi U50S supports the advanced Wi-Fi 6 protocol with a peak rate of up to 1800Mbps. It relies on the Snapdragon X55 high-performance 5G platform to provide users with an extremely fast network experience. Not only does it support the 5G dual-mode SA+NSA network environment and Sub-6GHz frequency band, the measured network speed can even reach an astonishing 500Mbps, which is easily satisfactory.

According to news on July 12, the Honor Magic V3 series was officially released today, equipped with the new Honor Vision Soothing Oasis eye protection screen. While the screen itself has high specifications and high quality, it also pioneered the introduction of AI active eye protection technology. It is reported that the traditional way to alleviate myopia is "myopia glasses". The power of myopia glasses is evenly distributed to ensure that the central area of sight is imaged on the retina, but the peripheral area is imaged behind the retina. The retina senses that the image is behind, promoting the eye axis direction. grow later, thereby deepening the degree. At present, one of the main ways to alleviate the development of myopia is the "defocus lens". The central area has a normal power, and the peripheral area is adjusted through optical design partitions, so that the image in the peripheral area falls in front of the retina.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

According to news on July 19, Xiaomi MIX Fold 4, the first flagship folding new phone, was officially released tonight and is equipped with a "three-dimensional special-shaped battery" for the first time. According to reports, Xiaomi MIX Fold4 has achieved a major breakthrough in battery technology and designed an innovative "three-dimensional special-shaped battery" specifically for folding screens. Traditional folding screen devices mostly use conventional square batteries, which have low space utilization efficiency. In order to solve this problem, Xiaomi did not use the common winding battery cells, but developed a new lamination process to create a new form of battery, which greatly improved the space utilization. Battery Technology Innovation In order to accurately alternately stack positive and negative electrode sheets and ensure the safe embedding of lithium ions, Xiaomi has developed a new ultrasonic welding machine and lamination machine to improve welding and cutting accuracy.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

According to news on May 13, vivoX100s was officially released tonight. In addition to excellent images, the new phone also performs very well in terms of signal. According to vivo’s official introduction, vivoX100s uses an innovative universal signal amplification system, which is equipped with up to 21 antennas. This design has been re-optimized based on the direct screen to balance many signal requirements such as 5G, 4G, Wi-Fi, GPS, and NFC. This makes vivoX100s the mobile phone with the strongest signal reception capability in vivo’s history. The new phone also uses a unique 360° surround design, with antennas distributed around the body. This design not only enhances the signal strength, but also optimizes various daily holding postures to avoid problems caused by improper holding methods.

According to news on July 29, the Honor X60i mobile phone is officially on sale today, starting at 1,399 yuan. In terms of design, the Honor X60i mobile phone adopts a straight screen design with a hole in the center and almost unbounded ultra-narrow borders on all four sides, which greatly broadens the field of view. Honor X60i parameters Display: 6.7-inch high-definition display Battery: 5000mAh large-capacity battery Processor: Dimensity 6080 processor (TSMC 6nm, 2x2.4G A76+6×2G A55) System: MagicOS8.0 system Other features: 5G signal enhancement, smart capsule, under-screen fingerprint, dual MIC, noise reduction, knowledge Q&A, photography capabilities: rear dual camera system: 50 million pixels main camera, 2 million pixels auxiliary lens, front selfie lens: 8 million pixels, price: 8GB
