Blob of contradictions

But I just want one field! Using field_attach_load()

Fri, 04/13/2012 - 12:00 -- btmash

Yesterday evening, I was working with a client on their site who are doing some interesting things with one of their custom search pages. They send ajax requests to the backend to get 2 types of values for their user:

  • A count on the total number of a node type X that matched the criteria
  • A count on the total number of another node type Y that is referenced in node type X (Y can be referenced multiple times by various X but for this, we just want to get back that value.

Instead of opting to go with straight database queries to get the data, they were using the EntityFieldQuery manner to get the initial list of X since they were using fields. Its not quite as fast, but its a much more flexible approach (and if they opt to change their field storage in the future to something like MongoDB, they can have something really fast without having to change a single line of code!). The one problem with EntityFieldQuery, however, is that it will only return back a listing of entity IDs. Meaning that if we want to get other pieces of data, we have to load up the entity. In their scenario, the only other piece of data that they wanted to retrieve was the reference field data. And performing an entire entity_load (or node_load to be specific) would mean they would also need to load up the 50 other fields that they are storing. So doing a retrieval like this on uncached content meant that the retrieval of this data alone took 3 to 4 seconds.

Migrate more with less! Or how I learned to love and create dynamic migrations.

Thu, 02/16/2012 - 12:15 -- btmash

As many folk know (and as folk can see by my posts on the topic), I am very big fan of Migrate. It takes a while to figure out what you want to do and how to do it, but the power is absolutely immense. And having complete control over the source object down to manipulating the destination node/user/entity while still working within a framework has made this my favourite module.

High Performance Meetup - Mongo + Drupal

Wed, 02/08/2012 - 10:43 -- btmash

We had a meetup on High Performance Drupal last night (see link) and being a fan of high performance systems/applications, I attended. Robert Brown did a fantastic presentation on using newrelic to diagnose potential issues in your application stack (it has hooks specifically for drupal in addition to the other niceties such as apache, memcache, solr; I didn't realize you could also monitor your site with it). I look forward to talking with him more on the subject of performance in the future.

Installing Nginx on Ubuntu 10.04 with PHP-FPM

Thu, 12/15/2011 - 00:21 -- btmash

To get myself more fully acquainted with Nginx, I decided to finally take the plunge and move out of using Apache. To note, I do not have any real problems with Apache; it has treated me very well for years; It is flexible and very easy to configure. I've also been using Varnish as an HTTP accelerator on this blog for a few months and given that I'm dealing with anonymous folk viewing content, the setup was more than adequate. But I have also heard great things about nginx for the past couple of years...

Presenting on Field Collection

Wed, 11/16/2011 - 22:23 -- btmash

As part of a lightning talk, I did a lightning talk at a Drupal Meetup in LA on the Field Collection module for Drupal 7. For those that do not know, Field Collection is a successor to the multigroup module in CCK from Drupal 6. It allows a user to associate a grouping of fields as one field to for any type of entity (including another field collection so you can have nested field groupings inside other field groupings).

JQuery UI Datepicker: highlighting dates with events

Sat, 10/22/2011 - 00:32 -- btmash
A picture of the jquery ui datepicker highlighting days with events.

Since the last time I posted on using the JQuery UI Datepicker for event navigation, we launched the site that I built out this functionality for (if you are interested, visit REDCAT). A few months ago, we received a feature request to extend the set of functionality by displaying (or highlighting) the list of events that occur in a given month.

Easy table + views integration using the Data Module

Fri, 10/14/2011 - 22:04 -- btmash

I was recently tasked to import data from a deprecated database table (Q&A) into a Drupal 6 site. Regarding the data that was being imported in:

  • It is a one-time import.
  • It boiled down as one flat database file
  • No new content of this type will be added again. Ever.
  • It should not appear in search results
  • They need an easy way to go through all the data.
  • It would be great if it could be filtered through and made searchable.

5 days of Drupal challenge

Tue, 09/20/2011 - 09:36 -- btmash

Last week, Jakub Suchy proposed an action for Drupal developers to contribute 30 minutes each day for 5 days (this week) towards the Drupal community. This can involve anything from providing support on forums/irc to writing/reviewing patches to documentation (and so on and so forth). So I am laying out some of my plans and join us in making Drupal better for everyone.

loadwatcher: Making your server sane when it thrashes.

Tue, 08/30/2011 - 14:03 -- btmash

A few years ago, Khalid wrote a wonderful script that would help make your apache server sane again after the opcode caching on the server started to throw segmentation faults (he aptly named it logwatcher). It was great because APC would crash for unknown reasons at the time and completely kill a website. It took care of an important issue (the one change I had made was to clear the apc cache instead of restarting the server but all in all, super ^_^).

Drupal Camp LA 2011 - recap of an amazing time.

Mon, 08/08/2011 - 09:52 -- btmash

Over this past weekend (August 6 and 7, 2011), the LA Drupal User Group held its annual Drupal Camp. There were 55 sessions planned over the 2 days by various members of the LA Drupal community (with a few by those visiting LA just for this camp ^_^). I don't know what to say that hasn't been said by more eloquent bloggers but it was a whole lot of fun :D


Subscribe to BTMash RSS