存档

文章标签 ‘NOSQL’

Daniel-Journey Weekly Dose- 2011/8/7

2011年8月7日 admin 没有评论

投资

“闪电打下来时你必须在场”——彼得.林奇

美国1926年到1996年长达70年的资本市场,上涨的月份只有7%,其他的月份都是下跌或者是横盘。真正的投资者,只有在93%时间里要熬得住,才能抓住这7%的时间。

 

A股市盈率:998点16.44倍;1664点12.69倍;2319点16.43倍;11年1月25日2661点17.41倍;剔除金融板块A股PE为23.88倍。昨天8月4日上交所公布的PE16.05倍!目前PE离1664差20%,如跌到1664PE对应点位是2122点。16倍是估值底,12倍是铁底!2000点一线是绝对铁底不会破!

观后镜人性的弱点:2008年让大家认识到本金的安全性是第一位的,然后2009年股指翻倍。2009年让大家认识到牛市谁也跑不赢沪深300,然后2010年小股票结构性行情。2010年让大家认识到消费新兴和小股票才是硬道理,然后2011年蓝筹白马股领涨。投资人总是不断总结,只可惜是从观后镜中总结。—邱国鹭

“即使最优秀的棒球击球员也只有30%的成功几率。在股市中,没有一个短线投资者可以永远正确。事实上,如果一个短线投资者在自己的投资失误的交易上迅速止损,那么即使他在10次交易中只有3~4次的正确几率,他也能够赚到大钱。”—投资大师巴鲁克

 

Linux

理解Linux系统负荷

 

NOSQL

http://blog.nosqlfan.com/html/2720.html

分类: 阅读 标签: , ,

Windows 下安装Cassandra 0.8

2011年6月19日 admin 没有评论

安装Cassandra

1.从 http://cassandra.apache.org/download/ 下载0.8版本的Cassandar安装包

2. unzip 安装到 cassandar的安装目录

3.修改在cassandar的conf目录中的cassandra.yaml文件,修改data_file_directories,commitlog_director,saved_caches_directory三个配置项,保证配置项路径合法有效

4.修改log4j-server.properties文件log4j.appender.R.File配置项,保证配置项值合法有效

体验安装

1.在cassandar的安装目录的bin目录下,用cassandra.bat 启动cassandra。

如果提示:INFO 15:44:38,596 Listening for thrift clients…

恭喜你,cassandra已经启动成功了。

2.在cassandar的安装目录的bin目录下,用cassandra-cli –host localhost –port 9160连接cassandra。

如果客户端提示:

Welcome to the Cassandra CLI.

Type ‘help;’ or ‘?’ for help.
Type ‘quit;’ or ‘exit;’ to quit.

恭喜你,客户端已经成功跟cassandra服务器关联了.

3. 简单的Demo

  • 首先创建一个Keyspace.
     create keyspace Keyspace1;
    use Keyspace1;
    create column family users with comparator = UTF8Type and key_validation_class=UTF8Type and column_metadata = [{column_name: password, validation_class: UTF8Type}];
    set users['jsmith']['password']='ch@ngem3';

    如果客户端提示"Value inserted",恭喜你这条记录已经成功记录到Cassandra中了。 再验证一下

  • get users['jsmith']['password'];

    系统返回=> (column=password, value=ch@ngem3, timestamp=1308469951656000)

    这就是刚才我们插入的那条记录。

分类: NOSQL 标签: ,

Daneil-Journey Weekly Dose-2010/10/3

2010年10月10日 admin 没有评论

Scalability

多IDC的数据分布设计(一)

多IDC的数据分布设计(二)

CAP原理与最终一致性

OO & Design Pattern

视角的力量–再说OO设计原则

Martin Fowler在他的著作 《UML Distilled》中提到了三层视角(perspective):概念视角,规约视角,实现视角。

使用三种视角看软件开发,我们可以得到这样的描述:

概念视角:呈现所研究领域中的各种概念,得出概念模型的时候应该尽量少德或者不考虑它的实现,这个视角要回答的问题是:软件要负责什么?是策略性的结论

规约视角:我们现在考虑的是软件,但是我们关注的是软件的接口而不是实现。规约视角要回答的问题是:怎么使用软件?这个层次关注的是软件各部分的交流。

实现:这时我们考虑的是代码本身但是许多方面我们使用规约视角可能会更好,软件在规约层交流在实现层执行。

视角帮助我们将问题划分层次,隔离

从上面的描述我们很明显得看到“软件开发”所设计牵扯的问题已经被划分到三个不同的层次,在每一个层次我们都要有特定的思考成果。在高层没有思考成熟的时候我们不往下一个层次进行,按照这样一个原则,细节被隔离在思维的围墙之外。

Active Object 并发模式在 Java 中的应用

Architecture

如何做好软件系统的架构设计?

Tomcat 系统架构与设计模式,第 1 部分: 工作原理

Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析

Java

Installing Multiple Eclipse Plugins with Ease

NOSQL

MapReduce: 一个巨大的倒退

Algorithm

拜占庭将军问题

拜占庭假设是对现实世界的模型化,由于硬件错误、网络拥塞或断开以及遭到恶意攻击,计算机和网络可能出现不可预料的行为。拜占庭容错协议必须处理这些失效,并且这S些协议还要满足所要解决的问题要求的规范。这些算法通常以其弹性t作为特征,t表示算法可以应付的错误进程数。 很多经典算法问题只有在t<n/3是才有解,如拜占庭将军问题,其中n是系统中进程的总数

如果要想容忍m个判国者,必须保证总的将军的个数大于3m。

产品

新浪内部对腾讯公司的深度解析.pdf

学习腾讯的产品管理之道

其他

如何让PPT的备注演示者看到而观众看不到

Daniel-Journey Weekly Dose-2010/9/20

2010年9月20日 admin 2 条评论
分类: 阅读 标签: , ,

Daniel-Journey Weekly Dose-2010/9/18

2010年9月18日 admin 2 条评论

Daniel-Journey Weekly Dose-2010/5/8

2010年5月9日 admin 没有评论
分类: 阅读 标签: , , , , ,

NO SQL Reading

2010年4月10日 admin 没有评论

That No SQL Thing – Key/Value stores

The simplest No SQL databases are the Key/Value stores.

Concurrency –In Key/Value Store, concurrency is only applicable on a single key, and it is usually offered as either optimistic writes or as eventually consistent. In highly scalable systems, optimistic writes are often not possible, because of the cost of verifying that the value haven’t changed (assuming the value may have replicated to other machines), there for, we usually see either a key master (one machine own a key) or the eventual consistency model.

Queries – there really isn’t any way to perform a query in a key value store, except by the key. Even range queries on the key are usually not possible.

Transactions – while it is possible to offer transaction guarantees in a key value store, those are usually only offer in the context of a single key put. It is possible to offer those on multiple keys, but that really doesn’t work when you start thinking about a distributed key value store, where different keys may reside on different machines. Some data stores offer no transaction guarantees.

Scaling Up – In Key Value stores, there are two major options for scaling, the simplest one would be to shard the entire key space. That means that keys starting in A go to one server, while keys starting with B go to another server. In this system, a key is only stored on a single server. That drastically simplify things like transactions guarantees, but it expose the system for data loss if a single server goes down. At this point, we introduce replication.

Replication – In key value stores, the replication can be done by the store itself or by the client (writing to multiple servers). Replication also introduce the problem of divergent versions. In other words, two servers in the same cluster think that the value of key ‘ABC’ are two different things. Resolving that is a complex issue, the common approaches are to decide that it can’t happen (Scalaris) and reject updates where we can’t ensure non conflict or to accept all updates and ask the client to resolve them for us at a later date (Amazon Dynamo, Rhino DHT).

That No SQL Thing – Key / Value stores – Operations

复习Amazon Dynamo设计的一点分享

Eventual consistency其实是对一致性的一种延展,过程中允许部分不一致,但是在事务处理结束或者有限的时间内保持事务的一致性。一句话简单概括就是:“过程松,结果紧,最终结果必须保持一致性”。

load balance的几种模式

客户端实施load balance。采用客户端包来实现分发算法,同时配置分发节点情况。Memcached Cache客户端使用的一种基本方式。

b. 服务端硬件实现load balance。

c. 客户端改进模式。配制节点以及算法都可以采用集中的Master来管理和维护,包括心跳检测等手段由Master来实现。当然支持Master失效的容错性策略实施。

d. 服务端模式改进。采用preference list来分离接受和处理任务的节点。

首先采用A模式可以防止B模式在单点的情况下出现的不可用风险,也可以减轻高并发下单点的压力,提高效率(这点淘宝的同学有和我提到过,他们采用的“软负载”方式)。但是A模式会增加对于客户端包的依赖性,对于扩展和升级都会有一定的限制。

其次B模式是最省心的方式,扩展性也比较好,但是就是在上面提到的单点问题会有所限制。

C方式是对于A方式的一种改进,我以前的一篇文章中提到过,这样可以提高A的可扩展性以及可维护性,减小对于客户端包的依赖,但是增加了系统复杂度,同时Master也是会有单点的问题,不过问题不大(失效的情况下就是退化到了A模式)。

D方式是解决服务端简单的分发而导致处理的不均衡性,其实这种模式也可以改进客户端的算法。因为通过Hash算法未必能够将压力分摊均匀,就好比一些处理需要耗时比较久一些处理耗时比较少,系统对于key的映射不均衡等等问题,不过在Dynamo中描述的并不很明确,其中的算法还是要根据实际情况来做的。

How I learned to say ‘No’ to SQL

consistent-hashing算法
High Performance Scalable Data Stores

I Can’t Wait for NoSQL to Die

NoSQL DZone Poll Results

分类: 软件设计 标签: