March towards Architecture Technology --- practice redis (1), --- redis
How a website faces the pressure of high capacity and high concurrency is something architects need to study. Although my current work station has not reached this level, some preparations should begin. The plan for us is from half a year to one year, complete the architecture design of high-capacity and high-concurrency systems. Start with redis.
First, you have to prepare a high-record data sample, but there is no ready-made data in hand, so you have to retrieve it from the SMS System. The SMS System uses MSSQL and first needs to import it to MYSQL, I used mss2sql, which is: Explain.
Next, we installed redis and installed version 2.4 in windows. We were ready to import the table from MYSQL to redis. We found that there was an article on the Internet to introduce the export method: http://www.oschina.net/translate/mysql-to-redis-in-one-step "One step to complete MySQL to Redis migration, found in windows always prompt
G: \ redis-2.4.5-win32-win64 \ 64bit> redis-cli -- pipe
(Error) ERR unknown command '-- pipe'
In the first place, I thought it was the reason for windows. Then I prepared a centos VM. I tried some nginx + php + mysq environments and found that the above error was prompted when I installed redis, in the end, I used redis2.4 in both windows and linux. Now I have used version 2.6 and version 2.8, so upgrade it. Found that the highest version of the yum library is only 2.4, that only manually installed: http://www.redis.io/download
$ wget http://download.redis.io/releases/redis-2.8.14.tar.gz$ tar xzf redis-2.8.14.tar.gz$ cd redis-2.8.14$ make
Prompt GCC forgot to install, continue tamping, refer to: http://xueliang1yi.blog.163.com/blog/static/1145570162012102114635764/
1. gcc is useless when an error is reported
Installation Process
Yum install cpp
Yum install binutils
Yum install glibc
Yum install glibc-kernheaders
Yum install glibc-common
Yum install glibc-devel
Yum install gcc
Yum install make
Note that gcc depends on a lot of things. Some Packages may have been installed in the system, and some may not, so it is best to go through it to prevent exceptions.
2. Error 2: No tcl8.5. Install tcl8.5 as follows:
: Http://downloads.sourceforge.net/tcl/tcl8.5.10-src.tar.gz
Installation Process
Tar-zxvf tcl8.5.tar.gz
./Configure
Make
Make install
3. Install redis
Make
Make test // check to see if there is any problem
Make install
If make continues to report an error, the information is as follows: error: jemalloc/jemalloc. h: No such file or directory
Execute make MALLOC = libc.
Note that in order to prevent exceptions, if make fails, clean up and execute make clean
In this way, redis2.8 is installed. You can also run mysql-u root-pxxx database name -- skip-column-names -- raw <events_to_redis. SQL | redis-cli -- pipe
Other references:
Redis Application Scenario: http://blog.csdn.net/hguisu/article/details/8836819
Phpredis Chinese manual-redis Chinese manual php: http://www.cnblogs.com/zcy_soft/archive/2012/09/21/2697006.html
Key Value Design of Redis Database: http://blog.nosqlfan.com/html/3033.html
Nosql application scenario -- using redis to build a fake twitter: http://blog.csdn.net/exsuns/article/details/6358414 http://www.cnblogs.com/jackluo/archive/2013/06/27/3158974.html
What can be done by a good System Architect?
The System Architect is responsible for designing the overall architecture of the system. Every detail from the requirement to the design should be taken into account. The whole project should be grasped to make the design project as efficient as possible, easy to develop, easy to maintain, and easy to upgrade, and so on.
Responsibilities of System Architects:
1. Understand the business needs of the system and formulate the overall system framework (including technical and business frameworks)
2. Train System Framework-related technologies and businesses to guide developers in development. It also solves various problems in system development and operation. Purpose of the System Architect:
System-level understanding of system reuse, expansion, security, performance, scalability, and conciseness. System Architect capability requirements:
I. Knowledge and experience in system architecture.
2. strong self-learning, analysis, and problem solving skills.
Iii. Writing, communication, and training.
Role
Software Architect Definition
Roles and responsibilities in the global analysis design and implementation of the system and in charge of software architecture and key technical decisions
L. lead and coordinate technical activities (analysis, design and implementation) throughout the project 2. Promote major technical decisions, and ultimately expressed as the software architecture 3. The relative architecture of the identified and documented systems is significant, including system requirements, design, implementation, deployment, and other "views" 4. Determine the grouping of design elements and the interfaces between these main groups 5. provide rules for technical decision-making, balance the different concerns of various stakeholders and resolve technical risks, ensure that relevant decisions are effectively communicated and implemented. 6. Understand, evaluate, and receive system requirements. 7. Evaluate and confirm the implementation of software architecture.
L. Comprehensive Technology, mature practice, strong insight, rich experience, and ability to quickly grasp the key points of a problem in the absence of complete information, numerous problems intertwined, fuzzy and contradictory situations, ability to make reasonable key decisions l. strategic and forward-looking thinking ability, good at grasping the global situation, able to think at a higher abstraction level; l. have experience in all the problem fields involved in project development, including a thorough understanding of project requirements and carrying out software engineering activities such as analysis and design. 2. Have the quality of leadership, to promote technical work among various groups and make reliable key decisions under project pressure. 3. excellent communication skills for activities such as persuasion, encouragement and guidance, win the trust of the project members. 4. Focus on the project results in a goal-oriented and proactive manner without any emotion. The architect should be the technical driving force behind the project, not the thinker or dreamer (pursuing perfection) 5. proficient in the theories, practices, and tools of architectural design, master a variety of reference architectures, Major Reusable Architecture mechanisms and models (such as the J2EE architecture); 6. Have all the skills of the system designer, but have a wider scope and a higher abstraction level; Activity
Determine the priority of use cases or requirements, perform Architecture Analysis, create Architecture concept verification prototypes, evaluate Architecture concept verification prototype feasibility, organize system implementation models, describe system distribution structures, and describe Runtime architecture, design mechanism identification, design elements identification, and integration of existing design element artifacts
Software Architecture documentation, reference architecture, analysis model, design model, implementation model, deployment model, Architecture concept verification prototype, interface, event, signal and Protocol System Architect
I want to use mysql + redis in combination with Weibo's system architecture. I would like to ask how to do this.
Write Data to Redis, and then write a script to run cron to read the memory and write data to the database.
There are other methods