Frayt's Fresh New Paint

Frayt's Fresh New Paint

Welcome to Frayt's new technical blog! We'll be sharing some of our insights as we continue to build up our platform.

Who Is This For?

These posts will be geared towards fellow developers, so a basic understanding of modern web development will be assumed. You're free to read these posts without such knowledge, however. We'll be trying our best to write in an accessible manner. But no promises! There's also a comments section below every post for any additional questions/feedback you may have.

Why Start This Now?

Every developer has heard the horror stories. You've built out a wonderful platform that Just Works™, but the moment it tastes an exponential growth of users, your servers irreparably burn their tongues and the chatter of support tickets never cease.

Thankfully, Frayt had the foresight to realize our current infrastructure would not last. Before we felt the worst of our growing pains, we began rebuilding our platform from the ground up with a technology notorious for its scalability and unparalleled concurrency.

Rising From The Ashes

Since a few of us were familiar with Ruby on Rails, we ended up choosing the Phoenix framework. It's written in Elixir, which shares a lot of Ruby's clean and intuitive syntax. And like Rails, Phoenix utilizes the MVC pattern. Even the Rails CLI is mirrored in Phoenix's built-in CLI tasks. We wouldn't be diving into completely unknown waters, and thus we could be productive right out of the gate.

But the main reason we chose Phoenix was for its reliability and scalability. Each request made to the server is its own separate Erlang process, which means they're cheap to create and free to crash without interrupting the rest of the application. When the Phoenix team reached 2 million concurrent WebSocket connections on a single machine, they were only limited by how many connections their operating system could allow.

Testing The Waters Together

To ensure we could rebuild our platform in a timely and efficient manner, we partnered with the amazing team at Gaslight to be taught the Elixir way, tag-teaming problems together as we follow Test-Driven Development (TDD). Pair programming quickly got us up to speed on Elixir's syntax and best practices, while TDD ensured we'd write clean & reliable code with complete confidence.

It wasn't long before pattern matching became second nature and we could start a supervisor without any Gaslight supervision. In total, it took the Gaslight & Frayt team only four months to rewrite the majority of our platform and launch it before our current infrastructure bit the dust.

No Longer A-Frayt Of The Future

The Frayt team still has a lot of work to do, but we can rest assured that our servers won't be melting. We can instead envision the bright future just beyond our horizon. In particular, we're hoping to utilize more of Phoenix's Channels to provide fast and efficient real-time updates to our apps. But that's a post for another time.

If you're interested in helping build highly performant apps and infrastructure, give us a holler.

Show Comments