Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Ryan Dy

Posts By

PIVOTAL LABS
SF Standup 03/14/2012: Capybara and push state

Help

No help

interesting

If you are using capybara-webkit gem that you should install QT 4.7+, if you need to use pushState/replaceState. Also defining those functions with mock implementations is another good solution.

The gem term-ansicolor has been removed from the heroku gem. It is still a dependency of foreman which is used by the lastest Heroku stack. The license on gem term-ansicolor is gplv2.

Guard with spork takes away a lot of the pain of using spork. Use the gem guard-spork which takes care of building you a sample guardfile. It takes care of restarting the appropriate framework you have in use be it test unit, rspec or cucumber.

LABS
SF Standup 9/13/2011: Tempfiles, Rails3.1 Asset Pipeline and Ruby Kids

Help

  • Tempfiles created by paperclip or similar ruby gems don't seem to get cleaned up. Is it best to monkey patch the use of the tempfiles and make sure unlink is called? Is it better to create a cron job that inspects tempfiles that haven't been touched for awhile and clean them up?

Interesting

  • If you are migrating from a Rails 3.1 release candidate you might need to generate a new production.rb file that configures that asset pipeline in production differently. Also, if you are using Capistrano 2.80 you should: load 'deploy/assets' in your deploy.rb file. This will do the proper compilation and copying of assets in your shared release folder. Check out the asset pipeline guide.
  • Kids Ruby is have an event in cooperation with Gogaruco at Pivotal Labs this Sunday from 12-2. Register for it here.

LABS
SF Standup 06/15/2011: Ruby 1.9.2patched and iScroll

Ask for Help

Interesting Things

  • Looking for performance patches from ruby 1.9.3 that improve the performance of require? They have been back ported to ruby1.9.2p180.
  • A new version of iScroll has been released (v4.1.3). It has performance fixes and better compatibility support. If you need position:fixed or overflow:scroll on a mobile device today you need to check it out.

PIVOTAL LABS
SF Standup 06/13/2011: Ackmate and UTF8

Ask for Help

Interesting Things

  • If you are having trouble with find and files with textmate or ackmate you might want to add an exlcusion for "solrdata" in textmate folder references exclusion list. Apparently this is fixed in an undocumented version of ackmate on github.
  • Peter Cooper and Jason Siefer have a new Javascript podcast, subscribe today!

LABS
GoGaRuCo '09 – CouchDB + Ruby: Perform Like a Pr0n Star – Matt Aimonetti

CouchDB + Ruby: Perform Like a Pr0n Star - Matt Aimonetti

Intro

GoGaRuCo '09 - CouchDB + Ruby: Perform Like a Pr0n Star - Matt Aimonetti

Matt Aimonetti is part of the Merb team.

Size matters

  • memory usage
  • amount of servers
  • infrastructure

You need reliability

Fault tolerant

  • downtime

GoGaRuCo '09 - CouchDB + Ruby: Perform Like a Pr0n Star - Matt Aimonetti

Multiple Partners

  • Nice public interfaces
  • no discrimination

Scalability

  • reaction underload
  • handle concurrent connections
  • numbert of requests persecond
  • latency

Approaches

Every p0rn star needs a trick

Enter CouchDB

Why aren't you a porn star now? Because of RDBMS

What does RDBMS have problems?

  • most/all fields become options, schema changes and it becomes hard to deal with
  • joins hurts performance (add indices/tables)
  • replication is difficult when using multiple masters
  • auto-incremental ids

What other kinds of approaches can we use?

Hypertable

Distributed Hash Table

  • fault tolerant
  • used by p2p and IM
  • memached is another example

Some other projects: Project Voldemort, Tokyo Cabinet, Redis

What is CouchDB?

It is a project written in Erlang by Apache. It uses spider monkey.

Can be used as a key/value store. Can also put data in a schema-less store, format your data as a JSON object and dump the whole thing into the db

CouchDB comes with a nice web interface called Futon that lets you inspect your database and its contents.

CouchDB is de-centralized. You can do replication between multiple masters.

map/reduce is built in to compute data. Maps and reduces can be written in Javascript.

Optimized for the web, more reads than writes.

  • full Acid compliance
  • https rest interface
  • caching (couchdb uses etags) - this makes caching with existing HTTP caching technology (nginx+memcache, varnish, etc) really easy.
  • built-in conflict management using MVCC (multiversion concurrency control)
    • Every single record gets saved as a different revision
  • document attachments are attached as document stubs, that also get replicated to different nodes and don't use a lot of memory

couchdb-lucene

How does this relate to Ruby?

Using CouchRest Everything is a JSON object.

You can define properties so you get an attribute reader/writer, and do document.attr

There is no SQL in CouchDB, you do queries like Card.first, Card.all, Card.get('matt_aiomonetti')

The problem is trying to map documents into Object-Oriented languages, but it doesn't always work. If you have dependent objects (such as Card and Address), then you tell CouchDB to cast it as something.

property :questions, :cast_as > ['Question']

Callbacks:

save_callback :before, :generate_slug_from_title

Relationships can be done, but you have to decide how to do it, and there are a lot of ways.

When to use couch?

  • When you need to scale you database and availibility is more important than consistency.
  • When your data is decentralized (you have more than one master
  • When you need to compute data

Use cases:

  • Analytics - combined with traditional rdbms system to get statistics using couchdb
  • Personal finance - Bank accounts in different countries - download all accounts, and can process in one place - attach PDF files, desktop app, etc.
  • Medical Record System - Many patients with visits, history, records, etc.
  • distributed e-commerce sites (1 main website working with multiple partners, the data can be replicated easily) In this case, CouchDB is much faster than RDBMS, because of drugs, compounds, and complex structures.

Questions

Q: Can you use couchdb with objects that have attributes that change often?
A: Yes you can use it.

Q: There are many ways to do relationships. Can you give an example?
A: Blog has an article with many comments. You can make one doc that is an article, and you can add comments. Problem is you need to send the whole document that increases risk of conflicts. So you create a new object that is the comment object that just refers to the article. Then, in the view you define the Article as aggregating all comments. Alternately, you can make a query to retrieve all comments for the article.

PIVOTAL LABS
Standup 02/18/2009

We're looking for more information about Taste or other similar kinds of suggestion engines. What kind of experiences have people had integrating these tools into Rails applications. Are there other useful engines worth looking at?

Direct uploads to Amazon S3 service can be serviced by EC2 servers; however, there might be more direct ways of doings this with S3.

Newer versions of RubyMine have been reported having problems running the gem version of rspec but a solutions has been found. The problem comes from the way gems are specified in RubyMine. You need to add the rspec gem you are using to the Project Structure >> Ruby SDK and Gems.

Using Desert and exception notifier can cause some slow startup times. If you are seeing this problem try moving exception notifier's sender_address inside your environment's post-load block.

PIVOTAL LABS
Standup 03/6/2008

There is a firebug that works with Firefox 3, it can be found at GetFirebug.com. The current beta version 1.1 appears to fix a problem that Firebug was having with inspecting anchor elements.

Also, there is a google code project ie7-js. It is a Javascript library that attempts to make IE7 behave more like a standards-compliant browser. It includes a limited PNG transparency fix. It also gives you Pseudo-element like :before and :after.

Combining this with yui and IE7 gets a lot closer to behaving as you might expect!