摘自:http://pronewb.com/mongodb-as-in-humongous-not-retarded

Unlike the rest of the known world, I won’t write anything on the iPad. Yet. Instead, I’m still in the process of writing the upcoming parts of my Popurls Clone series and as per usual, it takes a lot more time than expected. In combination with a massive amount of bills, life is good! As it turns out, you actually need to “work” in order to get “money”. How, when and why did we agree upon that? That’s just as stupid as, say, doing a fully animated Star Wars prequel/sequel to take place during the Clone Wars. Oh, wait… While pondering life’s great mysteries, such as how you can evade paying your bills, I felt it was time to write something about databases. You see the connection, right? Good, because I don’t. A quick Google search for MySQL rendered roughly 117 million results so I figured that another article about it would be kinda superfluous. A search for MongoDB on the other hand resulted in “only” 1,2 million results. Much better. That means that if and when this article gets indexed by the Google, it will constitute no less than ~ 8.33 × 10-7 % of the relevant search results, in stark contrast to the ~ 5.88 × 10-9 %, should I’ve written some stuff about MySQL. Goodie! In short, this article will cover MongoDB and how you can use it with PHP. Good times ahead so if you’re a killjoy, you’re not welcome.


阅读全文

记住几个bash快捷键,可以极高的提高工作效率~~

下面开始了~~

Ctrl-A 用于将光标定位到本行最前面,相当于编辑器中用HOME键

Ctrl-E 即将光标移动到本行末尾,相当于End键

Ctrl-B 用于将光标向左移动一格,相当于左箭头键

Ctrl-F 用于将光标向右移动一格,相当于右箭头键

Ctrl-D 即删除光标所在处的字符,相当于Del键

Ctrl-K 用于删除从光标处开始到结尾处的所有字符

Ctrl-L 清屏,相当于clear命令

Ctrl-R 进入历史命令查找状态,然后你输入几个关键字符,就可以找到你使用过的命令


阅读全文

奥坎氏简化论,又称奥卡姆剃刀(Occam’s Razor, Ockham’s Razor),是由14世纪逻辑学家、圣方济各会修士奥卡姆的威廉(William of Occam)提出的一个原理。奥卡姆(Ockham)在英格兰的萨里郡,那是他出生的地方。

这个原理称为“如无必要,勿增实体”(Entities should not be multiplied unnecessarily)。有时为了显示其权威性,人们也使用它原始的拉丁文形式:

_Pluralitas non est ponenda sine necessitate.

Frustra fit per plura quod potest fieri per pauciora.

Entia non sunt multiplicanda praeter necessitatem._

事实上,只有前两种形式见于他现存的著作中,而第三种形式则由后来的一位学者撰写。威廉使用这个原理证明了许多结论,包括“通过思辨不能得出上帝存在的结论”。这使他不受罗马教皇的欢迎。


阅读全文

作者写下这篇文章的用意,就是提醒广大DBA不要重蹈覆辙。特别是MongoDB初学者需要注意这四个技巧,会避免你走很多弯路。

我之所以喜欢MongoDB,主要是因为在动态语言中使用它是如此的简单,自然。到目前为止,我已经在两个项目(Encode 和 Sparrw)中使用过它了,虽然对这个选择我非常满意,但是有些问题我还是没有注意到,这些问题让我抓了好几个小时的头皮才解决。如果你有多台机器,然后为数据库多分配几台机器,那么有些问题可以迎刃而解,但是我的项目是运行在单个(虚拟)服务器之上的低流量Web应用程序。

(关于MongoDB,具体可以参考:http://www.mongodb.org/)

(关于作者的两个项目Encode 和 Sparrw,分别可以参考:http://en.co.de/和http://sparrw.com/)

这些问题都很简单,都是一些文档化的东西,不是什么Bug(当然,这要看你问谁了)。如果你读过所有的文档,那么这些问题可能你基本都见过了。我也是,但是在那之后,当再次遇到它们的时候,我就把文档中的内容都忘到脑后了,然后,我不得不再次修复它们。


阅读全文

Mongo是一个高性能,开源,无模式的文档型数据库,它在许多场景下可用于替代传统的关系型数据库或键/值存储方式。Mongo使用C++开发,提供了以下功能:

◆面向集合的存储:适合存储对象及JSON形式的数据。

◆动态查询:Mongo支持丰富的查询表达式。查询指令使用JSON形式的标记,可轻易查询文档中内嵌的对象及数组。

◆完整的索引支持:包括文档内嵌对象及数组。Mongo的查询优化器会分析查询表达式,并生成一个高效的查询计划。

◆查询监视:Mongo包含一个监视工具用于分析数据库操作的性能。


阅读全文

作者的图片

DigDeeply

Technology Stack: PHP/Openresty/GoLang, and so on…

Web Development Engineer

Beijing China