Raven lovin' - .NET does NoSQL


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Consistency: all nodes see the same data at the same timeAvailability: a guarantee that every request receives a response about whether it was successful or failedPartition tolerance: the system continues to operate despite arbitrary message loss or failure of part of the system
  • The object-relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being used by a program written in an object-oriented programming language or style; particularly when objects or class definitions are mapped in a straightforward way to database tables or relational schemata.
  • BASE: Basically available, soft state, eventually consistent
  • Raven lovin' - .NET does NoSQL

    1. 1. RavenDB lovin’ .NET does NoSQL
    2. 2. about:authorLongtime user of ORMsExperienced in object DBsRaven in personal projectsRaven at 3MRaven with Ayende!
    3. 3. RavenDB?
    4. 4. SQL: Databases done right. Circa 1970.
    5. 5. SQL: Databases done right. Circa 1970. CAP Theorem for distributed systems: Consistency, Availability, Partition tolerance Choose 2.
    6. 6. SQL: Databases done right. Circa 1970.
    7. 7. SQL: Databases done right. Circa 1970.
    8. 8. SQL: Databases done right. Circa 1970.SELECT UPPER(Name) SELECT UPPER(Name) SELECT TOP 10 UPPER $ SET SOURCEFORMAT “FREE”FROM Customer FROM (c1.Name) IDENTIFICATION DIVISION.WHERE Name LIKEA% ( FROM Customer c1 Display Prompt.ORDER BY Name SELECT *, WHERE c1.Name LIKE A% DISPLAY “I <3 SQL!”. RN = row_number() AND c1.ID NOT IN STOP RUN. OVER (ORDER BY ( Name) SELECT TOP 20 c2.ID FROM Customer FROM Customer c2 WHERE Name LIKE WHERE c2.Name LIKE A%‘ A% ORDER BY c2.Name ) A ) ORDER BY c1.Name WHERE RN BETWEEN 21 AND 30 ORDER BY Name var names = db.Customers .Where(c => c.Name.StartsWith(“A”)) .OrderBy(c => c.Name) Or how about… .Select(c => c.Name.ToUpper()) .Skip(20) .Take(10);
    9. 9. SQL: Because objects and relational databases go together like peanut butter and tuna fish
    10. 10. SQL + OO =Peanut butter + Tuna. The object-relational impedance mismatch: •Polymorphism doesn’t exist in the relational world •Encapsulation creates fragile database models •Inheritance results in inefficient relational queries •Leaky abstraction
    11. 11. SQL + OO =…but you can mask the tuna only so long…
    12. 12. SQL + OO = var today= DateTime.Now; context.TheBaseTypes .Where(b => b.DateCreated == today) .ToList();“Expressing this query in LINQ to Entities is short and sweet. Butdon’t be fooled. It’s a hefty request. You’re asking EF and your DBquery each table that maps to the derived entities and join eachone to the BaseTypes table.In my environment, this creates a 3,200 line SQL query, which cantake Entity Framework some time to build and the database sometime to execute.”-Julie Lerman, MSDN Magazine, August 2012
    13. 13. ORM: The Vietnam of Computer Science “ORM is the Vietnam of Computer Science. It represents a quagmire which starts well, gets more complicated as time passes, and before long entraps its users in a commitment that has no clear demarcation point, no clear win conditions, and no clear exit strategy.” -Ted Neward
    14. 14. SQL:The Hammer for every nail “The first to present his case seems right, till another comes forward and questions him.”
    15. 15. NoSQL:A modern alternative to relational databases Don’t use T-SQL Typically schema-free Built for distributed scalability Relax ACID guarantees
    16. 16. NoSQL:A modern alternative to relational databases Trippy things like… Cheap, fast reads Horizontal scalability Flexible, schema-free models
    17. 17. NoSQL has problems, too.
    18. 18. NoSQL has problems, too. Painful query models Immature tooling Complex APIs Poor language support
    19. 19. RavenDB“I’ve consulted on NHibernate and otherORMs for over a decade. I’ve seen the sameproblems repeated over and over.I wanted to fix that.So I created RavenDB.”-Ayende
    20. 20. RavenDB Get out of the RDBMS/ORM mess Fix shortcomings of NoSQL Evolve data storage“I intentionally designed RavenDB and its .NETAPI to deal with problems and frustrations in theNHibernate / RDMBS model.”-Ayende
    21. 21. RavenDBSetup should be painless
    22. 22. RavenDBSimple is better
    23. 23. RavenDBPutting stuff in the database should be easy
    24. 24. RavenDBTransactions are important
    25. 25. RavenDBLINQ is the best query language on the planet
    26. 26. RavenDBDevelopers should fall into the pit of success
    27. 27. RavenDBReads should be *fast*. Index fast. Lock-free, non-ACID reads “Better stale data quickly than live data slowly.” Every read is a query against an index. Yes! Indexes should be created
    28. 28. RavenDBTooling is important
    29. 29. RavenDBSearch matters. Google-like search.
    30. 30. RavenDBScalability should be easy, natural Replication: master-to-slave, master-to-master Sharding: split your data across servers transparently
    31. 31. Recap! It’s an alternative to the SQL + ORM messRaven is scalable! You should totally use it for your next project :-)
    32. 32. Thank You!Slides: bit.ly/raventalk Twitter: @JudahGabriel Blog: DebuggerDotBreak.wordpress.com