Singh
Singh

Reputation: 554

Best approach to use Lucene.net in azure app service

I am converting my azure cloud service project into azure app services. I have one webrole and one worker role for search operations(I am using lucene.net for search operations). I want best solution that will deliver me good performance and save running cost. So I am looking for best approaches to implement my search worker role. I have some options and every scenario I have some queries:-

(i) I can put lucene indexing code in my web app. But that can affect performance of my website (as lucene will run parallel to create and index documents).

(ii) As I hear azure web apps have 6 deployments slots, can I use one of them to host my lucene.net project permanently and lucene project will return results to my web project.

(iii) I have one azure web app for blog. Should I use that web app to host lucene project (host in subdomain)

(iv)I have another option is azure search, But as per my findings

My exact requirement is :-

I need minimum 5 indexes, and approx 50,000 documents overall. My data sources are

1.SqlAzure
2.Azure tables
3.Azure blobs

Please advice me best approach for my scenario, Any help is very appreciable!!!

Upvotes: 0

Views: 1235

Answers (1)

Rob Reagan
Rob Reagan

Reputation: 7686

The "best approach" is opinion-based and cannot be answered definitively. That being said, here's some things to consider when making this decision.

(i) I can put lucene indexing code in my web app. But that can affect performance of my website (as lucene will run parallel to create and index documents).

This is true. Indexing code will consume compute resources for your Web App.

(ii) As I hear azure web apps have 6 deployments slots, can I use one of them to host my lucene.net project permanently and lucene project will return results to my web project.

Web App deployment slots are not separate instances - they share your Web App's computing resources. For example, if you have a single B1 Basic instances with 1 core and 1.75GB of RAM, those resources will be shared across all slots. Each slot does not give you a second instance with 1.75GB of RAM and 1 core. This will put you in the same situation as #1 above.

(iii) I have one azure web app for blog. Should I use that web app to host lucene project (host in subdomain)

Possibly. You could deploy and monitor to see how indexing affects performance.

As for Azure Search, it will definitely allow you to index on five fields. You do not just have to index documents that exist in Azure SQL or Table Storage - you can index anything. You can use an API endpoint to send any document you want in JSON format for indexing. The docs for doing so are here. Using this methodology, you can even index documents that are created at runtime.

Upvotes: 3

Related Questions