17441fcddSantirez[Note: this is the Redis manifesto, for general information about 27441fcddSantirez installing and running Redis read the README file instead.] 37441fcddSantirez 47441fcddSantirezRedis Manifesto 57441fcddSantirez=============== 67441fcddSantirez 7*3244d8bcSSteven Penny1 - A DSL for Abstract Data Types. Redis is a DSL (Domain Specific Language) 8*3244d8bcSSteven Penny that manipulates abstract data types and implemented as a TCP daemon. 9*3244d8bcSSteven Penny Commands manipulate a key space where keys are binary-safe strings and 10*3244d8bcSSteven Penny values are different kinds of abstract data types. Every data type 11*3244d8bcSSteven Penny represents an abstract version of a fundamental data structure. For instance 12*3244d8bcSSteven Penny Redis Lists are an abstract representation of linked lists. In Redis, the 13*3244d8bcSSteven Penny essence of a data type isn't just the kind of operations that the data types 14*3244d8bcSSteven Penny support, but also the space and time complexity of the data type and the 15*3244d8bcSSteven Penny operations performed upon it. 167441fcddSantirez 17*3244d8bcSSteven Penny2 - Memory storage is #1. The Redis data set, composed of defined key-value 18*3244d8bcSSteven Penny pairs, is primarily stored in the computer's memory. The amount of memory in 19*3244d8bcSSteven Penny all kinds of computers, including entry-level servers, is increasing 20*3244d8bcSSteven Penny significantly each year. Memory is fast, and allows Redis to have very 21*3244d8bcSSteven Penny predictable performance. Datasets composed of 10k or 40 millions keys will 22*3244d8bcSSteven Penny perform similarly. Complex data types like Redis Sorted Sets are easy to 23*3244d8bcSSteven Penny implement and manipulate in memory with good performance, making Redis very 24*3244d8bcSSteven Penny simple. Redis will continue to explore alternative options (where data can 25*3244d8bcSSteven Penny be optionally stored on disk, say) but the main goal of the project remains 26*3244d8bcSSteven Penny the development of an in-memory database. 277441fcddSantirez 28*3244d8bcSSteven Penny3 - Fundamental data structures for a fundamental API. The Redis API is a direct 29*3244d8bcSSteven Penny consequence of fundamental data structures. APIs can often be arbitrary but 30*3244d8bcSSteven Penny not an API that resembles the nature of fundamental data structures. If we 31*3244d8bcSSteven Penny ever meet intelligent life forms from another part of the universe, they'll 32*3244d8bcSSteven Penny likely know, understand and recognize the same basic data structures we have 33*3244d8bcSSteven Penny in our computer science books. Redis will avoid intermediate layers in API, 34*3244d8bcSSteven Penny so that the complexity is obvious and more complex operations can be 35*3244d8bcSSteven Penny performed as the sum of the basic operations. 367441fcddSantirez 37*3244d8bcSSteven Penny4 - Code is like a poem; it's not just something we write to reach some 38*3244d8bcSSteven Penny practical result. Sometimes people that are far from the Redis philosophy 39*3244d8bcSSteven Penny suggest using other code written by other authors (frequently in other 40*3244d8bcSSteven Penny languages) in order to implement something Redis currently lacks. But to us 41*3244d8bcSSteven Penny this is like if Shakespeare decided to end Enrico IV using the Paradiso from 42*3244d8bcSSteven Penny the Divina Commedia. Is using any external code a bad idea? Not at all. Like 43*3244d8bcSSteven Penny in "One Thousand and One Nights" smaller self contained stories are embedded 44*3244d8bcSSteven Penny in a bigger story, we'll be happy to use beautiful self contained libraries 45*3244d8bcSSteven Penny when needed. At the same time, when writing the Redis story we're trying to 46*3244d8bcSSteven Penny write smaller stories that will fit in to other code. 477441fcddSantirez 48*3244d8bcSSteven Penny5 - We're against complexity. We believe designing systems is a fight against 49*3244d8bcSSteven Penny complexity. We'll accept to fight the complexity when it's worthwhile but 50*3244d8bcSSteven Penny we'll try hard to recognize when a small feature is not worth 1000s of lines 51*3244d8bcSSteven Penny of code. Most of the time the best way to fight complexity is by not 52*3244d8bcSSteven Penny creating it at all. 537441fcddSantirez 54*3244d8bcSSteven Penny6 - Two levels of API. The Redis API has two levels: 1) a subset of the API fits 55*3244d8bcSSteven Penny naturally into a distributed version of Redis and 2) a more complex API that 56*3244d8bcSSteven Penny supports multi-key operations. Both are useful if used judiciously but 57*3244d8bcSSteven Penny there's no way to make the more complex multi-keys API distributed in an 58*3244d8bcSSteven Penny opaque way without violating our other principles. We don't want to provide 59*3244d8bcSSteven Penny the illusion of something that will work magically when actually it can't in 60*3244d8bcSSteven Penny all cases. Instead we'll provide commands to quickly migrate keys from one 61*3244d8bcSSteven Penny instance to another to perform multi-key operations and expose the tradeoffs 62*3244d8bcSSteven Penny to the user. 637441fcddSantirez 64*3244d8bcSSteven Penny7 - We optimize for joy. We believe writing code is a lot of hard work, and the 65*3244d8bcSSteven Penny only way it can be worth is by enjoying it. When there is no longer joy in 66*3244d8bcSSteven Penny writing code, the best thing to do is stop. To prevent this, we'll avoid 67*3244d8bcSSteven Penny taking paths that will make Redis less of a joy to develop. 68