No sql - { If and Else }

  • 1,173 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,173
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
15
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Transaction avalable only for one row. No batching transactions avaliable.Needs middleware to handle transactions for multiple rows

Transcript

  • 1. NoSql
    Future begins here
    Author: Marjan Nikolovski
    Date: 2011-02-03
  • 2. Content
    NoSql as movement
    Pros and Cons
    Categories
    Mongo DB showcase
    Discussion
  • 3. NoSql as movement
    “NoSQL is a term used to designate databases that differ from classic relational databases in some way”
    Schemaless
    No “joins”
  • 4. NoSql as movement
    Schemaless – means everything can be stored without order, type, structure
    • No “joins” – means normalization is not used to relate and retrieve the data
  • NoSql as movement
    Invented to cover what RDBMS could not
    Fast write/read under heavy usage of a system
    Highly distribution of data
    Better architecture of distributed systems
    Fun 
  • 5. Cap Theorem
    CAP Theorem !!!
    “It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees:
    - Consistency (all nodes see the same data at the same time)
    - Availability (node failures do not prevent survivors from continuing to operate)
    - Partition Tolerance (the system continues to operate despite arbitrary message loss)
    According to the theorem, a distributed system can satisfy any two of these guarantees at the same time, but not all three”
  • 6. Cap Theorem - 2
  • 7. Pros and Cons - 2
    PROS
    Complex objects
    High-Volume Low-Value data
    Real-time analysis
    Online games (MMRPG)
    Search engines
    Scalable horizontally(sharding)
    Redundancy
    Flexibility
    Faster development
    Geospatial
    CONS
    • Transactions and distributedtransactions
    • 8. Business Intelligence
  • Pros and Cons
    What are we architecting ???
    What are our options ???
    Result …
  • 9. Categories
    Under NoSql four main categories exists:
    Key / Value
    BigTable
    Document
    Graph
  • 10. Categories – Key / Value
    We can see on this type as distributed hash table
    Used for caching layers
    Querying is done by key only
    Highly distributive
    Products:
    Memcached
    Project Voldemort
    Amazon Dynamo
  • 11. Categories - BigTable
    BigTable are step forward from Key/Value stores
    There is some order in these stores and querying can be done by more params
    More like the RDBMS that we now with excluded foreign key concept and with support each row to have different columns
    Products:
    Apache Cassandra
    Apache HBase
  • 12. Categories – Document
    Documents stores are json/xml based stores for objects
    Highly queryable
    Products
    MongoDB
    RavenDB
    Apache CouchDB
  • 13. Categories – Graph
    Graph stores store data in vortex connected with zero or more vortexes.
    Data is held in hashtable in each node
    Rich objects are not supported
    Products
    Neo4j
    AllegroGraph
    InfoGrid
  • 14. Categories – size/complexity
    *Complexity = Sophistication of data modeling
  • 15. Mongo DB showcase - 1
    What is
    Document store
    Fast, scalable and available
    JSon – used for data hydratation
    Dynamic
    Stores data structured as documents instead of row as seen in RDBMS
    Uses Query, Insert, Update and Remove for data manipulation
    Used for adding data at high rates without “choking” the system
  • 16. Mongo DB showcase - 2
    Internals of
    Core
    Map files in memory (virtual)
    Memory is allocated by namespaces
    Free space comes at the end of the structure
    Each document contains a header for traversal and position, body (document data) and padding
    Replication
    Master/Slave and Replication sets architecture
    Both require Master but Replication set vote for new master if the one dedicated for the job is unavailable
    Cursors
    Results can be of type cursor which can be iterated until cursor have 0 elements left
  • 17. Mongo DB showcase - 3
    Documents in
    Each document can be of size max to 4mb
    Each document you insert into MongoDB will be assigned an id consisted of:
    This is a 12-byte value consisting of 4 parts: timestamp (4 bytes)
    machine identifier (3 bytes)
    process id (2 bytes)
    increment (3 bytes)
    in MongoDB, each document will contain not only the values, but the key names (~"column names" in relational db-speak) too. So if you have keys: “Username" and “Password", then those alone will add 16 bytes to each document.
    MongoDB automatically adds some padding to the documents to allow for documents to grow in size to try and reduce the need for documents to be moved around if they do grow
  • 18. Mongo DB showcase - 4
    Map reduce and
    Map/Reduce is done via javascript
  • 19. Mongo DB showcase - 5
    Simple usage
    On win32 start mongod.exe
    Start mongo.exe test client for testing
    db.Workers.insert({
    _workerId: “936DA01F-9ABD-4d9d-80C7-02AF85C822A8”,
    name: “XyZ”,
    department: “services”,
    subdepartment: “.NET”
    });
    db.Workers.find({ name: “XyZ” });
  • 20. Mongo DB showcase - 6
    Performance analyses
  • 21. Mongo DB showcase - 7
    So how can we use it in .NET ???
  • 22. Mongo DB showcase - 8
    Get Mongodb-csharp driver
    http://github.com/samus/mongodb-csharp/commits/master/
    Let’s start
  • 23. Suggestions
    Check:
    The high scalability blog
    Apache Cassandra
    RanvenDB, .Net implementation of document store
    mysql performance blog
    CAP theorem
  • 24. Discussion
  • 25. Sponsored by