Skip to main content
Full Stack Radio

107: Sam Selikoff - Pushing Complexity to the Client-Side

50 min episode · 2 min read
·

Episode

50 min

Read time

2 min

Topics

Productivity, Relationships, Software Development

AI-Generated Summary

Key Takeaways

  • JSON API Resources gem: Eliminates controller code by declaratively defining resources in Rails that automatically handle CRUD operations, routing, and model mapping. Developers specify relationships and attributes, letting the gem generate standard endpoints without writing custom controller logic.
  • Client-driven validation strategy: Implement duplicate validations on client and server, using client-side checks for immediate feedback and server validations as the canonical guard. For uniqueness checks, query the API for existing records rather than creating custom validation endpoints, keeping the server dumb.
  • Direct S3 uploads pattern: Request signatures from the server as a resource, upload files directly to S3 from the client with that signature, then update the model with the returned URL. This eliminates server bandwidth doubling and enables rich upload experiences with progress bars.
  • Escape hatches for custom logic: Use before_save and after_save hooks on resources or drop into custom controllers when needed for operations like Stripe payments or email notifications. Ninety percent of code remains declarative CRUD operations, with custom logic only where absolutely necessary.

What It Covers

Sam Selikoff explains how to build client-side applications using Ember and Rails APIs, focusing on keeping server code simple by pushing complexity to the client through JSON API conventions and declarative resource definitions.

Key Questions Answered

  • JSON API Resources gem: Eliminates controller code by declaratively defining resources in Rails that automatically handle CRUD operations, routing, and model mapping. Developers specify relationships and attributes, letting the gem generate standard endpoints without writing custom controller logic.
  • Client-driven validation strategy: Implement duplicate validations on client and server, using client-side checks for immediate feedback and server validations as the canonical guard. For uniqueness checks, query the API for existing records rather than creating custom validation endpoints, keeping the server dumb.
  • Direct S3 uploads pattern: Request signatures from the server as a resource, upload files directly to S3 from the client with that signature, then update the model with the returned URL. This eliminates server bandwidth doubling and enables rich upload experiences with progress bars.
  • Escape hatches for custom logic: Use before_save and after_save hooks on resources or drop into custom controllers when needed for operations like Stripe payments or email notifications. Ninety percent of code remains declarative CRUD operations, with custom logic only where absolutely necessary.

Notable Moment

Selikoff describes building a real-time conference app using Firebase and Ember where creating models in the Firebase console instantly updated the Ember application in another browser without any custom synchronization code, demonstrating the power of hosted backend services.

Know someone who'd find this useful?

Episode Transcript

In this episode of Fullstack Radio, I continue my conversation with Sam Selakoff about building client side applications. This time focusing on how to keep your API code simple and how to push more of the complexity into the client. This is Fullstack Radio episode one zero seven. Hey, everyone. Before we get into the discussion with Sam today, make sure that you go back and listen to episode one zero six before this one, if you haven't already. As this is kind of like a part two of that conversation, we recorded it all together and I just kind of split it up into two episodes because it was a really long conversation where the first half was sort of focused on one topic and the second half was focused on another. So there are some times in this conversation where we reference things in the previous episode as if it was a continuation of that conversation. So if you haven't listened to that episode, definitely check that one out first. And if you have listened to it, enjoy this conversation with Sam. So the next piece that I wanted to get into is what your server stuff looks like and how much of that stuff, like, you aren't doing anymore that maybe I am still worrying about in, like, my server rendered applications, how much code, like, you have to write there, how complex it is, what sort of stuff it's doing. Because I know, typically, based on the conversations I've had with you in the past, your Ember apps are most of the time you're backing them with, like, a rails API that you guys are building yourself and managing yourself. And I know the Ember map site has a rails API backing it. Right? Yep. So what does your rails API look like when you're making this like concerted effort to push as much logic and responsibility as possible into the client? So we use, something called JSON API which is just a format for how to structure those JSON responses, and requests. And this was, created by some of the folks who work with Ember, but basically it's just some conventions around it, around your API. There's also some tools and there's some gems in the rails ecosystem that help if you are building, JSON API API. So I know JSON API is like the worst name ever because it, you know, it's a it's a spec. There's so many other JSON APIs that don't implement the JSON APIs back. Exactly. But you can imagine, you know, GraphQL is a is a similar idea where, it's really a spec that's designed to serve fat clients. It's it's designed to serve, clients with rich interactions and capabilities to enable them to build new UI features with spending the littlest amount of effort possible on your back end. That's kind of the that's kind of where it came from. So, with JSON API, we use this gem …

Get the full transcript (10,215 words) + summary by email — free

One-time email with the complete transcript and AI summary of this episode. No account needed.

One email, no spam. We’ll also show you what SignalCast does.

Browse all Full Stack Radio transcripts →

You just read a 3-minute summary of a 47-minute episode.

Get Full Stack Radio summarized like this every Monday — plus up to 2 more podcasts, free.

Pick Your Podcasts — Free

Keep Reading

Books, tools, and gear mentioned in this episode

SignalCast may earn commission on purchases via these links.

Tools

  • SPONSORS: Cloudinary at cloudinary.com
  • JSON API Resources gem: Eliminates controller code by declaratively defining resources in Rails that automatically handle CRUD operations, routing, and model mapping.
  • Sam Selikoff explains how to build client-side applications using Ember and Rails APIs, focusing on keeping server code simple by pushing complexity to the client.
  • Sam Selikoff explains how to build client-side applications using Ember and Rails APIs, focusing on keeping server code simple by pushing complexity to the client.
  • Selikoff describes building a real-time conference app using Firebase and Ember where creating models in the Firebase console instantly updated the Ember application in another browser.
  • SPONSORS: Rollbar at rollbar.com/fullstackradio

More from Full Stack Radio

We summarize every new episode. Want them in your inbox?

Similar Episodes

Related episodes from other podcasts

Explore Related Topics

This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.

Read this week's Software Engineering Podcast Insights — cross-podcast analysis updated weekly.

You're clearly into Full Stack Radio.

Every Monday, we deliver AI summaries of the latest episodes from Full Stack Radio and 192+ other podcasts. Free for one show.

Start My Monday Digest

No credit card · Unsubscribe anytime