<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 12, 2016 at 10:51 AM, Sean Myers <span dir="ltr"><<a href="mailto:sean.myers@redhat.com" target="_blank">sean.myers@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Early planning for Pulp 3.0 is building up some steam, and it's<br>
a good time to go over the proposed technology stack that we're<br>
looking at right now that we're looking at to build on. For all<br>
of these choices, once Pulp's basic needs are met, the major<br>
deciding factor for what library to use is decided by "meta"<br>
factors, like community support, release processes, etc. Special<br>
thanks to Jeff Ortel for making sure my assumptions about these<br>
tools got challenged so the right choices get made.<br>
<br>
We're using postgres as the DB for 3.0. Since we're going<br>
relational, the next thing we'd want is a good ORM. Several team<br>
members have experience with the Django ORM, and Pulp is actually<br>
already using it in its views. It has a fantastic community, is<br>
well documented, and comes with a vast multitude of third-party<br>
plugins to help us fill in any gaps in functionality that may be<br>
found. Our current tasking system is build on Celery[0], which is<br>
among those third-party plugins with excellent Django support,<br>
which potentially means that using Django with a relational DB<br>
can help us get rid of code where we overlap functionality that<br>
may be provided by django-celery.<br>
<br>
Other ORM options were considered, but only SQLAlchemy (another<br>
very good ORM) stood out as something we could use if there was<br>
a compelling reason to switch from Django, but at this time there<br>
is no such reason. Django does the job well. Most other ORMs are<br>
either not robust enough in their feature-set or apparently not<br>
being actively maintained, and were rejected as alternatives.<br>
Also rejected outright was not using an ORM (or other form of<br>
data mapper) at all, since my sense is that we all agree that<br>
we don't want to manually be writing SQL. :)<br>
<br>
This leads to the next big building block, which is the tool we<br>
should use to build our REST APIs. I've used django-tastypie in<br>
the past, as have a few other team members, and it was my front-<br>
runner for this job. After looking around though, it looks like<br>
django-rest-framework (DRF) is currently dominating this space<br>
in the Django community[0]. Going through some of their tutorials<br>
and examples, it's looking like tastypie is out of the running,<br>
and DRF is the winner. Both would be adequate for Pulp's needs<br>
when it comes to putting a REST API on top of our data model, so<br>
it makes sense to go with the more "popular" option. In addition,<br>
I think its documentation and API are easier to work with than<br>
tastypie's, so it's simultaneously easier to use and easier to<br>
*learn how* to use.<br>
<br>
Finally, we're looking at bringing in a search engine for the<br>
search views in the API. We're currently doing search using<br>
mongodb, using mongo-specific search criteria, but will be<br>
decoupling the search API from the search engine. As with Django,<br>
a few team members have experience using elasticsearch (myself<br>
included). Elasticsearch is java-based, running on top of the<br>
Lucene indexer, with a simple REST API on top of it, and so at<br>
the moment it's my preferred search engine.<br>
<br>
I looked at a few other search engines in recent testing, including<br>
the pure-python engine "Whoosh", Solr (also uses lucene), Xapian,<br>
and Sphinx (the search engine, not the document builder). Of these,<br>
only Whoosh and Elasticsearch have first-party support by the<br>
django-haystack project[2], which is both my preferred and the most<br>
commonly used django search plugin[3]. Given my previous positive<br>
experience with Elasticsearch, I think it's probably the best choice<br>
for a search indexer at this time.<br></blockquote><div><br></div><div>Can you expand on why a separate search service is needed and how Postgres won't fill your needs? </div><div><br></div><div>Thanks,</div><div>Eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The Whoosh plugin for Haystack currently doesn't support a very<br>
useful feature that Whoosh itself does support, which is faceting.<br>
This feature gap is something that would need to be closed (likely<br>
by us) to get feature parity between the elasticsearch and whoosh<br>
backends.<br>
<br>
While there are other libraries that appear to live in the same space<br>
as haystack (integrate a search indexer with Django models, providing<br>
Django QuerySet/Model results), none of them have the robust features<br>
and community support seen in haystack. Again, though, decoupling the<br>
search interface from the search implementation means that this piece<br>
is likely to be easy to change out if we find better options in the<br>
future (especially if we write it with this in mind).<br>
<br>
Summary:<br>
- Django ORM on postgres<br>
- django-rest-Framework to build API views<br>
- django-haystack to provide search capabilities, using Elasticsearch<br>
  to start, possible switching to Whoosh after some development -- this<br>
  switch should occur before any release of 3.0<br>
<br>
[0]: <a href="http://docs.celeryproject.org/en/latest/django/" rel="noreferrer" target="_blank">http://docs.celeryproject.org/en/latest/django/</a><br>
[1]: <a href="https://www.djangopackages.com/grids/g/rest/" rel="noreferrer" target="_blank">https://www.djangopackages.com/grids/g/rest/</a><br>
[2]: <a href="http://django-haystack.readthedocs.io/en/stable/backend_support.html" rel="noreferrer" target="_blank">http://django-haystack.readthedocs.io/en/stable/backend_support.html</a><br>
[3]: <a href="https://www.djangopackages.com/grids/g/search/" rel="noreferrer" target="_blank">https://www.djangopackages.com/grids/g/search/</a><br>
<br>
<br>_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a><br></blockquote></div><br></div></div>