ÓÖÅÄÍøÊÇÒ»¸öÕÕƬ·ÖÏíÉçÇø£¬´Ó2005Äê6ÔÂÖÁ½ñ»ýÀÛÁË260ÍòÓû§£¬1.1ÒÚÕÅÕÕƬ£¬Ä¿Ç°µÄÈÕ·ÃÎÊÁ¿Îª200¶àÍò¡£ 5ÄêµÄ·¢Õ¹Àú³ÌÀï¾Àú¹ýÐí¶àÆð·ü£¬Ò²»ýÀÛÁËһЩ¾Ñ飬ÔÚÕâƪÎÄÕÂÀÎÒÒª½éÉÜһЩÎÒÃÇÔÚ¼¼ÊõÉϵĻýÀÛ¡£
ÓÖÅĺʹó¶àÊýWeb2.0Õ¾µãÒ»Ñù£¬¹¹½¨ÓÚ´óÁ¿¿ªÔ´Èí¼þÖ®ÉÏ£¬°üÀ¨MySQL, PHP, nginx, Python, memcached, redis, Solr, Hadoop, RabbitMQµÈµÈ¡£
ÓÖÅĵķþÎñÆ÷¶Ë¿ª·¢ÓïÑÔÖ÷ÒªÊÇPHPºÍPython, PHPÓÃÓÚ±àдWebÂß¼(ͨ¹ýHTTPºÍÓû§Ö±½Ó´ò½»µÀ)£¬ ¶øPythonÔòÖ÷ÒªÓÃÓÚ¿ª·¢ÄÚ²¿·þÎñºÍºǫ́ÈÎÎñ¡£¶øÔÚ¿Í»§¶ËʹÓÃÁË´óÁ¿µÄJavascript£¬ Òª¸ÐлһÏÂMooToolsÕâ¸öJS¿ò¼ÜʹµÃÎÒÃǺÜÏíÊÜÇ°¶Ë¿ª·¢¹ý³Ì¡£ ÁíÍ⣬ÎÒÃÇ°ÑͼƬ´¦Àí¹ý³Ì´ÓPHP½ø³ÌÀï¶ÀÁ¢³öÀ´±ä³ÉÒ»¸ö·þÎñ¡£ Õâ¸ö·þÎñ»ùÓÚnginx, ×÷ΪnginxµÄÒ»¸öÄ£¿é¶ø¿ª·ÅREST API¡£
ÓÉÓÚPHPµÄµ¥Ïß³ÌÄ£ÐÍ£¬ÎÒÃǰѺÄʱ½Ï¾ÃµÄÔËËãºÍI/O²Ù×÷´ÓHTTPÇëÇóÖÜÆÚÖзÖÀë³öÀ´£¬ ½»¸øÓÉPythonʵÏÖµÄÈÎÎñ½ø³ÌÀ´Íê³É£¬ÒÔ±£Ö¤ÇëÇóÏìÓ¦Ëٶȡ£ ÕâЩÈÎÎñÖ÷Òª°üÀ¨£ºÓʼþ·¢ËÍ£¬Êý¾ÝË÷Òý£¬Êý¾Ý¾ÛºÏ£¬ºÃÓѶ¯Ì¬ÍÆËÍ£¨ÉÔºò»áÓнéÉÜ£©µÈµÈ¡£ ͨ³£ÕâЩÈÎÎñÓÉÓû§´¥·¢£¬²¢ÇÒ£¬Óû§µÄÒ»¸öÐÐΪ¿ÉÄܻᴥ·¢¶àÖÖÈÎÎñµÄÖ´ÐС£ ±ÈÈ磬Óû§ÉÏ´«ÁËÒ»ÕÅеÄÕÕƬ£¬ÎÒÃÇÐèÒª¸üÐÂË÷Òý£¬Ò²ÐèÒªÏòËûµÄÅóÓÑÍÆËÍÒ»ÌõеĶ¯Ì¬¡£PHPͨ¹ýÏûÏ¢¶ÓÁУ¨ÎÒÃÇÓõÄÊÇRabbitMQ£©À´´¥·¢ÈÎÎñÖ´ÐС£
Êý¾Ý¿âÒ»ÏòÊÇÍøÕ¾¼Ü¹¹ÖÐ×î¾ßÌôÕ½ÐԵģ¬Æ¿¾±Í¨³£³öÏÖÔÚÕâÀï¡£ÓÖÅÄÍøµÄÕÕƬÊý¾ÝÁ¿ºÜ´ó£¬ Êý¾Ý¿âÒ²¼¸¶È³öÏÖÑÏÖصÄѹÁ¦ÎÊÌâ¡£Òò´Ë£¬ÕâÀïÎÒÖ÷Òª½éÉÜÒ»ÏÂÓÖÅÄÍøÔÚ·Ö¿âÉè¼ÆÕâ·½ÃæµÄһЩ³¢ÊÔ¡£
·Ö¿âÉè¼Æ
ºÍºÜ¶àʹÓÃMySQLµÄ2.0Õ¾µãÒ»Ñù£¬ÓÖÅÄÍøµÄMySQL¼¯Èº¾ÀúÁË´Ó×î³õµÄÒ»¸öÖ÷¿âÒ»¸ö´Ó¿â¡¢µ½Ò»¸öÖ÷¿â¶à¸ö´Ó¿â¡¢ È»ºóµ½¶à¸öÖ÷¿â¶à¸ö´Ó¿âµÄÒ»¸ö·¢Õ¹¹ý³Ì¡£
×î³õÊÇÓÉһ̨Ö÷¿âºÍһ̨´Ó¿â×é³É£¬µ±Ê±´Ó¿âÖ»ÓÃ×÷±¸·ÝºÍÈÝÔÖ£¬µ±Ö÷¿â³öÏÖ¹ÊÕÏʱ£¬´Ó¿â¾ÍÊÖ¶¯±ä³ÉÖ÷¿â£¬Ò»°ãÇé¿öÏ£¬ ´Ó¿â²»×÷¶Áд²Ù×÷(ͬ²½³ýÍâ)¡£Ëæ×ÅѹÁ¦µÄÔö¼Ó£¬ÎÒÃǼÓÉÏÁËmemcached£¬µ±Ê±Ö»ÓÃÆ仺´æµ¥ÐÐÊý¾Ý¡£µ«ÊÇ£¬ µ¥ÐÐÊý¾ÝµÄ»º´æ²¢²»ÄܺܺõĽâ¾öѹÁ¦ÎÊÌ⣬ÒòΪµ¥ÐÐÊý¾ÝµÄ²éѯͨ³£ºÜ¿ì¡£ËùÒÔÎÒÃÇ°ÑһЩʵʱÐÔÒªÇ󲻸ߵÄQuery·Åµ½´Ó¿âÈ¥Ö´ÐС£ ºóÃæÓÖͨ¹ýÌí¼Ó¶à¸ö´Ó¿âÀ´·ÖÁ÷²éѯѹÁ¦£¬²»¹ýËæ×ÅÊý¾ÝÁ¿µÄÔö¼Ó£¬Ö÷¿âµÄдѹÁ¦Ò²Ô½À´Ô½´ó¡£
Ôڲο¼ÁËһЩÏà¹Ø²úÆ·ºÍÆäËüÍøÕ¾µÄ×ö·¨ºó£¬ÎÒÃǾö¶¨½øÐÐÊý¾Ý¿â²ð·Ö¡£Ò²¾ÍÊǽ«Êý¾Ý´æ·Åµ½²»Í¬µÄÊý¾Ý¿â·þÎñÆ÷ÖУ¬ Ò»°ã¿ÉÒÔ°´Á½¸öγ¶ÈÀ´²ð·ÖÊý¾Ý:
-
´¹Ö±²ð·Ö
ÊÇÖ¸°´¹¦ÄÜÄ£¿é²ð·Ö£¬±ÈÈç¿ÉÒÔ½«Èº×éÏà¹Ø±íºÍÕÕƬÏà¹Ø±í´æ·ÅÔÚ²»Í¬µÄÊý¾Ý¿âÖУ¬ÕâÖÖ·½Ê½¶à¸öÊý¾Ý¿âÖ®¼äµÄ±í½á¹¹²»Í¬¡£
-
ˮƽ²ð·Ö
¶øˮƽ²ð·ÖÊǽ«Í¬Ò»¸ö±íµÄÊý¾Ý½øÐзֿ鱣´æµ½²»Í¬µÄÊý¾Ý¿âÖУ¬ÕâЩÊý¾Ý¿âÖеıí½á¹¹ÍêÈ«Ïàͬ¡£
²ð·Ö·½Ê½
Ò»°ã¶¼»áÏȽøÐд¹Ö±²ð·Ö£¬ÒòΪÕâÖÖ·½Ê½²ð·Ö·½Ê½ÊµÏÖÆðÀ´±È½Ï¼òµ¥£¬¸ù¾Ý±íÃû·ÃÎʲ»Í¬µÄÊý¾Ý¿â¾Í¿ÉÒÔÁË¡£ µ«ÊÇ´¹Ö±²ð·Ö·½Ê½²¢²»Äܳ¹µ×½â¾öËùÓÐѹÁ¦ÎÊÌ⣬ÁíÍ⣬ҲҪ¿´Ó¦ÓÃÀàÐÍÊÇ·ñºÏÊÊÕâÖÖ²ð·Ö·½Ê½¡£ Èç¹ûºÏÊʵĻ°£¬Ò²ÄܺܺõÄÆðµ½·ÖÉ¢Êý¾Ý¿âѹÁ¦µÄ×÷ÓᣱÈÈç¶ÔÓÚ¶¹°êÎÒ¾õµÃ±È½ÏÊʺϲÉÓô¹Ö±²ð·Ö£¬ ÒòΪ¶¹°êµÄ¸÷ºËÐÄÒµÎñ/Ä£¿é(Êé¼®¡¢µçÓ°¡¢ÒôÀÖ)Ïà¶Ô¶ÀÁ¢£¬Êý¾ÝµÄÔö¼ÓËÙ¶ÈÒ²±È½ÏƽÎÈ¡£ ²»Í¬µÄÊÇ£¬ÓÖÅÄÍøµÄºËÐÄÒµÎñ¶ÔÏóÊÇÓû§ÉÏ´«µÄÕÕƬ£¬¶øÕÕƬÊý¾ÝµÄÔö¼ÓËÙ¶ÈËæ×ÅÓû§Á¿µÄÔö¼ÓÔ½À´Ô½¿ì¡£ ѹÁ¦»ù±¾É϶¼ÔÚÕÕƬ±íÉÏ£¬ÏÔÈ»´¹Ö±²ð·Ö²¢²»ÄÜ´Ó¸ù±¾ÉϽâ¾öÎÒÃǵÄÎÊÌ⣬ËùÒÔ£¬ÎÒÃDzÉÓÃˮƽ²ð·ÖµÄ·½Ê½¡£
²ð·Ö¹æÔò
ˮƽ²ð·ÖʵÏÖÆðÀ´Ïà¶Ô¸´ÔÓ£¬ÎÒÃÇÒªÏÈÈ·¶¨Ò»¸ö²ð·Ö¹æÔò£¬Ò²¾ÍÊÇ°´Ê²Ã´Ìõ¼þ½«Êý¾Ý½øÐÐÇз֡£ Ò»°ã2.0ÍøÕ¾¶¼ÒÔÓû§ÎªÖÐÐÄ£¬Êý¾Ý»ù±¾¶¼¸úËæÓû§£¬±ÈÈçÓû§µÄÕÕƬ£¬ÅóÓѺÍÆÀÂ۵ȵȡ£ Òò´ËÒ»¸ö±È½Ï×ÔÈ»µÄÑ¡ÔñÊǸù¾ÝÓû§À´Çз֡£Ã¿¸öÓû§¶¼¶ÔÓ¦Ò»¸öÊý¾Ý¿â£¬·ÃÎÊij¸öÓû§µÄÊý¾Ýʱ£¬ ÎÒÃÇÒªÏÈÈ·¶¨Ëû/ËýËù¶ÔÓ¦µÄÊý¾Ý¿â£¬È»ºóÁ¬½Óµ½¸ÃÊý¾Ý¿â½øÐÐʵ¼ÊµÄÊý¾Ý¶Áд¡£
ÄÇô£¬ÔõôÑù¶ÔÓ¦Óû§ºÍÊý¾Ý¿âÄØ? ÎÒÃÇÓÐÕâЩѡÔñ£º
-
°´Ëã·¨¶ÔÓ¦
×î¼òµ¥µÄËã·¨ÊÇ°´Óû§IDµÄÆæżÐÔÀ´¶ÔÓ¦£¬½«ÆæÊýIDµÄÓû§¶ÔÓ¦µ½Êý¾Ý¿âA, ¶øżÊýIDµÄÓû§Ôò¶ÔÓ¦µ½Êý¾Ý¿âB¡£ Õâ¸ö·½·¨µÄ×î´óÎÊÌâÊÇ£¬Ö»ÄÜ·Ö³ÉÁ½¸ö¿â¡£ ÁíÒ»¸öËã·¨ÊÇ°´Óû§IDËùÔÚÇø¼ä¶ÔÓ¦£¬±ÈÈçIDÔÚ0-10000Ö®¼äµÄÓû§¶ÔÓ¦µ½Êý¾Ý¿âA, IDÔÚ10000-20000Õâ¸ö·¶Î§µÄ¶ÔÓ¦µ½Êý¾Ý¿âB£¬ÒÔ´ËÀàÍÆ¡£ °´Ëã·¨·ÖʵÏÖÆðÀ´±È½Ï·½±ã£¬Ò²±È½Ï¸ßЧ£¬ µ«ÊDz»ÄÜÂú×ãºóÐøµÄÉìËõÐÔÒªÇó£¬Èç¹ûÐèÒªÔö¼ÓÊý¾Ý¿â½Úµã£¬±ØÐèµ÷ÕûËã·¨»òÒƶ¯ºÜ´óµÄÊý¾Ý¼¯£¬ ±È½ÏÄÑ×öµ½ÔÚ²»Í£Ö¹·þÎñµÄÇ°ÌáϽøÐÐÀ©³äÊý¾Ý¿â½Úµã¡£
-
°´Ë÷Òý/Ó³Éä±í¶ÔÓ¦
ÕâÖÖ·½·¨ÊÇÖ¸½¨Á¢Ò»¸öË÷Òý±í£¬±£´æÿ¸öÓû§µÄIDºÍÊý¾Ý¿âIDµÄ¶ÔÓ¦¹Øϵ£¬Ã¿´Î¶ÁдÓû§Êý¾ÝʱÏÈ´ÓÕâ¸ö±í»ñÈ¡¶ÔÓ¦Êý¾Ý¿â¡£ ÐÂÓû§×¢²áºó£¬ÔÚËùÓпÉÓõÄÊý¾Ý¿âÖÐËæ»úÌôÑ¡Ò»¸öΪÆ佨Á¢Ë÷Òý¡£ÕâÖÖ·½·¨±È½ÏÁé»î£¬ÓкܺõÄÉìËõÐÔ¡£ Ò»¸öȱµãÊÇÔö¼ÓÁËÒ»´ÎÊý¾Ý¿â·ÃÎÊ£¬ËùÒÔÐÔÄÜÉÏûÓа´Ëã·¨¶ÔÓ¦ºÃ¡£
ÎÒÃDzÉÓõÄÊÇË÷Òý±íµÄ·½Ê½£¬ÎÒÃÇÔ¸ÒâΪÆäÁé»îÐÔËðʧһЩÐÔÄÜ£¬¸üºÎ¿öÎÒÃÇ»¹ÓÐmemcached£¬ ÒòΪË÷ÒýÊý¾Ý»ù±¾²»»á¸Ä±äµÄÔµ¹Ê£¬»º´æÃüÖÐÂʷdz£¸ß¡£ËùÒÔÄܴܺó³Ì¶ÈÉϼõÉÙÁËÐÔÄÜËðʧ¡£
Ë÷Òý±íµÄ·½Ê½Äܹ»±È½Ï·½±ãµØÌí¼ÓÊý¾Ý¿â½Úµã£¬ÔÚÔö¼Ó½Úµãʱ£¬Ö»Òª½«ÆäÌí¼Óµ½¿ÉÓÃÊý¾Ý¿âÁбíÀï¼´¿É¡£ µ±È»Èç¹ûÐèҪƽºâ¸÷¸ö½ÚµãµÄѹÁ¦µÄ»°£¬»¹ÊÇÐèÒª½øÐÐÊý¾ÝµÄǨÒÆ£¬µ«ÊÇÕâ¸öʱºòµÄǨÒÆÊÇÉÙÁ¿µÄ£¬¿ÉÒÔÖð²½½øÐС£ ҪǨÒÆÓû§AµÄÊý¾Ý£¬Ê×ÏÈÒª½«Æä״̬ÖÃΪǨÒÆÊý¾ÝÖУ¬Õâ¸ö״̬µÄÓû§²»ÄܽøÐÐд²Ù×÷£¬²¢ÔÚÒ³ÃæÉϽøÐÐÌáʾ¡£ È»ºó½«Óû§AµÄÊý¾ÝÈ«²¿¸´ÖƵ½ÐÂÔö¼ÓµÄ½ÚµãÉϺ󣬸üÐÂÓ³Éä±í£¬È»ºó½«Óû§AµÄ״̬ÖÃΪÕý³££¬ ×îºó½«ÔÀ´¶ÔÓ¦µÄÊý¾Ý¿âÉϵÄÊý¾Ýɾ³ý¡£Õâ¸ö¹ý³Ìͨ³£»áÔÚÁÙ³¿½øÐУ¬ËùÒÔ£¬ËùÒÔºÜÉÙ»áÓÐÓû§Åöµ½Ç¨ÒÆÊý¾ÝÖеÄÇé¿ö¡£
µ±È»£¬ÓÐЩÊý¾ÝÊDz»ÊôÓÚij¸öÓû§µÄ£¬±ÈÈçϵͳÏûÏ¢¡¢ÅäÖõȵȣ¬ÎÒÃÇ°ÑÕâЩÊý¾Ý±£´æÔÚÒ»¸öÈ«¾Ö¿âÖС£
ÎÊÌâ
·Ö¿â»á¸øÄãÔÚÓ¦ÓõĿª·¢ºÍ²¿ÊðÉ϶¼´øÀ´ºÜ¶àÂé·³¡£
-
²»ÄÜÖ´Ðпç¿âµÄ¹ØÁª²éѯ
Èç¹ûÎÒÃÇÐèÒª²éѯµÄÊý¾Ý·Ö²¼ÓÚ²»Í¬µÄÊý¾Ý¿â£¬ÎÒÃÇû°ì·¨Í¨¹ý
JOIN
µÄ·½Ê½²éѯ»ñµÃ¡£ ±ÈÈçÒª»ñµÃºÃÓѵÄ×îÐÂÕÕƬ£¬Äã²»Äܱ£Ö¤ËùÓкÃÓѵÄÊý¾Ý¶¼ÔÚͬһ¸öÊý¾Ý¿âÀï¡£ Ò»¸ö½â¾ö°ì·¨ÊÇͨ¹ý¶à´Î²éѯ£¬ÔÙ½øÐоۺϵķ½Ê½¡£ÎÒÃÇÐèÒª¾¡Á¿±ÜÃâÀàËƵÄÐèÇó¡£ ÓÐЩÐèÇó¿ÉÒÔͨ¹ý±£´æ¶à·ÝÊý¾ÝÀ´½â¾ö£¬±ÈÈçUser-A
ºÍUser-B
µÄÊý¾Ý¿â·Ö±ðÊÇDB-1
ºÍDB-2
£¬ µ±User-A
ÆÀÂÛÁËUser-B
µÄÕÕƬʱ£¬ÎÒÃÇ»áͬʱÔÚDB-1
ºÍDB-2
Öб£´æÕâÌõÆÀÂÛÐÅÏ¢£¬ ÎÒÃÇÊ×ÏÈÔÚDB-2
ÖеÄphoto_comments
±íÖвåÈëÒ»ÌõеļǼ£¬È»ºóÔÚDB-1
ÖеÄuser_comments
±íÖвåÈëÒ»ÌõеļǼ¡£ ÕâÁ½¸ö±íµÄ½á¹¹ÈçÏÂͼËùʾ¡£ÕâÑùÎÒÃÇ¿ÉÒÔͨ¹ý²éѯphoto_comments
±íµÃµ½User-B
µÄijÕÅÕÕƬµÄËùÓÐÆÀÂÛ£¬ Ò²¿ÉÒÔͨ¹ý²éѯuser_comments
±í»ñµÃUser-A
µÄËùÓÐÆÀÂÛ¡£ÁíÍâ¿ÉÒÔ¿¼ÂÇʹÓÃÈ«ÎļìË÷¹¤¾ßÀ´½â¾öijЩÐèÇó£¬ ÎÒÃÇʹÓÃSolrÀ´Ìṩȫվ±êÇ©¼ìË÷ºÍÕÕƬËÑË÷·þÎñ¡£
-
²»Äܱ£Ö¤Êý¾ÝµÄÒ»ÖÂ/ÍêÕûÐÔ
¿ç¿âµÄÊý¾ÝûÓÐÍâ¼üÔ¼Êø£¬Ò²Ã»ÓÐÊÂÎñ±£Ö¤¡£±ÈÈçÉÏÃæµÄÆÀÂÛÕÕƬµÄÀý×Ó£¬ ºÜ¿ÉÄܳöÏֳɹ¦²åÈë
photo_comments
±í£¬µ«ÊDzåÈëuser_comments
±íʱȴ³ö´íÁË¡£ Ò»¸ö°ì·¨ÊÇÔÚÁ½¸ö¿âÉ϶¼¿ªÆôÊÂÎñ£¬È»ºóÏȲåÈëphoto_comments
£¬ÔÙ²åÈëuser_comments
£¬ È»ºóÌá½»Á½¸öÊÂÎñ¡£Õâ¸ö°ì·¨Ò²²»ÄÜÍêÈ«±£Ö¤Õâ¸ö²Ù×÷µÄÔ×ÓÐÔ¡£ -
ËùÓвéѯ±ØÐëÌṩÊý¾Ý¿âÏßË÷
±ÈÈçÒª²é¿´Ò»ÕÅÕÕƬ£¬½öƾһ¸öÕÕƬIDÊDz»¹»µÄ£¬»¹±ØÐëÌṩÉÏ´«ÕâÕÅÕÕƬµÄÓû§µÄID(Ò²¾ÍÊÇÊý¾Ý¿âÏßË÷)£¬ ²ÅÄÜÕÒµ½Ëüʵ¼ÊµÄ´æ·ÅλÖá£Òò´Ë£¬ÎÒÃDZØÐëÖØÐÂÉè¼ÆºÜ¶àURLµØÖ·£¬¶øÓÐЩÀϵĵØÖ·ÎÒÃÇÓÖ±ØÐë±£Ö¤ÆäÈÔÈ»ÓÐЧ¡£ ÎÒÃÇ°ÑÕÕƬµØÖ·¸Ä³É
/photos/{username}/{photo_id}/
µÄÐÎʽ£¬È»ºó¶ÔÓÚϵͳÉý¼¶Ç°ÉÏ´«µÄÕÕƬID£¬ ÎÒÃÇÓÖÔö¼ÓÒ»ÕÅÓ³Éä±í£¬±£´æphoto_id
ºÍuser_id
µÄ¶ÔÓ¦¹Øϵ¡£µ±·ÃÎÊÀϵÄÕÕƬµØַʱ£¬ÎÒÃÇͨ¹ý²éѯÕâÕűí»ñµÃÓû§ÐÅÏ¢, È»ºóÔÙÖض¨Ïòµ½ÐµĵØÖ·¡£ -
×ÔÔöID
Èç¹ûÒªÔÚ½ÚµãÊý¾Ý¿âÉÏʹÓÃ×ÔÔö×ֶΣ¬ÄÇôÎÒÃǾͲ»Äܱ£Ö¤È«¾ÖΨһ¡£Õâµ¹²»ÊǺÜÑÏÖصÄÎÊÌ⣬ µ«Êǵ±½ÚµãÖ®¼äµÄÊý¾Ý·¢Éú¹Øϵʱ£¬¾Í»áʹµÃÎÊÌâ±äµÃ±È½ÏÂé·³¡£ÎÒÃÇ¿ÉÒÔÔÙÀ´¿´¿´ÉÏÃæÌáµ½µÄÆÀÂÛµÄÀý×Ó¡£ Èç¹û
photo_comments
±íÖеÄcomment_id
ÊÇ×ÔÔö×ֶΣ¬µ±ÎÒÃÇÔÚDB-2.photo_comments
±í²åÈëеÄÆÀÂÛʱ£¬ µÃµ½Ò»¸öеÄcomment_id
, ¼ÙÈçֵΪ101, ¶øUser-A
µÄIDΪ1, ÄÇôÎÒÃÇ»¹ÐèÒªÔÚDB-1.user_comments
±íÖвåÈë(1, 101 ...)
¡£User-A
ÊǸöºÜ»îÔ¾µÄÓû§£¬ËûÓÖÆÀÂÛÁËUser-C
µÄÕÕƬ£¬¶øUser-C
µÄÊý¾Ý¿âÊÇDB-3
¡£ ºÜÇɵÄÊÇÕâÌõÐÂÆÀÂÛµÄIDÒ²ÊÇ101£¬ÕâÖÖÇé¿öºÜÓпÉÄÜ·¢Éú¡£ÄÇôÎÒÃÇÓÖÔÚDB-1.user_comments
±íÖвåÈëÒ»ÐÐÏñÕâÑù(1, 101 ...)
µÄÊý¾Ý¡£ ÄÇôÎÒÃÇÒªÔõôÉèÖÃuser_comments
±íµÄÖ÷¼üÄØ£¿¿ÉÒÔ²»Éè°¡£¬²»ÐÒµÄÊÇÓеÄʱºò(¿ò¼Ü¡¢»º´æµÈÔÒò)±ØÐèÉèÖá£ÄÇô¿ÉÒÔÒÔuser_id
¡¢comment_id
ºÍphoto_id
Ϊ×éºÏÖ÷¼ü£¬µ«ÊÇphoto_id
Ò²ÓпÉÄÜÒ»Ñù(µÄÈ·ºÜÇÉ)¡£¿´À´Ö»ÄÜÔÙ¼ÓÉÏphoto_owner_id
ÁË£¬ µ«ÊÇÕâ¸ö½á¹ûÈÃÎÒʵÔÚÓеãÎÞ·¨½ÓÊÜ£¬Ì«¸´ÔÓµÄ×éºÏ¼üÔÚÊý¾ÝдÈëʱ»á´øÀ´Ò»¶¨µÄÐÔÄÜÓ°Ïì, ÕâÑùµÄ×ÔÈ»¼ü¿´ÆðÀ´Ò²ºÜ²»×ÔÈ»¡£ ¸üÖØÒªµÄÊÇÎÒÃÇÐèÒªÔÚ½ÚµãÖ®¼äÒƶ¯Êý¾Ý¡£ËùÒÔ£¬ÎÒÃÇ·ÅÆúÁËÔÚ½ÚµãÉÏʹÓÃ×ÔÔö×ֶΣ¬Ïë°ì·¨ÈÃÕâЩID±ä³ÉÈ«¾ÖΨһ¡£ Ϊ´ËÔö¼ÓÁËÒ»¸öרÃÅÓÃÀ´Éú³ÉIDµÄÊý¾Ý¿â£¬Õâ¸ö¿âÖеıí½á¹¹¶¼ºÜ¼òµ¥£¬Ö»ÓÐÒ»¸ö×ÔÔö×Ö¶Îid
¡£ µ±ÎÒÃÇÒª²åÈëеÄÆÀÂÛʱ£¬ÎÒÃÇÏÈÔÚID¿âµÄphoto_comments
±íÀï²åÈëÒ»Ìõ¿ÕµÄ¼Ç¼ÒÔ»ñµÃÒ»¸öΨһµÄÆÀÂÛID¡£ µ±È»ÕâЩÂß¼¶¼ÒѾ·â×°ÔÚÎÒÃǵĿò¼ÜÀïÁË£¬¶ÔÓÚ¿ª·¢ÈËÔ±ÊÇ͸Ã÷µÄ¡£ Ϊʲô²»ÓÃÆäËü·½°¸ÄØ£¬±ÈÈçһЩ֧³Öincr
²Ù×÷µÄKey-ValueÊý¾Ý¿â¡£ÎÒÃÇ»¹ÊDZȽϷÅÐÄ°ÑÊý¾Ý·ÅÔÚMySQLÀï¡£ ÁíÍ⣬ÎÒÃǻᶨÆÚÇåÀíID¿âµÄÊý¾Ý£¬ÒÔ±£Ö¤»ñÈ¡ÐÂIDµÄЧÂÊ¡£
ʵÏÖ
ÎÒÃdzÆÇ°ÃæÌáµ½µÄÒ»¸öÊý¾Ý¿â½ÚµãΪShard
£¬Ò»¸öShard
ÓÉÁ½¸ǫ̈ÎïÀí·þÎñÆ÷×é³É£¬
ÎÒÃdzÆËüÃÇΪNode-A
ºÍNode-B
£¬Node-A
ºÍNode-B
Ö®¼äÊÇÅäÖóÉMaster-Master
Ï໥¸´ÖƵġ£
ËäÈ»ÊÇMaster-Master
µÄ²¿Êð·½Ê½£¬µ«ÊÇͬһʱ¼äÎÒÃÇ»¹ÊÇֻʹÓÃÆäÖÐÒ»¸ö£¬ÔÒòÊǸ´ÖƵÄÑÓ³ÙÎÊÌ⣬
µ±È»ÔÚWebÓ¦ÓÃÀÎÒÃÇ¿ÉÒÔÔÚÓû§»á»°Àï·ÅÖÃÒ»¸öA
»òB
À´±£Ö¤Í¬Ò»Óû§Ò»´Î»á»°ÀïÖ»·ÃÎÊÒ»¸öÊý¾Ý¿â£¬
ÕâÑù¿ÉÒÔ±ÜÃâһЩÑÓ³ÙÎÊÌâ¡£µ«ÊÇÎÒÃǵÄPythonÈÎÎñÊÇûÓÐÈκÎ״̬µÄ£¬²»Äܱ£Ö¤ºÍPHPÓ¦ÓöÁдÏàͬµÄÊý¾Ý¿â¡£
ÄÇôΪʲô²»ÅäÖóÉMaster-Slave
ÄØ£¿ÎÒÃǾõµÃÖ»ÓÃһ̨̫ÀË·ÑÁË£¬ËùÒÔÎÒÃÇÔÚÿ̨·þÎñÆ÷É϶¼´´½¨¶à¸öÂß¼Êý¾Ý¿â¡£
ÈçÏÂͼËùʾ£¬ÔÚNode-A
ºÍNode-B
ÉÏÎÒÃǶ¼½¨Á¢ÁËshard_001
ºÍshard_002
Á½¸öÂß¼Êý¾Ý¿â£¬Node-A
ÉϵÄshard_001
ºÍNode-B
ÉϵÄshard_001
×é³ÉÒ»¸öShard
£¬¶øͬһʱ¼äÖ»ÓÐÒ»¸öÂß¼Êý¾Ý¿â´¦ÓÚActive
״̬¡£
Õâ¸öʱºòÈç¹ûÐèÒª·ÃÎÊShard-001
µÄÊý¾Ýʱ£¬ÎÒÃÇÁ¬½ÓµÄÊÇNode-A
ÉϵÄshard_001
£¬
¶ø·ÃÎÊShard-002
µÄÊý¾ÝÔòÊÇÁ¬½ÓNode-B
ÉϵÄshard_002
¡£ÒÔÕâÖÖ½»²æµÄ·½Ê½½«Ñ¹Á¦·ÖÉ¢µ½Ã¿Ì¨ÎïÀí·þÎñÆ÷ÉÏ¡£
ÒÔMaster-Master
·½Ê½²¿ÊðµÄÁíÒ»¸öºÃ´¦ÊÇ£¬ÎÒÃÇ¿ÉÒÔ²»Í£Ö¹·þÎñµÄÇé¿öϽøÐбí½á¹¹Éý¼¶£¬
Éý¼¶Ç°ÏÈÍ£Ö¹¸´ÖÆ£¬Éý¼¶Inactive
µÄ¿â£¬È»ºóÉý¼¶Ó¦Óã¬ÔÙ½«ÒѾÉý¼¶ºÃµÄÊý¾Ý¿âÇл»³ÉActive
״̬£¬
ÔÀ´µÄActive
Êý¾Ý¿âÇл»³ÉInactive
״̬£¬È»ºóÉý¼¶ËüµÄ±í½á¹¹£¬×îºó»Ö¸´¸´ÖÆ¡£
µ±È»Õâ¸ö²½Öè²»Ò»¶¨ÊʺÏËùÓÐÉý¼¶¹ý³Ì£¬Èç¹û±í½á¹¹µÄ¸ü¸Ä»áµ¼ÖÂÊý¾Ý¸´ÖÆʧ°Ü£¬ÄÇô»¹ÊÇÐèҪֹͣ·þÎñÔÙÉý¼¶µÄ¡£
Ç°ÃæÌáµ½¹ýÌí¼Ó·þÎñÆ÷ʱ£¬ÎªÁ˱£Ö¤¸ºÔصÄƽºâ£¬ÎÒÃÇÐèҪǨÒÆÒ»²¿·ÖÊý¾Ýµ½ÐµķþÎñÆ÷ÉÏ¡£ ΪÁ˱ÜÃâ¶ÌÆÚÄÚǨÒƵıØÒª£¬ÎÒÃÇÔÚʵ¼Ê²¿ÊðµÄʱºò£¬Ã¿Ì¨»úÆ÷Éϲ¿ÊðÁË8¸öÂß¼Êý¾Ý¿â£¬ Ìí¼Ó·þÎñÆ÷ºó£¬ÎÒÃÇÖ»Òª½«ÕâЩÂß¼Êý¾Ý¿âǨÒƵ½Ð·þÎñÆ÷¾Í¿ÉÒÔÁË¡£×îºÃÊÇÿ´ÎÌí¼ÓÒ»±¶µÄ·þÎñÆ÷£¬ È»ºó½«Ã¿Ì¨µÄ1/2Âß¼Êý¾ÝǨÒƵ½Ò»Ì¨Ð·þÎñÆ÷ÉÏ£¬ÕâÑùÄܺܺõÄƽºâ¸ºÔØ¡£ µ±È»£¬×îºóµ½ÁËÿ̨ÉÏÖ»ÓÐÒ»¸öÂß¼¿âʱ£¬Ç¨ÒƾÍÎÞ·¨±ÜÃâÁË£¬²»¹ýÄÇÓ¦¸ÃÊDZȽϾÃÔ¶µÄÊÂÇéÁË¡£
ÎÒÃÇ°Ñ·Ö¿âÂß¼¶¼·â×°ÔÚÎÒÃǵÄPHP¿ò¼ÜÀïÁË£¬¿ª·¢ÈËÔ±»ù±¾Éϲ»ÐèÒª±»ÕâЩ·±ËöµÄÊÂÇéÀ§ÈÅ¡£ ÏÂÃæÊÇʹÓÃÎÒÃǵĿò¼Ü½øÐÐÕÕƬÊý¾ÝµÄ¶ÁдµÄһЩÀý×Ó:
$Photos = new ShardedDBTable('Photos', 'yp_photos', 'user_id', array( 'photo_id' => array('type' => 'long', 'primary' => true, 'global_auto_increment' => true), 'user_id' => array('type' => 'long'), 'title' => array('type' => 'string'), 'posted_date' => array('type' => 'date'), )); $photo = $Photos->new_object(array('user_id' => 1, 'title' => 'Workforme')); $photo->insert(); // ¼ÓÔØIDΪ10001µÄÕÕƬ£¬×¢ÒâµÚÒ»¸ö²ÎÊýΪÓû§ID $photo = $Photos->load(1, 10001); // ¸ü¸ÄÕÕƬÊôÐÔ $photo->title = 'Database Sharding'; $photo->update(); // ɾ³ýÕÕƬ $photo->delete(); // »ñÈ¡IDΪ1µÄÓû§ÔÚ2010-06-01Ö®ºóÉÏ´«µÄÕÕƬ $photos = $Photos->fetch(array('user_id' => 1, 'posted_date__gt' => '2010-06-01'));
Ê×ÏÈÒª¶¨ÒåÒ»¸öShardedDBTable
¶ÔÏó£¬ËùÓеÄAPI¶¼ÊÇͨ¹ýÕâ¸ö¶ÔÏ󿪷š£µÚÒ»¸ö²ÎÊýÊǶÔÏóÀàÐÍÃû³Æ£¬
Èç¹ûÕâ¸öÃû³ÆÒѾ´æÔÚ£¬ÄÇô½«·µ»Ø֮ǰ¶¨ÒåµÄ¶ÔÏó¡£ÄãÒ²¿ÉÒÔͨ¹ýget_table('Photos')
Õâ¸öº¯ÊýÀ´»ñȡ֮ǰ¶¨ÒåµÄTable
¶ÔÏó¡£
µÚ¶þ¸ö²ÎÊýÊǶÔÓ¦µÄÊý¾Ý¿â±íÃû£¬¶øµÚÈý¸ö²ÎÊýÊÇÊý¾Ý¿âÏßË÷×ֶΣ¬Äã»á·¢ÏÖÔÚºóÃæµÄËùÓÐAPIÖÐÈ«²¿ÐèÒªÖ¸¶¨Õâ¸ö×ֶεÄÖµ¡£
µÚËĸö²ÎÊýÊÇ×ֶζ¨Ò壬ÆäÖÐphoto_id
×ֶεÄglobal_auto_increment
ÊôÐÔ±»ÖÃΪtrue
£¬Õâ¾ÍÊÇÇ°ÃæËù˵µÄÈ«¾Ö×ÔÔöID£¬
Ö»ÒªÖ¸¶¨ÁËÕâ¸öÊôÐÔ£¬¿ò¼Ü»á´¦ÀíºÃIDµÄÊÂÇé¡£
Èç¹ûÎÒÃÇÒª·ÃÎÊÈ«¾Ö¿âÖеÄÊý¾Ý£¬ÎÒÃÇÐèÒª¶¨ÒåÒ»¸öDBTable
¶ÔÏó¡£
$Users = new DBTable('Users', 'yp_users', array( 'user_id' => array('type' => 'long', 'primary' => true, 'auto_increment' => true), 'username' => array('type' => 'string'), ));
DBTable
ÊÇShardedDBTable
µÄ¸¸À࣬³ýÁ˶¨Òåʱ²ÎÊýÓÐЩ²»Í¬(DBTable
²»ÐèÒªÖ¸¶¨Êý¾Ý¿âÏßË÷×Ö¶Î)£¬ËüÃÇÌṩһÑùµÄAPI¡£
»º´æ
ÎÒÃǵĿò¼ÜÌṩÁË»º´æ¹¦ÄÜ£¬¶Ô¿ª·¢ÈËÔ±ÊÇ͸Ã÷µÄ¡£
$photo = $Photos->load(1, 10001);
±ÈÈçÉÏÃæµÄ·½·¨µ÷Ó㬿ò¼ÜÏȳ¢ÊÔÒÔPhotos-1-10001
ΪKeyÔÚ»º´æÖвéÕÒ£¬Î´ÕÒµ½µÄ»°ÔÙÖ´ÐÐÊý¾Ý¿â²éѯ²¢·ÅÈ뻺´æ¡£
µ±¸ü¸ÄÕÕƬÊôÐÔ»òɾ³ýÕÕƬʱ£¬¿ò¼Ü¸ºÔð´Ó»º´æÖÐɾ³ý¸ÃÕÕƬ¡£ÕâÖÖµ¥¸ö¶ÔÏóµÄ»º´æʵÏÖÆðÀ´±È½Ï¼òµ¥¡£
ÉÔ΢Âé·³µÄÊÇÏñÏÂÃæÕâÑùµÄÁбí²éѯ½á¹ûµÄ»º´æ¡£
$photos = $Photos->fetch(array('user_id' => 1, 'posted_date__gt' => '2010-06-01'));
ÎÒÃÇ°ÑÕâ¸ö²éѯ·Ö³ÉÁ½²½£¬µÚÒ»²½ÏȲé³ö·ûºÏÌõ¼þµÄÕÕƬID£¬È»ºóÔÙ¸ù¾ÝÕÕƬID·Ö±ð²éÕÒ¾ßÌåµÄÕÕƬÐÅÏ¢¡£
Õâô×ö¿ÉÒÔ¸üºÃµÄÀûÓûº´æ¡£µÚÒ»¸ö²éѯµÄ»º´æKeyΪPhotos-list-{shard_key}-{md5(²éѯÌõ¼þSQLÓï¾ä)}
£¬
ValueÊÇÕÕƬIDÁÐ±í£¨¶ººÅ¼ä¸ô£©¡£ÆäÖÐshard_key
Ϊuser_id
µÄÖµ1¡£Ä¿Ç°À´¿´£¬ÁÐ±í»º´æÒ²²»Âé·³¡£
µ«ÊÇÈç¹ûÓû§ÐÞ¸ÄÁËijÕÅÕÕƬµÄÉÏ´«Ê±¼äÄØ£¬Õâ¸öʱºò»º´æÖеÄÊý¾Ý¾Í²»Ò»¶¨·ûºÏÌõ¼þÁË¡£
ËùÒÔ£¬ÎÒÃÇÐèÒªÒ»¸ö»úÖÆÀ´±£Ö¤ÎÒÃDz»»á´Ó»º´æÖеõ½¹ýÆÚµÄÁбíÊý¾Ý¡£ÎÒÃÇΪÿÕűíÉèÖÃÁËÒ»¸örevision£¬
µ±¸Ã±íµÄÊý¾Ý·¢Éú±ä»¯Ê±(µ÷ÓÃinsert/update/delete·½·¨)£¬ÎÒÃǾ͸üÐÂËüµÄrevision£¬
ËùÒÔÎÒÃÇ°ÑÁбíµÄ»º´æKey¸ÄΪPhotos-list-{shard_key}-{md5(²éѯÌõ¼þSQLÓï¾ä)}-{revision}
£¬
ÕâÑùÎÒÃǾͲ»»áÔٵõ½¹ýÆÚÁбíÁË¡£
revisionÐÅÏ¢Ò²ÊÇ´æ·ÅÔÚ»º´æÀïµÄ£¬KeyΪPhotos-revision
¡£ÕâÑù×ö¿´ÆðÀ´²»´í£¬µ«ÊǺÃÏñÁÐ±í»º´æµÄÀûÓÃÂʲ»»áÌ«¸ß¡£
ÒòΪÎÒÃÇÊÇÒÔÕû¸öÊý¾ÝÀàÐ͵ÄrevisionΪ»º´æKeyµÄºó׺£¬ÏÔÈ»Õâ¸örevision¸üеķdz£Æµ·±£¬
ÈκÎÒ»¸öÓû§Ð޸ĻòÉÏ´«ÁËÕÕƬ¶¼»áµ¼ÖÂËüµÄ¸üУ¬ÄÄÅÂÄǸöÓû§¸ù±¾²»ÔÚÎÒÃÇÒª²éѯµÄShardÀï¡£
Òª¸ôÀëÓû§µÄ¶¯×÷¶ÔÆäËûÓû§µÄÓ°Ï죬ÎÒÃÇ¿ÉÒÔͨ¹ýËõСrevisionµÄ×÷Ó÷¶Î§À´´ïµ½Õâ¸öÄ¿µÄ¡£
ËùÒÔrevisionµÄ»º´æKey±ä³ÉPhotos-{shard_key}-revision
£¬ÕâÑùµÄ»°µ±IDΪ1µÄÓû§ÐÞ¸ÄÁËËûµÄÕÕƬÐÅϢʱ£¬
Ö»»á¸üÐÂPhotos-1-revision
Õâ¸öKeyËù¶ÔÓ¦µÄrevision¡£
ÒòΪȫ¾Ö¿âûÓÐshard_key
, ËùÒÔÐÞ¸ÄÁËÈ«¾Ö¿âÖеıíµÄÒ»ÐÐÊý¾Ý£¬»¹ÊǻᵼÖÂÕû¸ö±íµÄ»º´æʧЧ¡£
µ«ÊǴ󲿷ÖÇé¿öÏ£¬Êý¾Ý¶¼ÊÇÓÐÇøÓò·¶Î§µÄ£¬±ÈÈçÎÒÃǵİïÖúÂÛ̳µÄÖ÷ÌâÌû×Ó£¬
Ìû×ÓÊôÓÚÖ÷Ìâ¡£ÐÞ¸ÄÁËÆäÖÐÒ»¸öÖ÷ÌâµÄÒ»¸öÌû×Ó£¬Ã»±ØҪʹËùÓÐÖ÷ÌâµÄÌû×Ó»º´æ¶¼Ê§Ð§¡£
ËùÒÔÎÒÃÇÔÚDBTable
ÉÏÔö¼ÓÁËÒ»¸ö½Ðisolate_key
µÄÊôÐÔ.
$GLOBALS['Posts'] = new DBTable('Posts', 'yp_posts', array( 'topic_id' => array('type' => 'long', 'primary' => true), 'post_id' => array('type' => 'long', 'primary' => true, 'auto_increment' => true), 'author_id' => array('type' => 'long'), 'content' => array('type' => 'string'), 'posted_at' => array('type' => 'datetime'), 'modified_at' => array('type' => 'datetime'), 'modified_by' => array('type' => 'long'), ), 'topic_id');
×¢Òâ¹¹Ô캯ÊýµÄ×îºóÒ»¸ö²ÎÊýtopic_id
¾ÍÊÇÖ¸ÒÔ×Ö¶Îtopic_id
×÷Ϊisolate_key
,
ËüµÄ×÷ÓúÍshard_key
Ò»ÑùÓÃÓÚ¸ôÀërevisionµÄ×÷Ó÷¶Î§¡£
ShardedDBTable
¼Ì³Ð×ÔDBTable
£¬ËùÒÔÒ²¿ÉÒÔÖ¸¶¨isolate_key
¡£ShardedDBTable
Ö¸¶¨ÁËisolate_key
µÄ»°£¬Äܹ»¸ü´ó·ù¶ÈËõСrevisionµÄ×÷Ó÷¶Î§¡£
±ÈÈçÏà²áºÍÕÕƬµÄ¹ØÁª±íyp_album_photos
£¬µ±Óû§ÍùËûµÄÆäÖÐÒ»¸öÏà²áÀïÌí¼ÓÁËеÄÕÕƬʱ£¬
»áµ¼ÖÂÆäËüÏà²áµÄÕÕƬÁÐ±í»º´æҲʧЧ¡£Èç¹ûÎÒÖ¸¶¨ÕâÕűíµÄisolate_key
Ϊalbum_id
µÄ»°£¬
ÎÒÃǾͰÑÕâÖÖÓ°ÏìÏÞÖÆÔÚÁ˱¾Ïà²áÄÚ¡£
ÎÒÃǵĻº´æ·ÖΪÁ½¼¶£¬µÚÒ»¼¶Ö»ÊÇÒ»¸öPHPÊý×飬ÓÐЧ·¶Î§ÊÇRequest
¡£
¶øµÚ¶þ¼¶ÊÇmemcached
¡£Õâô×öµÄÔÒòÊÇ£¬ºÜ¶àÊý¾ÝÔÚÒ»¸öRequest
ÖÜÆÚÄÚÐèÒª¼ÓÔضà´Î£¬
ÕâÑù¿ÉÒÔ¼õÉÙmemcached
µÄÍøÂçÇëÇó¡£ÁíÍâÎÒÃǵĿò¼ÜÒ²»á¾¡¿ÉÄܵķ¢ËÍmemcached
µÄgets
ÃüÁîÀ´»ñÈ¡Êý¾Ý£¬
´Ó¶ø¼õÉÙÍøÂçÇëÇó¡£
×ܽá
Õâ¸ö¼Ü¹¹Ê¹µÃÎÒÃÇÔںܳ¤Ò»¶Îʱ¼äÄÚ¶¼²»±ØÔÙΪÊý¾Ý¿âѹÁ¦ËùÀ§ÈÅ¡£ ÎÒÃǵÄÉè¼ÆºÜ¶àµØ·½²Î¿¼ÁËnetlogºÍflickrµÄʵÏÖ£¬Òò´Ë·Ç³£¸ÐлËûÃǽ«Ò»Ð©ÊµÏÖϸ½Ú·¢²¼³öÀ´¡£
ÔÎĵØÖ·£ºhttp://www.zolazhou.com/posts/sharding-at-yupoo/
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ