Home Database Mysql Tutorial 大型信息化建设标准基础数据管理平台

大型信息化建设标准基础数据管理平台

Jun 07, 2016 pm 05:42 PM
Informatization Base Large platform construction Data management standard

实际情况: 1:当公司的网站访问量达到每天几十万IP时,网站服务器的压力就非常大,一个非常简单的程序,相邻的2个sql语句,在服务器繁忙时,可能会过3-5分钟才能运行完毕,甚至更长时间。服务器的硬件配置也已经足够高了,这时候几乎无法靠平常的数据库的读

   

   实际情况:

     1:当公司的网站访问量达到每天几十万IP时,网站服务器的压力就非常大,一个非常简单的程序,相邻的2个sql语句,在服务器繁忙时,可能会过3-5分钟才能运行完毕,甚至更长时间。服务器的硬件配置也已经足够高了,这时候几乎无法靠平常的数据库的读写,数据库的优化来提高程序的性能的。

     2:硬盘的转速是有限的,当数据库量已经很大时,数据库读取数据也耗费很多时间。而且加硬盘相对比加内存条更复杂一些。

     3:当数据库的索引优化,分区优化都已经用完了,数据库的结构也不能随便修改时,靠数据库优化的就遇到了瓶颈了。

     4:现在内存都比较便宜,服务器上把能插内存条的地方都可以插满了,但是系统往往不会用掉所有的内存,内存空间还是可以有富足。

     5:虽然也可以用很多第3方组件来达到优化的目的,但是需要有学习成本,有采购成本,再有后期的维护成本,服务器的性能同样也是增加压力。

     6:目前服务器的压力已经快崩溃了,也比较难提升性能时,再有比较复杂的权限计算,每刷新一个页面时,还判断10次8次以上操作权限项目,需要更多的I/O时,很可能系统就真的彻底崩溃了。

     7:当然我们可以在另外购买服务器,把程序的压力进行分担,但是我们假设不购买硬件了,数据库也必须需要用同一个,从同一个服务器上的数据库需要读取数据。

 

   在上面的程序环境下,就是老顽固也需要转变思维了。

   1:老顽固都比较难转变思想:

        因为事实摆在眼前,就是老顽固也必须接纳缓存的做法了,虽然缓存有时候很折磨人,但是不靠缓存已经很难解决问题了。虽然以前有很多人给我过这样的建议,都没放在心上。

      

   2:程序的及时性思维的转变:

      以前写程序都强调,数据设置发生了变化程序能马上显示出来效果,例如修改了某个人的权限设置后,马上就生效了。其实有时候没必要那么马上生效。有必要时刷新一下缓存,若没必要用户下次登录时就生效了,顶多若有问题用户再登录一次就可以了,权限设置又不是每时每刻都在设置的,很多时候设置好了,半年一年都不用设置,没必要过分强调实时性。

     其实程序员都有过度设计的问题,用户权限方面,我也的确是想的有些过度了,其实稍微放宽一下,也能满足正常的日常使用的,顶多加个刷新缓存的功能,若有必要马上见效就马上刷洗一下缓存就可以了。

   

  3:在不提高,就倍很多年轻人彻底超越了:

  明显感觉到身边的年轻人又聪明又能干,这时候自己再不提高,很容易就彻底走下坡路了。虽然难起领头羊的作用,但是至少不要被大家彻底甩在后面去了。

 

   4:马上动手改进程序:

     有了想法了就需要马上动手,架构良好的程序都经得起重构才对,所以一直认为自己的程序架构是非常良好的,那就应该能经得起修改才对,香港服务器,架构好的程序应该不是全盘推倒从来,而是小修改几个函数就应该能达到内存缓存的目的。

 

   5:新系统要上线要靠谱的测试确认:

     程序更新上去后,网站空间,前后至少要测试1周,各种功能都稳定,数据都正确才能正式投入实际实用。

 

    

吉日嘎拉,通用权限管理系统组件

 

   接着就是程序修改的部分:

       其实总共就写了300行不到的代码,系统的本质的改造就完成了。

       1:用户能访问的模块菜单,用户拥有的操作权限项,改进为泛型。

           protected List ModuleList

           protected List PermissionItemList

       2:当用户需要判断权限时,一次性把权限读取到Cache缓存中。

       3:权限判断函数改进为从内存Cache缓存进行判断。

       4:用户退出时,把相应的内存缓存清除掉,减轻内存的压力。

       5:写个刷新缓存的功能,有需要时,对所有的缓存进行实时的刷新。

 

       有时候代码也就300行不到还有一大堆是注释,有一大堆是没用的,还有一大堆是重复的,真正有价值的代码可能不超过50行,网站空间,但是里面有蛮多故事,有故事的代码更有生命力,有故事的代码就更有卖点,有故事的代码经常更经得起考验,欢迎大家拍砖,大家一起学习提高,在交流中不断修正代码,不断提高自己,不断改进错误,一天比一天强大。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the empty account detection platforms? Empty number detection tool What are the empty account detection platforms? Empty number detection tool Mar 07, 2024 pm 01:46 PM

With the advancement of communication technology, telephone contact has become more and more common in our daily lives. However, sometimes we may try to call a number only to find that the number is no longer reachable. In order to save time and energy, many people start looking for empty number verification services to confirm the validity of the number. This service can help users quickly check whether a number is valid and avoid unnecessary trouble. 1. What are the empty account detection platforms? Users can check the status of the number, including whether it is empty, by dialing the corresponding inquiry number or visiting the official website through the official inquiry service provided by the operator. This service is provided by many operators to facilitate users to quickly understand the usage of the number. Online empty number detection platforms are now emerging in an endless stream on the market. These platforms provide quick and convenient

Where can I buy Optimism coins? Which platform is Optimism Coin traded on? Where can I buy Optimism coins? Which platform is Optimism Coin traded on? Feb 28, 2024 pm 04:40 PM

Where can I buy Optimism coins? Optimism Coin can be purchased on a number of cryptocurrency exchanges, including: Binance Huobi OKX Matcha Gate.io Kraken Bittrex Poloniex Coinbase Pro Gemini You will need to register an account with these exchanges and complete identity verification before you can purchase Optimism Coin. The steps to purchase Optimism coins are as follows: Choose a safe and reliable exchange. Register an account and complete identity verification. Fund your account. On the trading interface of the trading platform, find the trading pair of Optimism currency, such as OP/USDT. Enter the amount of Optimism coins you want to purchase and click

Where can I buy EC coins? On which platform are EC coins traded? Where can I buy EC coins? On which platform are EC coins traded? Feb 27, 2024 pm 04:49 PM

Where can I buy EC coins? On which platform are EC coins traded? Text: EC coin (Ethereum Classic, abbreviation: ETC) is an open source, decentralized blockchain platform and the first hard fork currency of Ethereum. EC Coin has a similar technical foundation to Ethereum, but there are also some key differences. For example, EC Coin has a shorter block time and does not use the Proof of Stake (PoS) consensus mechanism. EC coins can be purchased on many cryptocurrency trading platforms, including: Centralized exchanges: Binance, Huobi, OKX, Matcha, Gate.io, Kraken, Bittrex, Poloniex, etc. Decentralized exchanges: PancakeSwap, Uniswap, Su

Data Management with React Query and Databases: A Best Practices Guide Data Management with React Query and Databases: A Best Practices Guide Sep 27, 2023 pm 04:13 PM

Data Management with ReactQuery and Databases: A Best Practice Guide Introduction: In modern front-end development, managing data is a very important task. As users' demands for high performance and stability continue to increase, we need to consider how to better organize and manage application data. ReactQuery is a powerful and easy-to-use data management tool that provides a simple and flexible way to handle the retrieval, update and caching of data. This article will introduce how to use ReactQ

How to build European and American websites How to build European and American websites Jan 18, 2024 am 10:13 AM

Construction steps: 1. Determine the theme and purpose of the site; 2. Analyze user needs and behaviors; 3. Determine the design style of the website; 4. Purchase the domain name and space; 5. Install the website system; 6. Design the website interface; 7. Fill the website content; 8. Test the website; 9. Promote the website.

Effective ways to prevent Localstorage data loss Effective ways to prevent Localstorage data loss Jan 13, 2024 am 10:25 AM

How to avoid Localstorage data loss? With the development of web applications, data persistence has become an important issue. Localstorage is a very commonly used data persistence solution provided by browsers. However, data stored in LocalStorage may be lost due to various reasons. This article will introduce several methods to avoid LocalStorage data loss and provide specific code examples. 1. Back up data regularly. Backing up data regularly is the key to avoid Lo

Where to buy MEME coins? Which platform does MEME coin trade on? Where to buy MEME coins? Which platform does MEME coin trade on? Feb 28, 2024 am 09:50 AM

MEME Coin Buying Guide What is MEME Coin? MEME coin is a cryptocurrency based on Internet memes, often with community support and social media attention. The price of MEME coins fluctuates greatly and speculative sentiment is prominent. Investors need to be cautious. Where to buy MEME coins? MEME coins can be purchased on centralized exchanges and decentralized exchanges. Centralized exchange: Binance Huobi OKX MatchaGate.ioKrakenBittrexPoloniex Decentralized exchange: PancakeSwapUniswapSushiswapMEME coin purchase stepsSelect a trading platformRegister an accountRecharge fundsBuy MEME coinsWithdraw MEME coinsNotes MEME coins

How will AI enhance platform engineering and DevEx? How will AI enhance platform engineering and DevEx? Oct 31, 2023 pm 08:13 PM

Author | Heather Joslyn Please rewrite the following content into Chinese: Xingxuan For many companies adopting DevOps, scaling and creating value by increasing developer productivity is a huge challenge. In this article, we discuss the latest AI-driven approaches in platform engineering. 1. AI-driven DevOps platform Digital.ai is an industry-leading AI-driven technology company dedicated to helping global enterprises achieve digital transformation. Its customers include large enterprises: financial institutions, insurance organizations and gaming companies. One of the biggest problems they face is scale. Today I want to reveal to you how the DevOps platform in an AI-driven company is implemented. Of course, according to

See all articles