SlideShare una empresa de Scribd logo
1 de 27
RavenDB
A Deep Dive into Indexes




                           S
Alonso Robles


S Principal Consultant @ Headspring

S Blog: http://alonsorobles.com

S Linked In: http://linkedin.com/in/alonsorobles

S Twitter: @alonsorobles
Central Texas
GiveCamp
September 28-30, 2012
Interested in Participating?
    Developer – Make software. Have fun. Do
    good!
    Non-Profit – What can we build for you?
    Sponsor – Help make the even successful.

More Info:
http://ctxgivecamp.org
The Query
How does RavenDB find what we are looking
                                     for?




                                            S
Simple Query
What Happens?


           .NET Client
           sends query




Server returns        Server
   results        processes query
How is the Query Processed?
The Index
A short and brief introduction




                                 S
ACID versus BASE

               ACID                     BASE
S   Atomic             S   Basically Available

S   Consistent         S   Soft state

S   Isolated           S   Eventually consistent

S   Durable
ACID Document Operations


S Store

S Delete

S Update
BASE Queries


S Fast

S Stale Results

S   Powered by Lucene
Lucene


S Mature, De Facto Standard Information Retrieval Library

S Scalable, High Performance Indexing

S Powerful, Accurate and Efficient Search Algorithms

S Originally Written in Java and Ported to Many Languages

S Used by Apple, IBM, Linked In and many more…
Types of Indexes


S Temporary Dynamic Index
  S Created on the fly to service a query when no existing index
     can be used

S Permanent Dynamic Index
  S Promoted when a temporary index is used a lot

S Static Index
  S User defined
Static Indexes
Why? Aren’t the dynamic indexes enough?




                                          S
Reasons for Static Indexes


S Index Creation is Expensive

S Additional Functionality
  S Custom Sorting
  S Boosting
  S Full-Text Search
  S Live Projections
  S Spatial Search
Simple Index Definition
Using the Index in a Query
Reducing Results
Using Sort Options
Even More Options
Live Projections
Stale Indexes
    Working with staleness




                             S
Why Must It Be Stale?


S Indexing occurs on a background thread

S Keeps queries lightning fast

S Better to be stale than offline
Checking for Stale Results
But Non-Stale Won’t Do
Questions
     Ask away!




                 S
More Info


S Official Raven Website: http://ravendb.net

S Oren’s Blog: http://ayende.com

S Google Group: http://groups.google.com/group/ravendb/

S My Blog: http://alonsorobles.com

S Local Training: http://headspring.com

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

CosmosDb for beginners
CosmosDb for beginnersCosmosDb for beginners
CosmosDb for beginners
 
Azure CosmosDb - Where we are
Azure CosmosDb - Where we areAzure CosmosDb - Where we are
Azure CosmosDb - Where we are
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Build 2017 - P4010 - A lap around Azure HDInsight and Cosmos DB Open Source A...
Build 2017 - P4010 - A lap around Azure HDInsight and Cosmos DB Open Source A...Build 2017 - P4010 - A lap around Azure HDInsight and Cosmos DB Open Source A...
Build 2017 - P4010 - A lap around Azure HDInsight and Cosmos DB Open Source A...
 
Text search with Elasticsearch on AWS
Text search with Elasticsearch on AWSText search with Elasticsearch on AWS
Text search with Elasticsearch on AWS
 
Azure document db/Cosmos DB
Azure document db/Cosmos DBAzure document db/Cosmos DB
Azure document db/Cosmos DB
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
Bleeding Edge Databases
Bleeding Edge DatabasesBleeding Edge Databases
Bleeding Edge Databases
 
Azure CosmosDb
Azure CosmosDbAzure CosmosDb
Azure CosmosDb
 
Explore Azure Cosmos DB
Explore Azure Cosmos DBExplore Azure Cosmos DB
Explore Azure Cosmos DB
 
Azure Cosmos DB - NoSQL In the Microsoft Cloud
Azure Cosmos DB - NoSQL In the Microsoft CloudAzure Cosmos DB - NoSQL In the Microsoft Cloud
Azure Cosmos DB - NoSQL In the Microsoft Cloud
 
Database Choices
Database ChoicesDatabase Choices
Database Choices
 
Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014
 
Move your on prem data to a lake in a Lake in Cloud
Move your on prem data to a lake in a Lake in CloudMove your on prem data to a lake in a Lake in Cloud
Move your on prem data to a lake in a Lake in Cloud
 
Amazon Kinesis Data Streams
Amazon Kinesis Data StreamsAmazon Kinesis Data Streams
Amazon Kinesis Data Streams
 
Not only SQL - Database Choices
Not only SQL - Database ChoicesNot only SQL - Database Choices
Not only SQL - Database Choices
 
Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018Introduction to CosmosDB - Azure Bootcamp 2018
Introduction to CosmosDB - Azure Bootcamp 2018
 
Survey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeSurvey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data Landscape
 
Benefícios e melhores práticas no uso do Amazon Redshift
Benefícios e melhores práticas no uso do Amazon RedshiftBenefícios e melhores práticas no uso do Amazon Redshift
Benefícios e melhores práticas no uso do Amazon Redshift
 
AWS for Big Data Experts
AWS for Big Data ExpertsAWS for Big Data Experts
AWS for Big Data Experts
 

Similar a RavenDB - Indexes Deep Dive

AWS at ArgyleSocial
AWS at ArgyleSocialAWS at ArgyleSocial
AWS at ArgyleSocial
triangle_aws
 
SQL Server and Azure Mobile Business Intelligence
SQL Server and Azure Mobile Business IntelligenceSQL Server and Azure Mobile Business Intelligence
SQL Server and Azure Mobile Business Intelligence
Jen Stirrup
 
Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013
Aaron Blythe
 
Karan_Verma_Resume
Karan_Verma_ResumeKaran_Verma_Resume
Karan_Verma_Resume
Karan Verma
 

Similar a RavenDB - Indexes Deep Dive (20)

Microservices, Events, and Breaking the Data Monolith with Kafka
Microservices, Events, and Breaking the Data Monolith with KafkaMicroservices, Events, and Breaking the Data Monolith with Kafka
Microservices, Events, and Breaking the Data Monolith with Kafka
 
Scala & Swagger at Wordnik
Scala & Swagger at WordnikScala & Swagger at Wordnik
Scala & Swagger at Wordnik
 
AWS at ArgyleSocial
AWS at ArgyleSocialAWS at ArgyleSocial
AWS at ArgyleSocial
 
Steve Bowden - Alexa Presentation - Why I build Alexa Skills
Steve Bowden  - Alexa Presentation - Why I build Alexa SkillsSteve Bowden  - Alexa Presentation - Why I build Alexa Skills
Steve Bowden - Alexa Presentation - Why I build Alexa Skills
 
SQL Server and Azure Mobile Business Intelligence
SQL Server and Azure Mobile Business IntelligenceSQL Server and Azure Mobile Business Intelligence
SQL Server and Azure Mobile Business Intelligence
 
Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013
 
Beyond the basic Swagger UI: Adyen API Explorer
Beyond the basic Swagger UI: Adyen API ExplorerBeyond the basic Swagger UI: Adyen API Explorer
Beyond the basic Swagger UI: Adyen API Explorer
 
Picking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use CasePicking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use Case
 
Amazon QuickSight
Amazon QuickSightAmazon QuickSight
Amazon QuickSight
 
Getting Started with Amazon QuickSight
Getting Started with Amazon QuickSightGetting Started with Amazon QuickSight
Getting Started with Amazon QuickSight
 
Lunch && Learn DevHub - 6 Things to Learn to become an AWS Genius
Lunch && Learn DevHub - 6 Things to Learn to become an AWS GeniusLunch && Learn DevHub - 6 Things to Learn to become an AWS Genius
Lunch && Learn DevHub - 6 Things to Learn to become an AWS Genius
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1
 
Node.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns WebinarNode.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns Webinar
 
How to become the most sought after SQL Professional
How to become the most sought after SQL Professional How to become the most sought after SQL Professional
How to become the most sought after SQL Professional
 
Global Azure Bootcamp Montreal 2017
Global Azure Bootcamp Montreal 2017Global Azure Bootcamp Montreal 2017
Global Azure Bootcamp Montreal 2017
 
Karan_Verma_Resume
Karan_Verma_ResumeKaran_Verma_Resume
Karan_Verma_Resume
 
MEAN.js Workshop
MEAN.js WorkshopMEAN.js Workshop
MEAN.js Workshop
 
AWS October Webinar Series - Introducing Amazon QuickSight
AWS October Webinar Series - Introducing Amazon QuickSightAWS October Webinar Series - Introducing Amazon QuickSight
AWS October Webinar Series - Introducing Amazon QuickSight
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
 
Documenting Your API
Documenting Your APIDocumenting Your API
Documenting Your API
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

RavenDB - Indexes Deep Dive

Notas del editor

  1. Every index is required to have a name and a Map function. The Map function is the way for us to tell RavenDB how to find the data we are interested in, and what fields we are going to be searching on. The Map function is written in LINQ, just like you'd write a simple query
  2. The Reduce function is optional, and is written and executed just like the Map function, but this time on the results of the Map function. This is actually a second indexing pass, which allows us to perform aggregation operations quite cheaply, directly from the index.
  3. Sorting by default is performed lexographically.
  4. FieldStorageNo (default) – Does not store the value of the field in the indexYes – Stores the value of field Compress – Compresses the value of the field (good for long text or binary fields)FieldInexing OptionsAnalyzed – Standard analysis good for full text search or text fields (breaks up text into terms and performs stemming analysis)Default – LowerCaseKeywordAnalyzer (stores the entire field as a single term for exact matching)No – Field is not indexed thus cannot be searched. But it can still be accessed assuming it was stored.NotAnalyzed – Indexes the field without performing analysis. This is good for unique ids like product numbers (UPC, ISBN, MPN)
  5. Using the Live Projections feature, you have more control over what to load into the result entity, and since it returns a projection of the original entity, you also get the chance to filter out properties you do not need.
  6. WaitForNonStaleResultsAsOf()WaitForNonStaleResultsAsOfNow()WaitForNonStaleResultsAsOffLastWrite()