2. Web Scale with NoSQL Sergejus Barinovas(@sergejusb) http://sergejus.blogas.lt
3. Who Am I? Architect at Running NoSQL servers in production Blogger (http://sergejus.blogas.lt, @sergejusb) Community member (http://dotnetgroup.lt) Contact me via sergejus.barinovas@gmail.com
4. Powered by RDBMS Used everywhere… …even where it shouldn’t Used for 30+ years!
16. Why NoSQL Limited SQL scalability Sharding and vertical partitioning Limited SQL availability Master / slave configuration Limited SQL speed of read operations Multiple read replicas SQL limitations for huge amount of data Key / value / type columns
17. NoSQLhistory 2009, Eric Evans, no:sql(est) NoSQL– open source distributed databases, not relational SQL databases NoSQL– not only SQL NoSQL-> Big Data
18. NoSQL characteristics (1/2) Scalability The ability to horizontally scale simple-operation throughput over many servers BASE A “weaker” concurrency model than the ACID transactions in most SQL systems
19. NoSQLcharacteristics (2/2) Distributed Efficient use of distributed indexes and RAM for data storage Schema-less The ability to dynamically define new attributes or data schema
20. ACID (transactions) Atomicity – all or nothing Consistency – state integrity Isolation – no reads of uncommitted data Durability – recover committed trans
21. CAP theorem 2000, Eric Brewer It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: Consistency Availability Partition tolerance
22. BASE (eventualconsistency) Basically – partial system failures are OKAvailable Soft state – inconsistency is OK Eventual consistency – stale data is OK
29. Document database Document == complex object XML YAML JSON / BSON Support for secondary indexes Schema can be defined at runtime Optional support for simple querying using Map / Reduce
32. Graph databases Neo4j (-)paid version required for scaling FlockDB (+)fast (-)limited functionality
33. Columnar database For HUGE amount of data Columns are added at a runtime Great scalability Horizontal Vertical
34. Columnar database Unusual data model Key Space ->Database Column Family -> Table Columns and Super Columns Super Column -> array of Columns Column -> Tuple<Key, Value, Timestamp, TTL>
40. NoSQL limitations ORDER BY ? Natural key order GROUP BY ? Map / Reduce* JOIN ? Multiple Map / Reduce* SELECT * ? Multi-machine Map / Reduce* *if possible
Atomicity. All of the operations in the transaction will complete, or none will.Consistency. The database will be in a consistent state when the transaction begins and ends.Isolation. The transaction will behave as if it is the only operation being performed upon the database.Durability. Upon completion of the transaction, the operation will not be reversed.
Consistency. The client perceives that a set of operations has occurred all at once.Availability. Every operation must terminate in an intended response.Partition tolerance. Operations will complete, even if individual components are unavailable.http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
Basically Available. Supportingpartial failures without total system failure.Soft state. The state can be inconsistent for a given period of time.Eventual consistency. After some time all replicas will have consistent data.For a given accepted update and a given replica eventually either the update reaches the replica or the replica retires from service