<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Development Notes &#187; My Thinking</title>
	<atom:link href="http://blog.eood.cn/category/my-thinking/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eood.cn</link>
	<description>PHP, Drupal, Erlang, MySQL, Java, MongoDB, Linux, vim, ssh, screen etc</description>
	<lastBuildDate>Sat, 31 Dec 2011 12:49:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>2011 Review</title>
		<link>http://blog.eood.cn/2011-review</link>
		<comments>http://blog.eood.cn/2011-review#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:49:49 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Life & Work]]></category>
		<category><![CDATA[My Thinking]]></category>
		<category><![CDATA[2011]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[总结]]></category>
		<category><![CDATA[目标]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1784</guid>
		<description><![CDATA[又到一个年底，回顾一年的变化和目标，幸好有1年前的总结和目标 2010 Summary And 2011 Goals ，可以让我在一年后还能回顾一下以前的计划和现在的完成情况。 关于博客的总结 本年度博客数量有所降低，原因是下半年从主要开发 A 切换到主要开发 B 。而 B 的核心是人工智能，由于领域过于窄，不方便分享一些通用的心得；另一方面写博客的时间变少，有几篇总结性的博客想放到新的一年吧。以下是有一点价值的博文： 关于 Drupal What is new in Drupal 7 Drupal Views PHP Code Validator [Drupal] 错误执行MYSQL命令之后如何挽救 Add a custom tab menu in profile edit page in Drupal 7 Why Drupal is not popular in China Drupal 仍然是快速原型，甚至是生产系统的首选。当然现在更多的人推崇 Rails 或者 Django， NodeJS [...]]]></description>
			<content:encoded><![CDATA[<p>又到一个年底，回顾一年的变化和目标，幸好有1年前的总结和目标 <a title="Permanent Link to 2010 Summary And 2011 Goals" rel="bookmark" href="http://blog.eood.cn/2011_goals_2010_summary">2010 Summary And 2011 Goals</a> ，可以让我在一年后还能回顾一下以前的计划和现在的完成情况。<br />
<img title="m_s_2011" src="http://blog.eood.cn/wp-content/uploads/2011/12/m_s_2011.jpg" alt="" width="425" height="203" /></p>
<h2>关于博客的总结</h2>
<p>本年度博客数量有所降低，原因是下半年从主要开发 A 切换到主要开发 B 。而 B 的核心是人工智能，由于领域过于窄，不方便分享一些通用的心得；另一方面写博客的时间变少，有几篇总结性的博客想放到新的一年吧。以下是有一点价值的博文：</p>
<p><strong>关于 Drupal</strong></p>
<ol>
<li><a title="Permanent Link to What is new in Drupal 7" rel="bookmark" href="http://blog.eood.cn/what-is-new-in-drupal-7">What is new in Drupal 7</a></li>
<li><a title="Permanent Link to Drupal Views PHP Code Validator" rel="bookmark" href="http://blog.eood.cn/drupal-views-php-code-validator">Drupal Views PHP Code Validator</a></li>
<li><a title="Permanent Link to [Drupal] 错误执行MYSQL命令之后如何挽救" rel="bookmark" href="http://blog.eood.cn/drupal_mysql_tips">[Drupal] 错误执行MYSQL命令之后如何挽救</a></li>
<li><a title="Permanent Link to Add a custom tab menu in profile edit page in Drupal 7" rel="bookmark" href="http://blog.eood.cn/add-a-custom-tab-menu-in-profile-edit-page-in-drupal-7-2">Add a custom tab menu in profile edit page in Drupal 7</a></li>
<li><a title="Permanent Link to Why Drupal is not popular in China" rel="bookmark" href="http://blog.eood.cn/why-drupal-is-not-popular-in-china">Why Drupal is not popular in China</a></li>
</ol>
<p>Drupal 仍然是快速原型，甚至是生产系统的首选。当然现在更多的人推崇 Rails 或者 Django， NodeJS ，个人也在 2011 对这 3 中技术堆栈进行了认真比较，发现 Drupal 仍然是不二选择。当然 Drupal 只能用在 WEB 的 UI 界面和业务逻辑部分，对性能要求高的地方或者通讯层可以考虑用 NodeJS 或者 Erlang 。假如能自己定主要开发框架，我倒是愿意尝试 Django ，它看起来还是比较完善的。</p>
<p><strong>关于前端开发</strong></p>
<ol>
<li><a title="Permanent Link to JSON JSON-RPC 和 JSONP" rel="bookmark" href="http://blog.eood.cn/json-json-rpc-%e5%92%8c-jsonp">JSON JSON-RPC 和 JSONP</a></li>
<li><a title="Permanent Link to JSONP Library In Plain JavaScript With Timeout" rel="bookmark" href="http://blog.eood.cn/jsonp-library-in-plain-javascript-with-timeout">JSONP Library In Plain JavaScript With Timeout</a></li>
<li><a href="http://blog.eood.cn/backbone">Backbone JS框架指南</a></li>
<li><a title="Permanent Link to CoffeeScript – 未来可以取代 JavaScript 的语言" rel="bookmark" href="http://blog.eood.cn/coffeescript-2">CoffeeScript – 未来可以取代 JavaScript 的语言</a></li>
<li><a title="Permanent Link to Javascript 设计模式入门" rel="bookmark" href="http://blog.eood.cn/javascript-design-patterns">Javascript 设计模式入门</a></li>
</ol>
<p>前端部分这年尝试了基于 Backbone 开发，发现它也是个学习曲线比较高的东西，但是一旦熟悉还是很通用的。CoffeeScript 建议不要用，无论如何还是离不开 JS 。2011 前端部分研究比较多，发现 WEB 开发最靠谱的还是纯文本+超链接的方式，将计算分散到客户端是比较不靠谱的想法，尝试各种花哨的前端技术也是不靠谱的，毕竟<strong>用户体验</strong>才是王道。</p>
<p><strong>关于 WEB 架构</strong></p>
<ol>
<li><a title="Permanent Link to 谈一谈 Scalability 和可扩展的架构设计模式" rel="bookmark" href="http://blog.eood.cn/scalable_system_patterns">谈一谈 Scalability 和可扩展的架构设计模式</a></li>
<li><a title="Permanent Link to WEB Development Rookie – NodeJS" rel="bookmark" href="http://blog.eood.cn/web-development-rookie-nodejs">WEB Development Rookie – NodeJS</a></li>
<li><a title="Permanent Link to Enter Django Development" rel="bookmark" href="http://blog.eood.cn/enter_django_python_development">Enter Django Development</a></li>
<li><a title="Permanent Link to 细数跨语言通信的选择" rel="bookmark" href="http://blog.eood.cn/cross_language_communication">细数跨语言通信的选择</a></li>
</ol>
<p>NodeJS 可能是 2011 最热门的话题，目前已经在项目 B 用到了生产环境。</p>
<p><strong>其他</strong></p>
<ol>
<li><a title="Permanent Link to What tools and software used for development" rel="bookmark" href="http://blog.eood.cn/what-tools-and-software-used-fro-development">What tools and software used for development</a></li>
<li><a title="Permanent Link to XML 文件处理利器 VTD-XML" rel="bookmark" href="http://blog.eood.cn/vtd-xml_xml_parser">XML 文件处理利器 VTD-XML</a></li>
<li><a title="Permanent Link to Encrypt your files or content on cloud services" rel="bookmark" href="http://blog.eood.cn/encrypt-your-files-or-content-on-cloud-services">Encrypt your files or content on cloud services</a></li>
<li><a title="Permanent Link to 如何停止Windows服务器上僵死进程" rel="bookmark" href="http://blog.eood.cn/kill_zombie_process">如何停止Windows服务器上僵死进程</a></li>
</ol>
<h2>2011的个人计划完成</h2>
<ol>
<li>深入IOS , Android开发 <strong><span style="color: #ff0000;">未完成</span></strong></li>
<li>关注产品的网络营销 <span style="color: #ff0000;"><strong><span style="color: #008000;">完成</span></strong></span></li>
<li>项目1,2,3的开发和营销的0突破 <strong><span style="color: #ff0000;">未完成</span></strong></li>
<li><span style="text-decoration: line-through;">Improve Algorithm and Linux C DELETED</span></li>
<li>继续关注 Marketing, Social information, BI <span style="color: #ff0000;"><strong>完成</strong></span></li>
<li><span style="text-decoration: line-through;">换一个拥有大数据量的环境? DELETED</span></li>
</ol>
<p>Oh, shit!  好像 2011 并没有按计划进行，但是仍然很充实，有很多收获。</p>
<h2>2012个人目标</h2>
<ol>
<li>进入 <span style="color: #ff0000;"><strong>IOS</strong> </span>, <span style="color: #008000;"><strong>Android </strong></span>开发</li>
<li>继续关注市场和营销趋势</li>
<li>项目方向改进和营销</li>
<li>构建基于人工智能的解析器</li>
<li>写更多质量比较好的总结博客</li>
<li>尝试<span style="text-decoration: underline;"><strong>新</strong></span>的模式</li>
</ol>
<p><a href="http://blog.eood.cn/backbone"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/2011-review/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Drupal is not popular in China</title>
		<link>http://blog.eood.cn/why-drupal-is-not-popular-in-china</link>
		<comments>http://blog.eood.cn/why-drupal-is-not-popular-in-china#comments</comments>
		<pubDate>Fri, 30 Dec 2011 05:35:11 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[My Thinking]]></category>
		<category><![CDATA[China]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/why-drupal-is-not-popular-in-china</guid>
		<description><![CDATA[I have developed based on Drupal stack for more than 4 years. In my opinion: The learning curve of Drupal is higher than other stacks, since It&#8217;s flexibility.&#160; Server environment in China is very poor. Drupal can works well at least installed in VPS. The requirement is very simple in China, you can just install [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>I have developed based on Drupal stack for more than 4 years. In my opinion:</p>
<ul>
<li>The learning curve of Drupal is higher than other stacks, since It&#8217;s flexibility.&nbsp;</li>
<li>Server environment in China is very poor. Drupal can works well at least installed in VPS.</li>
<li>The requirement is very simple in China, you can just install something like DZ forum or DEDE cms to accomplish the goal. Since the feature requirement is not comes from business requirement, they just want a simple web page to display there company profile etc.</li>
<li>Lots of teams want to build there own framework. (I disagree with this idea, it is wasting resource and time.)</li>
<li>The traffic of the website in China almost 100x larger than EU or US, but the value of the traffic is very low. So you need do more performance optimization for the Drupal site in China.</li>
<li>Most developers in China works on a Windows PC. So no drush, varnish, memcache, cron, etc.</li>
<li>Lots of developers installed Drupal and thought that Drupal is a blog :)</li>
</ul>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/why-drupal-is-not-popular-in-china/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enter Django Development</title>
		<link>http://blog.eood.cn/enter_django_python_development</link>
		<comments>http://blog.eood.cn/enter_django_python_development#comments</comments>
		<pubDate>Mon, 17 Oct 2011 08:55:13 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Development Story]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1751</guid>
		<description><![CDATA[Introduction: Django is the modern base stack for web development. Compared with Ruby on Rails, I think I like Django better: Build-in ready to use admin interface Written in Python, with better performance Simpler and reasonable project struct Smaller base stack, but you can add what you want (ajax, south, REST, oauth &#8230;) Essential tools [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right;" src="http://blog.eood.cn/wp-content/uploads/2011/10/django_serious-pony-331x300.jpg" alt="Django" width="331" height="300" /></p>
<p><strong><span style="font-size: large;">Introduction:</span></strong></p>
<p>Django is the modern base stack for web development. Compared with Ruby on Rails, I think I like Django better:</p>
<ul>
<li>Build-in ready to use admin interface</li>
<li>Written in Python, with better performance</li>
<li>Simpler and reasonable project struct</li>
<li>Smaller base stack, but you can add what you want (ajax, south, REST, oauth &#8230;)</li>
</ul>
<p><strong><span style="font-size: large;">Essential tools for Django development:</span></strong></p>
<p><span style="color: #000000;"><strong>virtualenv</strong></span></p>
<p>We use this to manage the library for the project. You can have different environments (different python modules, different python versions) for every projects.</p>
<blockquote><p><strong>Create new clean environment foobar</strong></p>
<p>virtualenv &#8211;no-site-packages foobar</p>
<p><strong>Active the environment foobar</strong></p>
<p>source foobar/bin/activate</p>
<p><strong>Then install library in the environment foobar</strong></p>
<p>pip &#8230;</p>
<p><strong>At the end leave the environment foobar</strong></p>
<p>deactivate</p>
</blockquote>
<p><strong>pip or easy_install</strong></p>
<p><em></em>To install python libraries.</p>
<p><strong> Django south</strong></p>
<p>Database migration tool. Alertanative tool for syncdb</p>
<p><strong>Create migration for your app</strong></p>
<p><em> ./manage.py schemamigration myapp &#8211;initial</em></p>
<p><strong>Apply the migration</strong></p>
<p><em> ./manage.py migrate myapp</em></p>
<p><strong> Then change the model myapp, and make a new migratation</strong></p>
<p><em> ./manage.py schemamigration myapp &#8211;auto</em></p>
<p><strong> And apply it</strong></p>
<p><em> ./manage.py migrate myapp django-annoying</em></p>
<p><strong> Useful decorators:</strong></p>
<p><em> rederto ajaxrequest JSONField getobjectorNone</em></p>
<p><strong>django-compressor</strong></p>
<p>Compresses linked and inline javascript or CSS into a single cached file. And support coffeescript and less css framework.</p>
<p><strong>django-pagination</strong></p>
<p>pagination tools</p>
<p><strong>django-piston</strong></p>
<p><strong></strong>A mini-framework for Django for creating RESTful APIs.</p>
<p><strong>django-celery</strong></p>
<p>Celery integration for Django.</p>
<p>Celery is a task queue/job queue based on distributed message passing.</p>
<p><strong>django-mongodb</strong></p>
<p>MongoDB backend</p>
<p><strong>django-admin-tools</strong></p>
<p>Custom user interface, customizable dashboard</p>
<p><strong>django-socialauth</strong></p>
<p>oauth for social sites, login with twitter account, facebook account or gmail account</p>
<p><strong>django-storages</strong></p>
<p>Amazon S3, MogileFS file storage</p>
<p><strong>django-grappelli</strong></p>
<p>A jazzy skin for the Django Admin-Interface</p>
<p><strong>django-profiles</strong></p>
<p>A simple application which provides basic features for working with custom user profiles in Django projects.</p>
<p><strong>django-registration</strong></p>
<p>User registration and login</p>
<p><strong>simplejson</strong></p>
<p>JSON encoding and decoding</p>
<p><strong>django-imagekit</strong></p>
<p>Image process, support S3.</p>
<p><strong>Beautiful Soup</strong></p>
<p>Web Scrapping tool</p>
<p><strong>django-workflows</strong></p>
<p>django-workflows provides a generic workflow engine for Django.</p>
<p><span style="font-size: large;">The Django development environment steps:</span></p>
<p><strong>How to install the virtualenv &amp; django:</strong></p>
<blockquote><p>sudo apt-get install python-virtualenv</p>
<p>virtualenv &#8211;no-site-packages env_nm</p>
<p>source env_nm/bin/activate</p>
<p>pip install django</p>
<p>&#8230; ( install other modules )</p>
<p>deactivate</p>
<p>Export the libraries of the environment to a configuration file</p>
<p>pip freeze &gt; requirements.txt</p>
<p>Install the environment in a clean environment</p>
<p>pip install -r requirements.txt</p>
</blockquote>
<p><strong>The missing part of Django settings.py</strong></p>
<blockquote><p><span style="font-size: small;">import os</span></p>
<p><span style="font-size: small;">ROOT_PATH = os.path.dirname(file)</span></p>
<p><span style="font-size: small;">MEDIAROOT = os.path.join(ROOTPATH, &#8216;static&#8217;)</span></p>
<p><span style="font-size: small;">TEMPLATE_DIRS = (</span></p>
<p><span style="font-size: small;">os.path.join(ROOT_PATH, &#8216;templates&#8217;)</span></p>
<p><span style="font-size: small;">)</span></p>
</blockquote>
<p><strong>Django Signals &#8211; You should pay attentation to this</strong></p>
<p>This is the ECA (Aka: Event Condition Action) part of Django.&nbsp;</p>
<p>ECA is the essentail part of modern web appliactions.</p>
<p><strong><span style="font-size: large;">Other useful modules:</span></strong></p>
<p>SQLAlchemy &#8211; use this when the django ORM is not enough.</p>
<p>Haystack &#8211; Modular search for Django.</p>
<p>Django-mptt &#8211; Preorder tree management</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/enter_django_python_development/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>北京租房小记</title>
		<link>http://blog.eood.cn/rent_apartment_in_beijing</link>
		<comments>http://blog.eood.cn/rent_apartment_in_beijing#comments</comments>
		<pubDate>Sat, 27 Aug 2011 05:34:02 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Bussiness & Economic]]></category>
		<category><![CDATA[Life & Work]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1714</guid>
		<description><![CDATA[一直想就在北京租房，买房，出租房写一篇博客，但一直没时间。最近又需要出租那个小公寓。原来的租户需要回香港发展，这月房租到期。 所以遇到了如何出租自己的房子的问题 我具备的条件是一台可以上网的电脑，一部手机。希望用这简单而有限的资源完成将自己房子出租的目标。 目标是： 1. 将自己的房子出租 2. 尽量少的时间消耗 3. 尽量少的资源消耗，包括体力，精力 这是个如何发布信息和获取信息的问题或者典型的 Marketing 问题 想到的发布方法基本有以下几类： 1. 到活跃的社区相关论坛，小组发布信息 2. 到专业租房信息网发布信息 3. 微博发布信息 4. 找中介发布信息 5. 向认识的朋友发布信息 除此之外，逆向思维，假如我需要租房会这么办？ 6. 在活跃的社区相关论坛寻找需要租房的信息 7. 到专业的租房信息网寻找需要租房的信息 8. 微博寻找需要租房的信息 9. 找中介获取信息 10. 向认识的朋友获取信息 然后逐个尝试以上的方法 在开始之前，首先排除了 5 和 9 。 为什么首先排除房屋中介呢？ 不得不承认找房屋中介可以很快的将房子租出去。假如你不想耗费很多时间和精力，单纯从出租房的角度，找房屋中介应该是个不错的选择，虽然这种方法也有很多问题。 房屋中介是个看似合理的行业。和很多商业一样，帮助客户解决一些问题，拿到一定的报酬。一般都是收取一月的房租作为中介费，在美国租房也类似。 中介的商业模式是利用的信息的不对称。这在信息不发达的年代应该是非常合理的。但是在信息如此发达的今天，几乎所有需要租房的人和需要出租房的人都会想到上网发布信息。仍然存在那么多房屋中介就不那么合理了。 但他就是存在了，原因就是中介的商业模式从利用信息的不对称向制造信息不对称进行了转变。这造成了很大的资源浪费。好吧，扯远了，社会问题不是我们该关心的。 假如真的通过中介出租房屋会有哪些问题呢，或者会带来哪些损失？ 1. 大量的干扰信息，很多需要租房的人来看房，而不是租 原因在于，中介会尽力想办法促成交易拿到中介费。一方面，向需要租房的人掩藏一些必要和关键的信息，比如租金，房屋的缺点等等。另一方面，向出租房的人掩藏部分信息。比如需要租房人可以承受的租金，租期等等。这样做可以稳定出租房的人和需要租房的人两方面的客户。 2. 大量的骚扰电话 在网络化的今天，其实中介和我们自己获取信息的方式没有任何差别。基本也就是前边所列的几种方式。( 登门采集信息？他们和你一样不会那么做。中介也需要降低成本。) 但为什么中介仍然可以通过所有人都可以拿到的信息来赚钱呢？就是靠不停的浏览所有相关的信息渠道，和电话联系租房和需要租房的双方。以非常低廉的打电话的成本，来大规模的联系客户。 [...]]]></description>
			<content:encoded><![CDATA[<p>一直想就在北京租房，买房，出租房写一篇博客，但一直没时间。最近又需要出租那个小公寓。原来的租户需要回香港发展，这月房租到期。</p>
<p><strong>所以遇到了如何出租自己的房子的问题</strong></p>
<p>我具备的条件是一台可以上网的电脑，一部手机。希望用这简单而有限的资源完成将自己房子出租的目标。</p>
<p>目标是：</p>
<p>1. 将自己的房子出租</p>
<p>2. 尽量少的时间消耗</p>
<p>3. 尽量少的资源消耗，包括体力，精力</p>
<p><strong>这是个如何发布信息和获取信息的问题或者典型的 Marketing 问题</strong></p>
<p>想到的发布方法基本有以下几类：</p>
<p>1. 到活跃的社区相关论坛，小组发布信息</p>
<p>2. 到专业租房信息网发布信息</p>
<p>3. 微博发布信息</p>
<p>4. 找中介发布信息</p>
<p>5. 向认识的朋友发布信息</p>
<p>除此之外，逆向思维，假如我需要租房会这么办？</p>
<p>6. 在活跃的社区相关论坛寻找需要租房的信息</p>
<p>7. 到专业的租房信息网寻找需要租房的信息</p>
<p>8. 微博寻找需要租房的信息</p>
<p>9. 找中介获取信息</p>
<p>10. 向认识的朋友获取信息</p>
<p><strong>然后逐个尝试以上的方法</strong></p>
<p>在开始之前，首先排除了 5 和 9 。</p>
<p><strong>为什么首先排除房屋中介呢？</strong></p>
<p>不得不承认找房屋中介可以很快的将房子租出去。假如你不想耗费很多时间和精力，单纯从出租房的角度，找房屋中介应该是个不错的选择，虽然这种方法也有很多问题。</p>
<p>房屋中介是个看似合理的行业。和很多商业一样，帮助客户解决一些问题，拿到一定的报酬。一般都是收取一月的房租作为中介费，在美国租房也类似。</p>
<p>中介的商业模式是利用的信息的不对称。这在信息不发达的年代应该是非常合理的。但是在信息如此发达的今天，几乎所有需要租房的人和需要出租房的人都会想到上网发布信息。仍然存在那么多房屋中介就不那么合理了。</p>
<p>但他就是存在了，原因就是中介的商业模式从<span style="text-decoration: underline;">利用信息的不对称</span>向<span style="text-decoration: underline;">制造信息不对称</span>进行了转变。这造成了很大的资源浪费。好吧，扯远了，社会问题不是我们该关心的。</p>
<p><strong>假如真的通过中介出租房屋会有哪些问题呢，或者会带来哪些损失？</strong></p>
<p>1. 大量的干扰信息，很多需要租房的人来看房，而不是租</p>
<p>原因在于，中介会尽力想办法促成交易拿到中介费。一方面，向需要租房的人掩藏一些必要和关键的信息，比如租金，房屋的缺点等等。另一方面，向出租房的人掩藏部分信息。比如需要租房人可以承受的租金，租期等等。这样做可以稳定出租房的人和需要租房的人两方面的客户。</p>
<p>2. 大量的骚扰电话</p>
<p>在网络化的今天，其实中介和我们自己获取信息的方式没有任何差别。基本也就是前边所列的几种方式。( 登门采集信息？他们和你一样不会那么做。中介也需要降低成本。)</p>
<p>但为什么中介仍然可以通过所有人都可以拿到的信息来赚钱呢？就是靠不停的浏览所有相关的信息渠道，和电话联系租房和需要租房的双方。以非常低廉的打电话的成本，来大规模的联系客户。</p>
<p>即使通过打电话的转化率只有 0.1% ：</p>
<p>直接成本： 1000 *0.1 CNY + ( 2min * 1000 ) / 60 / 8  = 100 CNY + 4 Day</p>
<p>收入：1000  - 5000 CNY ( 一月房租 )</p>
<p>当然中介实际操作中，还会有其他的很多方式，来制造信息的不对称：到信息网站的发大量的虚假信息来获取客户； 联系信息网站，付费屏蔽真实信息等等。</p>
<p>减去其他成本和中介竞争造成的成本上升，房屋中介这种轻资产的商业模式仍然有非常高的利润率。</p>
<p>3. 时间和精力的浪费</p>
<p><strong>实施 2 到专业租房信息网发布信息</strong></p>
<p>登记了房屋的信息，为了避免中介联系，专门注明：1. 中介勿扰 2. 只可以短信联系。这样做希望能屏蔽我不希望的到的干扰信息。</p>
<p>在半天内获取的结果，截止到写这篇博客为止</p>
<p>真实租房人  - 1</p>
<p>中介电话 &#8211; 48 ( 看了中介根本不在意你的需求和想法，唯一目的就是赚钱，这个干扰没法屏蔽 )</p>
<p>中介短信 &#8211; 5 ( 部分中介还是比较认真看说明的 )</p>
<p>中介假冒租房人的短信 &#8211; 1 ( 无语了，短信强调自己不是中介，但是手机号码从Google一下就能找，以中介身份发布过信息)</p>
<p><strong>实施 1 到活跃的社区发布信息</strong></p>
<p>半天的结果</p>
<p>真实租房人 &#8211; 2 ( Social 社区的好处就是很容易将中介区分出来 )</p>
<p><strong>实施 3 到微博客发布信息</strong></p>
<p>1天结果</p>
<p>真实租房人 0</p>
<p>看了微博的受众还是太少了，只有600多粉丝可以在有限的一点时间内看到那条出租房的信息</p>
<p><strong>实施 5 向认识的朋友发布信息</strong></p>
<p>半天的结果</p>
<p>真实租房人 0</p>
<p>朋友中遇到要租房的概率还是非常小，简单而言仍然是受众太少。</p>
<p><strong>6, 7,  8,  9,  10 很难找到需要的信息</strong></p>
<p><strong><br />
</strong></p>
<p><strong>商业上结论</strong></p>
<p>纯粹利益驱动而没有监管的市场只能走向恶化。房屋中介就是个典型的例子。</p>
<p>有效的获取客户的方法仍然是利用成熟的信息平台。</p>
<p>在所有平台上发布广告或者信息寻找客户的同时一定会遇到损失，来自竞争对手和干扰。</p>
<p><strong>出租房的结论</strong></p>
<p>中介看起来虽好但难以让人相信。</p>
<p>以后遇到发布公众信息的时候，一定要买一张临时的手机卡。减少之后的骚扰。</p>
<p><strong>租房的结论</strong></p>
<p>假如不想通过中介，可以定期及时关注那些信息发布平台。</p>
<p>在网上查询发布人的手机号。</p>
<p><strong>其他</strong></p>
<p>房屋中介更换手机号的成本还是比较高的。固定电话自然不用说。手机号的更换意味着之前很多客户的损失。</p>
<p>另外，来着固定电话的 100% 都是中介。看来固定电话在个人使用上几乎已经淘汰了。</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/rent_apartment_in_beijing/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What is new in Drupal 7</title>
		<link>http://blog.eood.cn/what-is-new-in-drupal-7</link>
		<comments>http://blog.eood.cn/what-is-new-in-drupal-7#comments</comments>
		<pubDate>Sun, 19 Jun 2011 03:35:50 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[D7]]></category>
		<category><![CDATA[Drupal7]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1673</guid>
		<description><![CDATA[User experience The design process can see at http://www.d7ux.org/ Drupal 7 UX design principles: 1. Make the most frequent tasks easy and less frequent tasks achievable. 2. Design for the 80% 3. Privilege the Content Creator 4. Make the default settings smart Learned from D7 AI: Less clicks is not nessarlly better. Few options show [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://blog.eood.cn/wp-content/uploads/2011/06/drupal7logo.jpg"><img class="alignright size-full wp-image-1676" title="drupal7logo" src="http://blog.eood.cn/wp-content/uploads/2011/06/drupal7logo.jpg" alt="" width="225" height="180" /></a>User experience</h2>
<p>The design process can see at <a href="http://www.d7ux.org/">http://www.d7ux.org/</a></p>
<p><strong>Drupal 7 UX design principles: </strong></p>
<p>1. Make the most frequent tasks easy and less frequent tasks achievable.</p>
<p>2. Design for the 80%</p>
<p>3. Privilege the Content Creator</p>
<p>4. Make the default settings smart</p>
<p><strong>Learned from D7 AI:</strong></p>
<p>Less clicks is not nessarlly better.</p>
<p>Few options show = more decision made.</p>
<p>Order by frequency use</p>
<p><strong>Dashboard module</strong> provide the simple way to organizing administrative tasks and tracking information within your site.</p>
<h2>Database layer</h2>
<p><strong>New database API</strong></p>
<p>1. New in D7 is the placeholder and placeholder array</p>
<blockquote><p>$node = db_query(&#8220;SELECT * FROM {node} WHERE nid = <span style="color: #ff0000;">:nid</span>&#8220;, <span style="color: #0000ff;">array(&#8216;:nid&#8217; =&gt; $nid)</span>)-&gt;fetchObject();</p>
<p>$title = db_query(&#8220;SELECT title FROM {node} WHERE nid = <span style="color: #ff0000;">:nid</span>&#8220;, <span style="color: #0000ff;">array(&#8216;:nid&#8217; =&gt; $nid)</span>)-&gt;fetchField();</p></blockquote>
<p>2. New result set loop functions</p>
<blockquote><p>$result = db_query(&#8220;SELECT nid, title FROM {node}&#8221;);</p>
<p>foreach ($result as $record) {<br />
$record = $result-&gt;fetch();            // Use the default fetch mode.<br />
//$record = $result-&gt;fetchObject();  // Fetch as a stdClass object.<br />
//$record = $result-&gt;fetchAssoc();   // Fetch as an associative array.<br />
}</p></blockquote>
<p>see more: <a href="http://drupal.org/node/310072">http://drupal.org/node/310072</a></p>
<p>3. Dynamic queries</p>
<p>This is the big change in D7, see from <a href="http://drupal.org/node/310075">http://drupal.org/node/310075</a></p>
<p><strong>Support for master/slave replication</strong></p>
<blockquote><p>$result = db_query(&#8220;SELECT nid, title FROM {node}&#8221;, array(), array(<br />
<span style="color: #ff0000;"> &#8216;target&#8217; =&gt; &#8216;slave&#8217;,</span><br />
&#8216;fetch&#8217; =&gt; PDO::FETCH_ASSOC,<br />
));</p></blockquote>
<p><strong>Support for Transactions</strong></p>
<p>A function simply calls &#8220;$txn = db_transaction();&#8221; as its first (or nearly first) operation to make itself transactional.</p>
<p><strong>Nosql (Mongodb) support</strong></p>
<p>D7 has a mongodb module provide the mongodb API.</p>
<p><strong>Other</strong></p>
<p>Default to InnoDB engine</p>
<h2>Semantic Web support</h2>
<p>Support RDF</p>
<h2>More</h2>
<p>More secure password system, MD5 is no longer used.</p>
<p>More can see from <a href="http://drupal.org/about/new-in-drupal-7">http://drupal.org/about/new-in-drupal-7</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/what-is-new-in-drupal-7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WEB Development Rookie &#8211; NodeJS</title>
		<link>http://blog.eood.cn/web-development-rookie-nodejs</link>
		<comments>http://blog.eood.cn/web-development-rookie-nodejs#comments</comments>
		<pubDate>Sat, 16 Apr 2011 11:21:03 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[NodeJS]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/web-development-rookie-nodejs</guid>
		<description><![CDATA[The nodejs growing very fast recently. New library or framework added to nodejs  almost everyday, since it is very easy to build a nodejs based module and javascript is used very widely. I have done the A/B testing of nodeJS vs Erlang mochiweb, Erlang misultin, Nginx static page on my poor VM machine, and got [...]]]></description>
			<content:encoded><![CDATA[<p>The nodejs growing very fast recently. New library or framework added to nodejs  almost everyday, since it is very easy to build a nodejs based module and javascript is used very widely.</p>
<p>I have done the A/B testing of nodeJS vs Erlang mochiweb, Erlang misultin, Nginx static page on my poor VM machine, and got the following result:</p>
<p><em>Nodejs helloworld:                     724 qps</em></p>
<p><em>Erlang mochiweb helloworld:     430 qps</em></p>
<p><em>Erlang misultin helloworld:         690 qps</em></p>
<p><em>Nginx static page:                    1045 qps</em></p>
<p>You can see that nodeJS is bloody fast thanks to the good performance of V8 <span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">JavaScript engine.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">Talk about server side javascript, you should say Rhino, but nodejs is 20x faster than Rhino. NodeJS is stable, and not seen a bug of the code, like Nginx. You can build asynchronous system based on nodeJS and drop Tornado. What is important is that you can reuse your code both on client side and server side.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">NodeJS is good at heavy IO usage, but not heavy CPU usage. And you should not change your current web system to nodeJS since it is too young.You can build your JSON interface by NodeJS, construct JSON from data fetched from database or remote web service, output the JSON format result. </span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">Nodejs library:</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/isaacs/npm">npm</a><span> </span>— A node package manager that uses CommonJS-compatible package.json files, written in asynchronous JavaScript.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/visionmedia/express/tree/master">Express</a><span> </span>— A robust feature rich web development framework<span> </span><strong>inspired by Sinatra</strong></span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/tautologistics/nodemachine">nodemachine</a><span> </span>— A port of WebMachine to Node.js</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="http://senchalabs.github.com/connect/">Connect</a><span style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;"> </span></span></span><span style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;"><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;">— A  middleware framework for node</span></span></span><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="http://senchalabs.github.com/connect/"><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><br />
</span></span></a></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/LearnBoost/Socket.IO">Socket.io</a><span> </span>— WebSocket-compatible server and client with fallback for legacy browsers</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/felixge/node-mysql">node-mysql</a><span> </span>— A node.js module implementing the MySQL protocol</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/igo/redis2json/">redis2json</a><span> </span>— Easily loads data from Redis into structured JS object</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">See more:</span></span></p>
<p><a href="https://github.com/joyent/node/wiki/modules">https://github.com/joyent/node/wiki/modules</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/web-development-rookie-nodejs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>谈一谈 Scalability 和可扩展的架构设计模式</title>
		<link>http://blog.eood.cn/scalable_system_patterns</link>
		<comments>http://blog.eood.cn/scalable_system_patterns#comments</comments>
		<pubDate>Sat, 16 Apr 2011 10:37:27 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Scale]]></category>
		<category><![CDATA[可伸缩]]></category>
		<category><![CDATA[架构]]></category>
		<category><![CDATA[模式]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/scalable_system_patterns</guid>
		<description><![CDATA[Scalability 系统的可扩展性是指系统可以平稳的支持增长的业务量。 扩展性很容易理解，比如开发团队的扩展性：一个程序员扩展为 7 人团队，7 人团队扩展为 20 人团队。比如公司业务的扩展性，从几十万的交易额扩展多几百万几千万的交易额。大家都很推崇互联网商业项目的主要原因即是它有很强的扩展性，同样的业务可以从几万的营业额扩展到几亿的营业额，目标客户可以从一个城市扩展到全国或者全世界，这是传统商业无法快速实现的。 WEB 系统的扩展包括： 纵向扩展 硬件方面可以更换更强劲的服务器，增加 CPU ，内存， 使用高速磁盘。 软件方面可以对现有代码的优化，重构。使用 Non-Blocking 非阻塞 IO 模式，或者异步 IO 模式，使用线程模式或者改用 事件驱动形模式。 目标是提高单机 qps ，连接数，来支持更多的连接，更多的用户，更多的业务量。 横向扩展 使用集群，更多的服务器代替单一服务器。 可扩展系统设计模式 负载均衡 这种模式将请求分发到并行的处理机上。要求程序 无状态 ，请求对于每个处理机都应该是相同的。比如常见的 REST 模式既是 无状态 模式。 分散聚集模式 这种模式将请求分发到多个处理机上，然后收集每个处理机返回的结果，得到整合的结果。比如Map-reduce也可以看做这种模式。 结果缓存 这种模式，首先查看请求是不是发生过，如果发生过则直接返回之前的结果，来节约处理时间。这种模式非常常见比如静态页面的 反向代理 ，各层级的 CACHE。 共享空间 所有的处理机监控共享空间中的未处理信息，处理完后将结果提交到共享空间，直到整个任务完成。 MAP REDUCE 这种模式通常用来解决 IO 密集型的业务，通过并行化的分布式系统来解决 IO 瓶颈。 队列模式 每个处理机从待处理队列提取任务进行处理然后将结果保存到已处理队列，多个处理机可以并行处理队列任务。 [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Scalability </strong></span>系统的可扩展性是指系统可以平稳的支持增长的业务量。</p>
<p>扩展性很容易理解，比如开发团队的扩展性：一个程序员扩展为 7 人团队，7 人团队扩展为 20 人团队。比如公司业务的扩展性，从几十万的交易额扩展多几百万几千万的交易额。大家都很推崇互联网商业项目的主要原因即是它有很强的扩展性，同样的业务可以从几万的营业额扩展到几亿的营业额，目标客户可以从一个城市扩展到全国或者全世界，这是传统商业无法快速实现的。</p>
<p><strong><span style="font-size: medium;">WEB 系统的扩展包括：</span></strong></p>
<p><strong>纵向扩展</strong></p>
<p>硬件方面可以更换更强劲的服务器，增加 CPU ，内存， 使用高速磁盘。</p>
<p>软件方面可以对现有代码的优化，重构。使用 Non-Blocking 非阻塞 IO 模式，或者异步 IO 模式，使用线程模式或者改用 事件驱动形模式。</p>
<p>目标是提高单机 qps ，连接数，来支持更多的连接，更多的用户，更多的业务量。</p>
<p><strong>横向扩展</strong></p>
<p>使用集群，更多的服务器代替单一服务器。</p>
<p><strong><span style="font-size: medium;">可扩展系统设计模式</span></strong></p>
<p><strong>负载均衡</strong></p>
<p>这种模式将请求分发到并行的处理机上。要求程序 <strong>无状态 </strong>，请求对于每个处理机都应该是相同的。比如常见的 REST 模式既是 <strong>无状态</strong> 模式。</p>
<p><strong>分散聚集模式</strong></p>
<p>这种模式将请求分发到多个处理机上，然后收集每个处理机返回的结果，得到整合的结果。比如Map-reduce也可以看做这种模式。</p>
<p><strong>结果缓存</strong></p>
<p>这种模式，首先查看请求是不是发生过，如果发生过则直接返回之前的结果，来节约处理时间。这种模式非常常见比如静态页面的 反向代理 ，各层级的 CACHE。</p>
<p><strong>共享空间</strong></p>
<p>所有的处理机监控共享空间中的未处理信息，处理完后将结果提交到共享空间，直到整个任务完成。</p>
<p><strong>MAP REDUCE</strong></p>
<p>这种模式通常用来解决 IO 密集型的业务，通过并行化的分布式系统来解决 IO 瓶颈。</p>
<p><strong>队列模式</strong></p>
<p>每个处理机从待处理队列提取任务进行处理然后将结果保存到已处理队列，多个处理机可以并行处理队列任务。</p>
<p><span style="font-size: medium;"><strong>可扩展系统设计的要点</strong></span></p>
<p>1. 快速失效并返回错误</p>
<p>2. 将复杂的大的请求分解成多个小请求</p>
<p>3. 利用 超时</p>
<p>4. 利用 缓存</p>
<p>5. 用队列来做缓冲</p>
<p>6. 精确测量每个步骤，记录详细日志</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/scalable_system_patterns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON JSON-RPC 和 JSONP</title>
		<link>http://blog.eood.cn/json-json-rpc-%e5%92%8c-jsonp</link>
		<comments>http://blog.eood.cn/json-json-rpc-%e5%92%8c-jsonp#comments</comments>
		<pubDate>Sat, 16 Apr 2011 09:31:44 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[JSONP]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1655</guid>
		<description><![CDATA[虽然用文本格式来通信比较昂贵，但是如今这方面的费用越来越便宜。应该在游戏这样数据量很大的应用中使用二进制数据进行通信，而在普通 WEB 应用中使用文本格式的数据来通信。在架构中应该尽量使用 JSON 而不是 XML 作为通信协议。 用 JSON 作为文本通信格式有很多好处： JSON 就是 Javascript 中的一个对象，很容易把一个 JS 对象转换成 JSON 格式的数据 在JS 中进行对象和 JSON 的转换： var myJSONText = JSON.stringify(myObject, replacer); var myObject = eval('(' + myJSONtext + ')'); 在 jQuery中进行对象和 JSON 的转换： var obj = jQuery.parseJSON('{"name":"John"}'); alert( obj.name === "John" ); 用 JSON-RPC 替代 XML-RPC 通常会把数据减小到 30% 左右 [...]]]></description>
			<content:encoded><![CDATA[<p>虽然用文本格式来通信比较昂贵，但是如今这方面的费用越来越便宜。应该在游戏这样数据量很大的应用中使用二进制数据进行通信，而在普通 WEB 应用中使用文本格式的数据来通信。在架构中应该尽量使用 JSON 而不是 XML 作为通信协议。</p>
<p>用 JSON 作为文本通信格式有很多好处：</p>
<p><strong>JSON 就是 Javascript 中的一个对象，很容易把一个 JS 对象转换成 JSON 格式的数据</strong></p>
<p>在JS 中进行对象和 JSON 的转换：</p>
<pre class="prettyprint">
var myJSONText = JSON.stringify(myObject, replacer);
var myObject = eval('(' + myJSONtext + ')');
</pre>
<p>在 jQuery中进行对象和 JSON 的转换：</p>
<pre class="prettyprint">
var obj = jQuery.parseJSON('{"name":"John"}');
alert( obj.name === "John" );
</pre>
<p><strong>用 JSON-RPC 替代 XML-RPC 通常会把数据减小到 30% 左右</strong></p>
<p>JSON-RPC 请求的例子</p>
<pre class="prettyprint">
Client: { "method": "echo", "params": ["blog.eood.cn", "Hello JSON-RPC"], "id": 1}
Server: { "result": "Hello JSON-RPC", "error": null, "id": 1}
</pre>
<p><strong>nodeJS 中对 JSON-RPC 做了支持</strong></p>
<p>见 https://github.com/ericflo/node-jsonrpc</p>
<p>在 nodeJS 中创建 JSON-RPC 的服务端</p>
<pre class="prettyprint">
var rpc = require('jsonrpc');
function add(first, second) {
&nbsp;&nbsp; &nbsp;return first + second;
}
rpc.expose('add', add);
rpc.listen(8000, 'localhost');
</pre>
<p>在 nodeJS 中创建 JSON-RPC 的客户端</p>
<pre class="prettyprint">
var rpc = require('jsonrpc');
var sys = require('sys');
var client = rpc.getClient(8000, 'localhost');
client.call('add', [1, 2], function(result) {
sys.puts('1 + 2 = ' + result);
});
</pre>
<p><strong>PHP 中也有支持 JSON-RPC 的类库 </strong></p>
<p>见 http://www.jsonrpcphp.org/?page=example&amp;lang=en</p>
<p><strong>关于 JSONP</strong></p>
<p>JSONP 是跨域 AJAX 通信的方式</p>
<p>jQuery 做 JSONP 请求和普通 AJAX 请求几乎一致</p>
<pre class="prettyprint">
$.ajax({
&nbsp;&nbsp;&nbsp; url: "http://blog.eood.cn/jsonp.json",
&nbsp;&nbsp;&nbsp; dataType: '<strong>jsonp</strong>',
&nbsp;&nbsp;&nbsp; success: function(results){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...
&nbsp;&nbsp;&nbsp; }
});
</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/json-json-rpc-%e5%92%8c-jsonp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scale Your Web Service Database With Amazon SimpleDB</title>
		<link>http://blog.eood.cn/scale-your-web-service-database-with-amazon-simpledb</link>
		<comments>http://blog.eood.cn/scale-your-web-service-database-with-amazon-simpledb#comments</comments>
		<pubDate>Fri, 25 Feb 2011 09:38:48 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[NoSql]]></category>
		<category><![CDATA[SimpleDB]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1593</guid>
		<description><![CDATA[Amazon SimpleDB is a good choice for your Web application for its scalable, high avaliable, zero-configuration, schemaless. It&#8217;s ready to use. SimpleDB is written in Erlang. Pricing Utilization-based pricing. No charge for up to 1GB of ingres+egress, 25 machine hours, and 1GB storage. Performance Average put rate: 70 singleton puts/domain/sec Netflix staff has forklift 1 [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon SimpleDB is a good choice for your Web application for its scalable, high avaliable, zero-configuration, schemaless. It&#8217;s ready to use. SimpleDB is written in Erlang.</p>
<p><strong>Pricing</strong></p>
<p>Utilization-based pricing.</p>
<p>No charge for up to 1GB of ingres+egress, 25 machine hours, and 1GB storage.</p>
<p><strong>Performance</strong></p>
<p>Average put rate: 70 singleton puts/domain/sec</p>
<p><a href="http://practicalcloudcomputing.com/post/284222088/forklift-1b-records">Netflix staff</a> has forklift 1 billion rows into SimpleDB with a average rate: 10-11K items/sec.</p>
<p><strong>Limits</strong></p>
<table style="border: 0.25px solid #cccccc;" border="0" cellspacing="0">
<thead>
<tr>
<th style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #333333; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top; background-color: #eeeeee; font-weight: bold; text-align: left;">Parameter</th>
<th style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #333333; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top; background-color: #eeeeee; font-weight: bold; text-align: left;">Restriction</th>
</tr>
</thead>
<tbody>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Domain size</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">10 GB per domain</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Domain size</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">1 billion attributes per domain</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Domain name</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">3-255 characters (a-z, A-Z, 0-9, &#8216;_&#8217;, &#8216;-&#8217;, and &#8216;.&#8217;)</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Domains per account</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">100</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attribute name-value pairs per item</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">256</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attribute name length</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">1024 bytes</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attribute value length</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">1024 bytes</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Item name length</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">1024 bytes</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attribute name, attribute value, and item name allowed characters</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">
<p class="simpara" style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; margin-bottom: 1em; margin-top: 0px;">All UTF-8 characters that are valid in XML documents.</p>
<p class="simpara" style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; margin-bottom: 0px; margin-top: -0.4em;">Control characters and any sequences that are not valid in XML are returned Base64-encoded. For more information, see<span class="Apple-converted-space">&nbsp;</span><a class="xref" style="color: #004b91; text-decoration: none; padding: 3px;" title="Working with XML-Restricted Characters" href="http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/InvalidCharacters.html">Working with XML-Restricted Characters</a>.</p>
</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attributes per<span class="Apple-converted-space">&nbsp;</span><code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">PutAttributes</code><span class="Apple-converted-space">&nbsp;</span>operation</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">256</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Attributes requested per<span class="Apple-converted-space">&nbsp;</span><code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">Select</code><span class="Apple-converted-space">&nbsp;</span>operation</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">256</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Items per<span class="Apple-converted-space">&nbsp;</span><code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">BatchPutAttributes</code>operation</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">25</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Maximum items in<span class="Apple-converted-space">&nbsp;</span><code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">Select</code>response</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">2500</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Maximum query execution time</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">5 seconds</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Maximum number of unique attributes per<code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">Select</code>expression</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">
<p class="simpara" style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; margin-bottom: 0px; margin-top: 0px;">20</p>
</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Maximum number of comparisons per<code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">Select</code>expression</td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">
<p class="simpara" style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; margin-bottom: 0px; margin-top: 0px;">20</p>
</td>
</tr>
<tr>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">Maximum response size for<span class="Apple-converted-space">&nbsp;</span><code class="code" style="font-family: 'Courier New',Courier,mono; font-size: 12px;">Select</code></td>
<td style="font-family: verdana,sans-serif,arial; font-size: 12px; color: #000000; padding: 5px; border: 0.25px solid #cccccc; vertical-align: top;">1MB</td>
</tr>
</tbody>
</table>
<p>And not support for joins, full text search.</p>
<p><strong>Query examples:</strong></p>
<blockquote><p>select itemName() from log where itemName() like &#8220;77-11232%&#8221;</p>
<p>select * from log where itemName() like &#8220;%:1169:%&#8221; order by itemName() asc</p>
<p>SELECT * FROM songs WHERE Year BETWEEN &#8217;1980&#8242; AND &#8217;2000&#8242;</p>
<p>SELECT * FROM songs WHERE itemName() IS NOT NULL ORDER BY itemName() DESC</p>
<p>SELECT count(*) FROM songs WHERE Year &lt; &#8217;2000&#8242;</p>
</blockquote>
<p><strong>Firefox SimpleDB management extension:</strong></p>
<p>SDB Tool: <a href="http://code.google.com/p/sdbtool/">http://code.google.com/p/sdbtool/</a></p>
<p>&nbsp;</p>
<ul>
<li>Amazon SimpleDB PHP class:&nbsp; <a href="http://sourceforge.net/projects/php-sdb/">http://sourceforge.net/projects/php-sdb/</a></li>
<li>Examples of usage of SimpleDB PHP class: <a href="http://webmasterinresidence.ca/simpledb/">http://webmasterinresidence.ca/simpledb/</a></li>
<li>Amazon S3 PHP class: <a href="http://undesigned.org.za/2007/10/22/amazon-s3-php-class">http://undesigned.org.za/2007/10/22/amazon-s3-php-class</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/scale-your-web-service-database-with-amazon-simpledb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal 高效部署和维护</title>
		<link>http://blog.eood.cn/drupal-server-admin</link>
		<comments>http://blog.eood.cn/drupal-server-admin#comments</comments>
		<pubDate>Sun, 09 Jan 2011 03:00:17 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1529</guid>
		<description><![CDATA[Drupal 是由很小的核心和几千个实现不同功能的模块组成，无论要实现什么功能，几乎都可以通过找到模块来实现。但是一个中等的系统会需要几十个或者上百个模块。所以Drupal 模块的部署和维护必须通过高效的方式来实现。 Drupal 提供了两种不同的部署方式，你可以通过命令行来部署，或者通过传统的WEB界面来维护。 本文只介绍命令行的方式。Drupal 有命令行维护工具 Drush 。通过Drush来维护系统是Drupal众多优秀的特性之一，它类似于Django中命令行自动生成数据库结构，或者PECL安装PHP的扩展模块，或者yum来维护Linux软件包。只需要一行命令就可以安装系统，或者下载一个模块。 1. Drush的安装： 对于Drupal6.x,下载Drush模块，并且解压即可： $ cd ~ $ wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz $ tar zxvf drush-6.x-3.3.tar.gz $ ln -s /path/to/drush/drush /usr/local/bin/drush 这样你可以在任何目录执行drush命令。 2. 用Drush来下载安装Drupal： 你不需要从Drupal网站下载安装包，上传到FTP，再配置数据库，从WEB界面安装： 下载并且解压Drupal包： $ drush dl 安装Drupal $ drush is 安装CCK $ drush dl cck $ drush en cck 清空cache可能是开发中最常用的功能： $ drush cc 查看watchdog信息： $ drush [...]]]></description>
			<content:encoded><![CDATA[<p>Drupal 是由很小的核心和几千个实现不同功能的模块组成，无论要实现什么功能，几乎都可以通过找到模块来实现。但是一个中等的系统会需要几十个或者上百个模块。所以Drupal 模块的部署和维护必须通过高效的方式来实现。</p>
<p>Drupal 提供了两种不同的部署方式，你可以通过命令行来部署，或者通过传统的WEB界面来维护。</p>
<p>本文只介绍命令行的方式。Drupal 有命令行维护工具 <a href="http://drupal.org/project/drush" target="_blank">Drush</a> 。通过Drush来维护系统是Drupal众多优秀的特性之一，它类似于Django中命令行自动生成数据库结构，或者PECL安装PHP的扩展模块，或者yum来维护Linux软件包。只需要一行命令就可以安装系统，或者下载一个模块。</p>
<p><strong>1. Drush的安装：</strong></p>
<p>对于Drupal6.x,下载Drush模块，并且解压即可：</p>
<p>$ cd ~</p>
<p>$ wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz</p>
<p>$ tar zxvf drush-6.x-3.3.tar.gz</p>
<p>$ ln -s /path/to/drush/drush /usr/local/bin/drush</p>
<p>这样你可以在任何目录执行drush命令。</p>
<p><strong>2. 用Drush来下载安装Drupal：</strong></p>
<p>你不需要从Drupal网站下载安装包，上传到FTP，再配置数据库，从WEB界面安装：</p>
<p>下载并且解压Drupal包：</p>
<p>$ drush dl</p>
<p>安装Drupal</p>
<p>$ drush is</p>
<p>安装CCK</p>
<p>$ drush dl cck</p>
<p>$ drush en cck</p>
<p>清空cache可能是开发中最常用的功能：</p>
<p>$ drush cc</p>
<p>查看watchdog信息：</p>
<p>$ drush ws</p>
<p>执行cron</p>
<p>$ drush cron</p>
<p>更多drush命令：http://drush.ws</p>
<p><strong>推荐用Drush来部署和维护Drupal</strong></p>
<p>所有模块的安装维护仅仅需要1-2行命令,不必在忍受WEB界面网速的问题。我们需要用最好最快的方式来节约时间，提高效率。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/drupal-server-admin/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.596 seconds. -->
<!-- File not cached! Super Cache Couldn't write to: wp-content/cache/wp-cache-ecc309b97b7003027dfe5195118cf45b.html -->

