Redis宣言

http://oldblog.antirez.com/post/redis-manifesto.htmlhtml

Redis Manifesto Redis宣言

Many times I don't know what to exactly reply to feature requests, or questions about why things in Redis are done in a specific way. Most of the time the questions make a lot of sense, there is not just a way to make things in programming, a lot is about your taste, feeling, and ideas about how software should be written. So I tried to condense my feelings about Redis and software development in general in this short manifest, that I'll include in the Redis distribution. There are an infinite number of ways of doing things, this is just the one I and a good part of the Redis community like. 
不少时候,我不知道该如何回答为何须要某个特性或者在redis中为何按照这种方式来作。大多数情形下,这些问题没有什么意义。编程不仅是作事的一种方式,还包括你对如何写软件的品味、感情和想法。我把我对Redis和软件开发的感情总结在这个短短的宣言中,这个宣言也将放入Redis发布包中。作事的方法有千万种,这只是其中一种,是Redis社区喜欢的一种。redis

Redis Manifesto

Redis宣言数据库

    • 1 - A DSL for Abstract Data Types. Redis is a DSL (Domain Specific Language) that manipulates abstract data types and implemented as a TCP daemon. Commands manipulate a key space where keys are binary-safe strings and values are different kinds of abstract data types. Every data type represents an abstract version of a fundamental data structure. For instance Redis Lists are an abstract representation of linked lists. In Redis, the essence of a data type isn't just the kind of operations that the data types support, but also the space and time complexity of the data type and the operations performed upon it.
    • 1 - 抽象数据类型的领域特定语言。Redis是一种领域特定语言,用做操做抽象数据类型,采用TCP服务实现。命令用做操做key空间,其中key是二进制串,值是各类各样的抽象数据类型。每种数据类型是基础数据结构的一个抽象版本。例如,Redis的Lists是链表的抽象表示。在Redis中,数据类型本质上不单单是该数据类型支持的操做,还包括该数据类型和相关操做的时间和空间复杂性。
    • 2 - Memory storage is #1. The Redis data set, composed of defined key-value pairs, is primarily stored in the computer's memory. The amount of memory in all kinds of computers, including entry-level servers, is increasing significantly each year. Memory is fast, and allows Redis to have very predictable performance. Datasets composed of 10k or 40 millions keys will perform similarly. Complex data types like Redis Sorted Sets are easy to implement and manipulate in memory with good performance, making Redis very simple. Redis will continue to explore alternative options (where data can be optionally stored on disk, say) but the main goal of the project remains the development of an in-memory database.
    • 2 - 内存存储是线性的。Redis的数据集,由预约义的键值对组成,存储在计算机内存中。各类各样计算的内存总量,包括入门级服务器,每一年都在迅速增加。内存的速度很是快,使得Redis有很是好的性能。包含10K或4000万个键的数据集在处理上是类似的。像Redis有序集合等复杂数据类型很是容易实现,在内存中处理性能也很是好,Redis自己也很是简单。Redis将来将探索其余可替代存储(例如可选择将数据存储在磁盘上)。可是该项目的主要目标是开发基于内存的数据库。
    • 3 - Fundamental data structures for a fundamental API. The Redis API is a direct consequence of fundamental data structures. APIs can often be arbitrary but not an API that resembles the nature of fundamental data structures. If we ever meet intelligent life forms from another part of the universe, they'll likely know, understand and recognize the same basic data structures we have in our computer science books. Redis will avoid intermediate layers in API, so that the complexity is obvious and more complex operations can be performed as the sum of the basic operations.
    • 3 - 基础的数据结构使用基本的API。Redis的API是基本数据结构的基本操做。通常来讲API是任意的,但不是任何API都属于基础数据结构的基本操做。
    • 4 - Code is like a poem; it's not just something we write to reach some practical result. Sometimes people that are far from the Redis philosophy suggest using other code written by other authors (frequently in other languages) in order to implement something Redis currently lacks. But to us this is like if Shakespeare decided to end Enrico IV using the Paradiso from the Divina Commedia. Is using any external code a bad idea? Not at all. Like in "One Thousand and One Nights" smaller self contained stories are embedded in a bigger story, we'll be happy to use beautiful self contained libraries when needed. At the same time, when writing the Redis story we're trying to write smaller stories that will fit in to other code.
    • 4 - 代码如诗,不单单是为了作些实际事情而写出来的一些东西。有事,背离Redis哲学的人,建议用其余做者的哲学(经常是来自其余语言)来实现Redis缺少的特性。这对咱们来讲,就像莎士比亚决定使用但丁的神曲(Divina Commedia)中的Paradiso来结束Enrico IV(<<亨利四世>>)。是否是使用任何外部的代码都是错误的呢?不是的。像<<一千零一晚上>>同样,小的自足的的故事包含在了更大的故事中,咱们很是乐意在须要时使用自足的小库。同时,在撰写Redis的故事时,咱们也试图撰写是和其余项目的更小的故事。
    • 5 - We're against complexity. We believe designing systems is a fight against complexity. We'll accept to fight the complexity when it's worthwhile but we'll try hard to recognize when a small feature is not worth 1000s of lines of code. Most of the time the best way to fight complexity is by not creating it at all.
    • 5 - 咱们反对复杂性。咱们认为,设计系统就是和复杂性打仗。在值得的地方咱们愿意处理复杂性,可是咱们不会实现一个须要1000多行代码的小特性。大多数时候,处理复杂性的最好方式就是不处理。
    • 6 - Two levels of API. The Redis API has two levels: 1) a subset of the API fits naturally into a distributed version of Redis and 2) a more complex API that supports multi-key operations. Both are useful if used judiciously but there's no way to make the more complex multi-keys API distributed in an opaque way without violating our other principles. We don't want to provide the illusion of something that will work magically when actually it can't in all cases. Instead we'll provide commands to quickly migrate keys from one instance to another to perform multi-key operations and expose the tradeoffs to the user.
    • 6 - 两级API。Redis的API包含两级:1)API的一个子集,适合包含在Redis发布版本中,2)比较复杂的API,支持多key操做。
    • 7 - We optimize for joy. We believe writing code is a lot of hard work, and the only way it can be worth is by enjoying it. When there is no longer joy in writing code, the best thing to do is stop. To prevent this, we'll avoid taking paths that will make Redis less of a joy to develop.
    • 7 - 咱们偏心快感。咱们认为写代码须要大量艰难的工做,值得如此作的惟一理由是从中得到快感。当你从编码中不能得到快感时,最好的方式就是中止吧。为了防止如此,咱们避免将Redis的开发进入一个缺少快感的歧路中。
相关文章
相关标签/搜索