Sitecore rocks using fast query in query analyzer - sitecore

Is it possible to use fast queries in the sitecore rocks query analyzer or is it only suitable to use normal queries?
And if I can use fast queries, how can I use them?
I have tried:
query:fast:/sitecore/content/home//*[##templateid='{8A59A5A0-D634-4713-B32C-B0272CCEF9B3}']
fast:/sitecore/content/home//*[##templateid='{8A59A5A0-D634-4713-B32C-B0272CCEF9B3}']

As far as I remember, Sitecore Rocks Query Analyzer does not support fast queries.
This is because Sitecore Query is a pretty closed API and Rocks has to make significant hacks to extend it.
Sorry about this.

Related

Can Elasticsearch be used as a database in a Django Project?

Can we directly use Elasticsearch as a primary database in Django? I have tried finding the solution or a way out but could not find any relevant information. Everywhere it is said that we can use Elasticsearch as a search engine over any other primary database. But as per my understanding Elasticsearch is a NoSQL Database, so there should be a way to use it as a Primary Database in a Django Project.
Please help, if someone has any idea about it.
The short answer is no.
SO already has an answer here and this is still valid: Using ElasticSearch as Database/Storage with Django
ES is not a ACID compliant
Indexing is not immediate so any kind of load would be an issue
It's very weakly consistent
Use it together with a proper database and it will help with real time searches, analytics, expensive queries etc. but treat it as derived data.

The best way for integration Django and Scrapy

I know some ways like scrapy-djangoitem but as it has mentioned:
DjangoItem is a rather convenient way to integrate Scrapy projects with Django models, but bear in mind that Django ORM may not scale well if you scrape a lot of items (ie. millions) with Scrapy. This is because a relational backend is often not a good choice for a write intensive applications (such as a web crawler), specially if the database is highly normalized and with many indices.
So what is the best way to use scraped items in db and django models?
It is not about Django ORM but rather about the database you choose as backend. What it says is that if you are expecting to write millions of items to your tables, relational database systems might not be your best choice here (MySQL, Postgres ...) and it can be even worse in terms of performance if you add many indicies since your application is write-heavy (Database must update B-Trees or other structures for keeping index on every write).
I would suggest sticking with Postgres or MySQL for now and look for another solution if you start to have performance issues on database level.

Sitecore : Options for storing/querying custom data used by sitecore CD

This (below) has been a common problem/debate on most of my sitecore projects.
Problem:
Sitecore web site creates/uses the custom data such as polls/quiz/user-journey/comments etc.
Solutions:
One option to solve this problem is create a custom DB table and use Entity Framework fro CRUD.
The other option is to make a copy of master database (as data) and use Sitecore API for CRUD.
The benefit of 2nd option could be out of box API usage, workflow etc.
Has anyone faced this issue and what's the best way to solve this?
As you know there is no blanket solution for all projects but I believe this option is the best for most projects.
Option 3: Custom DB + Data Provider
Create a custom database as you have said in option 1.
Use a data provider so that the items can be indexed/searched easily (depends on your requirements, see additional benefits below)
Pros:
- CD's do not depend on the custom DB which is a big advantage over option 1.
- If you need to do any transformation to the items as you publish them you can, same applies in import. (in the instance you are connecting to an external/existing datasource that you want to transform)
For more info check out this: http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2012/05/when-to-implement-data-providers-in-the-sitecore-aspnet-cms.aspx
We also have this challenge all the time. What I personally learned from experience is that when the requirement is fairly small, you have better to choose option one.
However, when the requirement is not a small thing, especially in interactive scenarios like what you mentioned, you have to ask yourself questions like: "what if later on client wants it multilingual or what if they need some sort of statistics and analytics on the result? Don't I want to take advantage of stuff like WFFM or Analytics?" In such cases you may better think it over and weigh the pros and cons and possible scaling options in the future (because practically sitecore projects are not for small scale websites). For example when collecting large amount of data you definitely need Lucene/Solr and Item Buckets.
Luckily in recent version of Sitecore you have MongoDB option which is a good option for collecting interactive data and stuff which are not well-structured and prone to change in structure in future.
Edit:
There is also an ORM tool called Glass Mapper, similar to EF, if you are interested. While EF works great with SQL server, Glass Mapper works with Sitecore Data Repository in the same way but it may introduce a bit performance drawbacks to your code.

Django supported alternative to noSQL

We need a reasonable insert and query speed over huge tables so I considered using some noSQL adapter with Django. Unfortunately:
Django does not provide official support for noSQL databases.
In our original schema some Big Data are relational to other Big Data making the data duplication unacceptable.
Project deadlines are enemies of hot stuff like this.
So, as far I can see, PostgreSQL should be the way to go for this scenario, right?!
Please let me know any other detail that may be relevant to this question!
Bonus to anyone that can point out some useful database techniques like database sharding...
Well, there is a fork of django project that uses MongoDb as the backend.You can read about it here . The Code on GitHub is here.You give some heads up, MongoDB is a NOSQL db that does support sharding and replication. So i think this might something that you are looking for.

Mongodb vs PostgreSQL in django

I am not that experienced with django yet, but we are creating a project soon and we were wondering which database to use for our backend (Mongodb or PostgreSQL).
I've read a lot of post saying the differences between each, but I still can't take the decision of which to go for. Taking in consideration I never worked with Mongodb before.
So what shall I go for ??
Thanks a lot in advance
MongoDB is non-relational, and as such you cannot do things like joins, etc.
For this reason, many of the django.contrib apps, and other 3rd-part apps are likely to not work with mongodb.
But mongodb might be very useful if you need to store schemaless complex objects that won't go straight into postgresql (of course you could json-serialize and put in a text field, but using mongodb instead is just way better, allows you doing searches, ..).
So, the best suggestion is to use two databases:
PostgreSQL for the standard applications, such as django core, authentication, ...
MongoDB only for your application, when you have to store non-relational, complex objects
You also might want to use the raw_* methods that skip lots of (mostly unnecessary) validation by the django orm.
Just remember that databases, especially sql vs no-sql, are not drop-in replacements of each other, but instead they have their own features, pros and cons, so you have to find out which one suits best your needs in each case, not just pick one and use it for everything.
UPDATE
I forgot to say: remember that you have to use the django-nonrel fork in order to make django support non-relational databases. It is currently a fork of django 1.3, but a 1.4-based version is work-in-progress.