Experienced eCommerce Software Developer Integrates Relify Product Recommendations into Drupal Ecosystem

Posted on

This is a guest post by Ryan Szrama, a Drupal eCommerce developer for Commerce Guys and user of the Relify API. Below, he shares his thoughts on using Relify for eCommerce, and how he built an integration in just one hackathon weekend.

—————————–

I’m a long-time eCommerce software developer building solutions on Drupal, a leading open source CMS. Drupal has significant representation in government, publishing, and media / entertainment websites, and my company Commerce Guys is currently focused on turning it into a go-to solution for businesses looking to open new online stores or upgrade their existing sites.

It was easy enough for us to build out the core eCommerce framework using a module package we call Drupal Commerce. However, merchants need much more than a shopping cart and checkout form to be successful online. They need to integrate with numerous third party services providing essential payment, marketing / analytics, and conversion optimization solutions.

Relify is one such service that immediately captured my imagination. There are modules and integrations in the Drupal ecosystem for making recommendations, but none are as focused on delivering personalized recommendations at a large scale as Relify. Additionally, native recommendation solutions may require the use of database systems that the average Drupal developer does not have experience managing, making creating a personalized shopping experience out of reach for most of our users.

Kickstart-Relify

For these reasons, I was excited to attend this year’s Recs Hack Day to attempt an integration with the Relify API to bring simple product recommendations to Drupal Commerce. By the end of the day, I had released a full beta version of the Relify module to the Drupal community with a working demo site using our eCommerce specific distribution of Drupal, Commerce Kickstart, to embed product upset recommendations in our Add to Cart modal dialog. The work was solid enough to take home the “Best Use of the Relify API” prize, allowing me in turn to take home a shiny new Sparkfun Inventors Kit!

For the Drupal integration, I decided the best user experience would be for the developers to be able to create and manage their Relify data sets and recommenders from within Drupal itself. This gave me the greatest amount of information about the schema and purpose of data sets client side, allowing me to build additional validation into my forms and create an easy way to feed data into Relify by mapping Drupal entity properties to valid columns in a data set’s schema via the Rules module.

Relify-recommenders

The configuration interface in the back-end of Drupal thus allows you to configure your API credentials, define data sets and recommenders, and define the business logic via Rules that determines when new records are added to your data sets.

The only use of recommendations right now is in what’s called an “area handler”, a plugin of sorts that can be added to pages and widgets created by Drupal’s Views module. It’s currently specifically geared toward product recommendations, but module can easily be used to add any type of data to your Relify data sets. The roadmap is wide open for working in new ways to use recommendations, with a natural next step being the usage of recommendations to filter lists of content or users on a site.

I had a great time participating in the sprint. Thankfully I’m pretty experienced with Drupal’s APIs, so I could pack a lot into my 24 hours. Ultimately, I’d love for Drupal Commerce users to see increased sales through the use of personalized product recommendations and will continue to develop the module in pursuit of that goal.

Tags: , ,


#usecase: Dynamic Content Increases Grocery Sales

Posted on

Grocery list and coupon apps are a popular way for busy consumers to have lists at their fingertips, on the go.  With more and more people using their phones as a touch point in-store, why aren’t we taking advantage of helping them discover and save when they need it most?

This use case outlines how personalized recommendations can help increase order size by enticing your customers to “buy one more thing.”

  • Industry: Retail
  • App type: Grocery coupons
  • Problem: I’m standing in the grocery store with my mobile grocery app open.  I have a basic list of stuff I need (apples, milk, eggs), but I’m not sure what else to buy.  I clipped a few generic coupons, too.
  • The Relify solution: With Relify connected to my grocery list creation and coupon clips, it knows the types of food I’m interested in and likely to buy.  Based on those categories and items, a push notification shows me a recipe that I can make using some of the ingredients on my list.  I buy the items on my existing list, as well as purchase additional items the recipe calls for, thus increasing my order size.

coupons

Tags: ,


#usecase Series: The Power of Personalized Recommendations

Posted on

We all get recommendations frequently from our friends with questions like ‘what’s good on the menu?’ or ‘what movie should I see’?  But Relify recommendations aren’t based on what your users’ friends like, they’re based on what your users like. And what they do, and what they buy.  We use existing data to create personalized recommendations that pertain to their lifestyle, in any category or industry.

Because of that, we’re starting a new blog series for #usecases to show you the power of recommendations and how they can be used in your app.  We also just added use cases to our website and launched Pinterest boards to show visual examples.  And if you have your own use case, we’d love to include it (just email hello@relify.com).

I’ll start with a subject that all of us can relate to: shopping in retail apps.  *Use cases are explained from the most important viewpoint: the user.

  • Industry: Retail
  • App type: E-commerce
  • Problem: I’m on the go and need to shop on my phone, but hate searching through endless options to find what I’m looking for.  Right now, I need to find a cute, affordable dress to wear to a summer wedding.  When I do a search, I get thousands of dresses that aren’t what I’m looking for.  Filtering only goes so far and still leaves me with endless options.
  • The Relify solution: With Relify connected to my in-app usage and shopping purchase history, the app knows the top brands I buy, and that I click on blue dresses the most.  It also knows what’s in stock, and only shows me items I’m likely to buy, based on all of these factors.  Now when I search, I see personalized options that pertain to me.  Less time searching, more time buying.

retail recommendations

Tags: , ,


Recs Hack Day Recap + How to Plan a Hackathon

Posted on

recs hack day

Developers get underway during Recs Hack Day in Greenville, SC.

Relify had the pleasure of hosting the first hackathon in our area this past weekend, and we were excited with the results.  The day was a huge success and we had a great time.  Thanks to everyone who came out.

Here’s the lowdown recapping the weekend:

  • 36 participants
  • 8 projects submitted
  • [Insert big number here] drinks consumed
  • 24 sleepless hours
  • Over 50 tweets and mentions

Check out all 8 projects, winners and pics: goo.gl/xucDm

Host a hack: How to plan your own hackathon

Hacks are awesome ways to see how people interact with your technology, and can highlight bugs, opportunities and inconsistencies that you’re too close to see.  Here are a few tips we learned for how to plan a hackathon:

  • Start early.  We started planning 2 1/2 months out, which saved us headaches and chaos leading up to the hack.
  • Start local.  Local sponsors were key in providing food and drinks.  Local shops were more than willing to donate to our cause, and liked being part of a cool event.
  • The worst they could say is no.  You need at least a little money for a hack, and we’re a startup, so we knew we needed some help.  We reached out to our network to ask about sponsoring the hack in some way (donations, money, swag).  We pitched the event as a way to bring the tech community together, and build cool stuff.  We were able to secure almost every partnership we asked for!  Thanks to Mandrill for being our headline sponsor, and for the sweet swag.
  • Pick a theme that makes sense.  Relify is a recommendation engine that adds relevance to apps, so it made sense for our theme to be recommendations.  We asked developers to create projects that used recommendations to improve UX and deliver more value for users and companies.  Think about what themes make sense for your company, and anticipate ideas developers might have for hacking.
  • Make it easy to get started.  In our hack, we supplied data sets to help devs get started hacking, instead of making them find their own data.  Whatever you can do to make it easy to start building, do it.
  • Host the hack on a platform.  We used Hacker League, which is one of many.  They support hacks, wikis, participant info, demo links and more.
  • Tweet, tweet, and tweet some more.  Developers are on Twitter, so create a hashtag (ours was #recshackday) and schedule tweets early to get people excited and talking.

Questions or thoughts?  I’d love to help you plan your hack.  Contact me.

 

Tags: ,


What the stack? Ridiculously simple worker scalability, IronWorker style

Posted on

What good is a recommendation that’s based on data if your algorithms don’t have access to ALL of the data that’s needed to generate the most relevant recommendations? More importantly, as a startup with limited time and resources, how can you open your platform to a potentially limitless firehose of inbound data and survive long enough to make a dime?

These are two serious questions we struggled to answer while scaling our recommendations as a service API. It’s easier and more cost efficient than ever to build a big data startup thanks to services like AWS, Heroku and Google’s Cloud Platform. That simplicity, however, still comes at a price. It only takes a day or two for us to burn through our allocated AWS free tier credits before our bank account starts shrinking.

It would be easy for us to charge for inbound API requests/data storage to solve our problem but doing so wouldn’t be fair to our customers because our value is in the recommendations we serve, not the resources required to generate them.

If you had been eavesdropping on our conversations while we worked to answer these questions you would have heard that:

  • It didn’t make sense to tie our customers to specific data structures given the fact that every customer’s data is different. We built our data set methods with NoSQL in mind relying entirely on Amazon’s DynamoDB. A big benefit of using DynamoDB is that it gives us the ability to control our read/write throughput, in real-time, according to our needs.
  • Simply dialing up the read/write throughput in DynamoDB to accept all inbound requests didn’t make sense because doing so would have been too costly. DynamoDB gets really expensive the more write throughput you provision. It’s difficult for us to predict how much data might come in at any given point until a customer has been on board for a while, so relying solely on write throughput would be a mistake.
  • Queuing inbound data in SQS makes sense and is lightening fast. The only problem with queuing is that we still have to have the workers to process everything that’s sitting in the queue in near real-time.
  • Heroku’s dynos are expensive (in startup terms) and had recently come under fire for routing issues which caused some customer’s monthly bills to skyrocket. It made sense for us to use their web dynos to serve our API but using their worker dynos to process the queues, not so much.
  • Firing up an Amazon EC2 instance or three to manage the workers isn’t something we’re interested in doing mainly due to the extra administrative needs EC2 creates, not to mention the added costs of running instances 24/7.

We were so close! If it wasn’t for the damn workers we’d be set!

I had been tinkering with IronWorker and a few other Heroku worker add-ons for a week or two but wasn’t really feeling any of the offerings. The fundamentals of what we were looking for were there but all still seemed wildly inefficient. Tasks that should have taken less than twenty seconds to execute were taking minutes. Each add-on had its quirks and some of them were deal breakers. We’d come so far and had realized that there was a distinct possibility that we’d have to implement our own worker service.

Then fortune smiled. The folks at Iron.io sent me a “Tips & Tricks” email on the same day I was getting ready to start coding our worker service (no joke). In that email was a link to a blog post by one of Iron.io’s Co-Founders, Travis Reeder, entitled How to Reduce a 9 Hour Job to a 9 Minute Job. Were they reading my mind?

It turns out that we weren’t the only ones with such struggles as the first line of the post so poignantly states: “A common problem developers have is how to run through a large number of tasks in a short amount of time.” PREACH ON! I kept reading.

I immediately felt better (and a little silly) after reading the post. Why hadn’t I attempted to dig deeper into Iron.io’s blog before I threw in the towel? Or hit them up on HipChat (which I subsequently did, and they were awesome). The answer was there the whole time!

The post got me thinking about breaking work into smaller pieces to take advantage of concurrent task execution. I imagined that we could spawn additional tasks based on the total number of items in a queue and let recursion take its course until the workers burned through all of the records in each queue. The end result was a collection of workers that run on a schedule and are entirely self-contained within IronWorker. Their workflow goes a little something like:

  • The parent worker runs every minute and decides on the fly which queues need to be processed
  • The parent worker spawns a child worker for each queue (up to n queues) that pulls 100 messages from each queue for processing. It alternates queues based on the number of messages in each queue to ensure that all queues have an equal chance of having their records processed during a parent cycle.
    (Note: the number of messages we pull from each queue during each cycle required manual tuning based on our needs; 100 works for us, for now. n can be anything from 1 to the maximum number of concurrent tasks you have available in your pricing plan.)
  • Each child worker does its thing and empties its allocated messages from the queue in under 15 seconds.

This took us from having the ability to process 1,000-2,000 records/minute to 120,000/minute (2,000/second) based on our current pricing plan. Bumping ourselves up to the next plan would put us somewhere around 300,000/minute which clocks in at 5,000/second. And we didn’t bump write throughput up a single tick. Increase the write throughput and things get crazy fast!

And the best part? Everything I’ve mentioned above took less than a day to implement and costs less than $500/month (AWS costs included). FO REALZ.

Limitless scalability is real and the team at Iron.io is making it happen. IronWorker is rock solid and our stack wouldn’t be the same without it.

Tags: , , , , , , , ,




Enter your email address to follow Relify and receive notifications of new posts by email.

Powered by FeedBurner

Authors

Andria Trivisonno
Andria Trivisonno

Product development, digital marketer, Libra, travel lover

John Krebsbach
John Krebsbach

Biz dev, networker, numbers guy, music aficionado

Terry Horner
Terry Horner

CEO, dad, husband, nerd, hacker, triathlete