Over a million developers have joined DZone.
Platinum Partner

The Simplest Way To Collect Application Data On Heroku

· Cloud Zone

The Cloud Zone is brought to you in partnership with Mendix. Better understand the aPaaS landscape and how the right platform can accelerate your software delivery cadence and capacity with the Gartner 2015 Magic Quadrant for Enterprise Application Platform as a Service.

Curator's Note: The content of this article was originally written by Masa over at the Treasure Data  blog.

At Treasure Data, we constantly try to simplify how our customers collect and interact with their data.

Over the past several months, we reached out to two dozens or so customers and listened to their feedback. One pattern emerged: they spend a lot of time on data collection and wanted something simpler.

So, we rolled up our sleeves and built a feature to simplify data collection even more: from now on, our Heroku customers can store data on Treasure Data by just printing to stdout in a specified format.

Treasure Data's Heroku Log Drain Integration

The format is very simple:

@[db_name.table_name] json_in_one_line

e.g., if you wanted to store the event { "first_name": "Bob", "last_name": "Smith" } into the table users in the database service, you just write

@[service.users] { "first_name": "Bob", "last_name": "Smith" }

into stdout. Hence, in Ruby,

puts '@[service.users] { "first_name": "Bob", "last_name": "Smith" }'

in Java,

System.out.println("@[service.users] { \"first_name\": \"Bob\", \"last_name\": \"Smith\" }")

in PHP,

echo '@[service.users] { "first_name": "Bob", "last_name": "Smith" }'.PHP_EOL;

in Node.js,

process.stdout.stream('@[service.users] { "first_name": "Bob", "last_name": "Smith" }')

and so on.

As you noticed, this new interface is language agnostic: all languages let you print out to stdout out of the box, and that’s all you need to get started with Treasure Data on Heroku now.

So, if you are a Heroku user, just run

$ heroku addons:add treasure-data:nano

and start collecting data today.


Masa, the engineer who built this new feature, likes to bike everywhere, rain or shine.

The Cloud Zone is brought to you in partnership with Mendix. Discover how Mendix for Mobile App Deveopment makes it incredibly fast and easy for any developer to build engaging multi-channel apps.


Published at DZone with permission of Sadayuki Furuhashi , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}