ITeye博客

片甲

weiweirenhong · 共 27 篇文章

mongodb schema design

数据模型的创建,相对于传统关系型数据库而言,mongodb没有严格的设计模式,这是因为模式设计或我们称之为数据建模的成败往往是取决于实际系统的需求,很多时候需求是不同的,所以反而使得数据模型的创建各有所不同,很难说存在一套标准的数据建模方法。 mongodb schema design 时需要考虑: 问题1、数据模型最小单位是什么? 关系型数据库:数据存放在表中,以字段和行的形式存储。 mongoDB: 数据模型的最小单位是document对象。 问题2、你将如何查询和更新数据? 关系型数据库: 查询数据:ad hoc和 联合查询的方式。 数据更新:使用SQL以及事务管理的方式来实现。 mo…

2012-02-26 11:31 · mongoDB · 评论(0)

NOSQL数据库代表:couchDB

最近花了些时间关注couchDB,对它的特点做以下总结 一、key/value型 分布式数据库。 二、支持海量数据存储,提供高于传统数据库性能优势。 三、按照CAP原理:支持 分区容忍性 和 数据可用性 。 四、数据一致性:couchDB支持数据 最终一致性 。 五、提供 rest 方式数据访问API,个人感觉可以很大程度简化开发过程。 六、支持不同节点数据库之间的数据增量复制。 七、数据格式json,更开放。 八、贴切移动开发,提供android和IOS版 客户端数据库。 九、数据格式无限制,free-schema,系统扩展更便利。 十、支持云计算。 以上好像都是有优点了,难道没缺点吗? …

2011-12-30 14:19 · couchDB · 评论(0)

map/reduce

map函数: 它的输入是一个LIST 数据集合;它的输出也是一个LIST数据集合。 该函数中常常是调用内置emit函数,emit函数通常有两个参数(key,value), map函数最终执行结果是输出一个LIST数据集合,其中每条数据格式必定是emit函数的参数key,value所对应的数据(key,value)。 综合而言,map函数的作用是生成某类doc数据的索引视图,视图中的key 和value 完全可以用emit函数的两个参数来约定。例如:可以用doc.type来指定需要关注的doc数据的类型,然后用doc.id,doc.descript分别作为emit函数的两个参数。那么这个map…

2011-12-20 17:48 · couchDB · 评论(0)

Intents and Intent Filters--Intent filters

Intent filters To inform the system which implicit intents they can handle, activities, services, and broadcast receivers can have one or more intent filters. Each filter describes a capability of the component, a set of intents that the component is willing to receive. It, in effect, filters in in…

2010-09-03 10:21 · android2.2 · 评论(0)

Intents and Intent Filters---Intent Resolution

Intent Resolution Intents 可以分成两类: 1、**Explicit intents **(显式intents-指定了目标组件名) designate the target component by its name (the component name field, mentioned earlier, has a value set). Since component names would generally not be known to developers of other applications, explicit intents are typic…

2010-09-03 09:45 · android2.2 · 评论(0)

Intents and Intent Filters---Intent Objects

Intent Objects An Intent object is a bundle of information. It contains information of interest to the component that receives the intent (such as the action to be taken and the data to act on) plus information of interest to the Android system (such as the category of component that should handle …

2010-09-02 11:15 · android2.2 · 评论(0)

Intents and Intent Filters---序言

Intents and Intent Filters Key classes Intent IntentFilter Activity Service BroadcastReceiver PackageManager 本文中将包含以下内容: Intent Objects Intent Resolution Intent filters Common cases Using intent matching Note Pad Example Three of the core components of an application — activities, services, and bro…

2010-09-01 16:06 · android2.2 · 评论(0)

Application Fundamentals--Processes and lifecycles(进程生命周期)

Processes and lifecycles---进程生命周期 The Android system tries to maintain an application process for as long as possible, but eventually it will need to remove old processes when memory runs low. To determine which processes to keep and which to kill, Android places each process into an "importance hi…

2010-08-30 09:23 · android2.2 · 评论(0)

Application Fundamentals--Broadcast receiver lifecycle(广播接收组件生命周期)

Broadcast receiver lifecycle---广播接收组件生命周期 A broadcast receiver has single callback method:--翻译:广播接收组件只有唯一一个回调方法: void onReceive(Context curContext, Intent broadcastMsg) When a broadcast message arrives for the receiver, Android calls its onReceive()广播接收组件 method and passes it the Intent object cont…

2010-08-30 09:20 · android2.2 · 评论(0)

Application Fundamentals--Service lifecycle(服务组件的生命周期)

Service lifecycle--服务组件的生命周期 A service can be used in two ways--翻译:服务组件有两种使用方式: * It can be started and allowed to run until someone stops it or it stops itself. In this mode, it's started by calling Context.startService() and stopped by calling Context.stopService(). It can stop itself by calling …

2010-08-30 09:18 · android2.2 · 评论(0)

Application Fundamentals--Coordinating activities(activity实例间协调)

Coordinating activities---activity实例间协调 When one activity starts another, they both experience lifecycle transitions. One pauses and may stop, while the other starts up. On occasion, you may need to coordinate these activities, one with the other.【翻译:当一个activity实例发出intent请求去启动另外一个activity实例的时候,这两个实…

2010-08-30 09:15 · android2.2 · 评论(0)

Application Fundamentals--Saving activity state(保存activity实例的状态信息)

Saving activity state--保存activity实例的状态信息 When the system, rather than the user, shuts down an activity to conserve memory, the user may expect to return to the activity and find it in its previous state.【翻译:系统需要更多内存资源的时候会销毁activity实例,用户希望系统能够在实例重新回到前台的时候能恢复之前的状态信息。】 To capture that state before the…

2010-08-27 10:06 · android2.2 · 评论(0)

Application Fundamentals--Component Lifecycles(组件生命周期)

Component Lifecycles--组件生命周期 Application components have a lifecycle — a beginning when Android instantiates them to respond to intents through to an end when the instances are destroyed. In between, they may sometimes be active or inactive,or, in the case of activities, visible to the user or invi…

2010-08-27 09:56 · android2.2 · 评论(0)

Application Fundamentals--Thread-safe methods(线程安全方法)

Thread-safe methods--线程安全方法 In a few contexts, the methods you implement may be called from more than one thread, and therefore must be written to be thread-safe. 翻译:某些场景下,方法的实现需要考虑线程安全。 This is primarily true for methods that can be called remotely — as in the RPC mechanism discussed in the previo…

2010-08-27 09:51 · android2.2 · 评论(0)

Application Fundamentals--Remote procedure calls(远程过程调用)

Remote procedure calls--远程过程调用 Android has a lightweight mechanism for remote procedure calls (RPCs) — where a method is called locally, but executed remotely (in another process), with any result returned back to the caller. This entails decomposing the method call and all its attendant data to a …

2010-08-27 09:41 · android2.2 · 评论(0)