from Hacker News

Show HN: Learn how to build a small Twitter clone in 7 days

by shane_burkhart on 12/17/16, 9:06 PM with 63 comments

  • by derefr on 12/18/16, 6:02 PM

    "Small Twitter clone" can be taken two ways, and this one, I think, is the less interesting of the two. (Not to denigrate the project for what it is; it's a good idea.)

    On a one-machine scale, Twitter can be a single Postgres table, or a single ElasticSearch index. At the scale they actually are, it's really a whole lot more.

    I'd really love a tutorial—or possibly a whole book—that instead took you through setting up the sort of distributed system that is required to make a Twitter clone run at a Twitter-like scale. Either through IaaS APIs, or on your own with something like OpenStack DevStack.

    It could probably start where this tutorial ends—with a one-node system running a Twitter-backend-alike monolith. And then each chapter would increase the scale, introduce a problem the scale causes, and then walk you through adding in an additional component: a message queue; a fragment cache; app-level health checks; a search indexing cluster; distributed logging + request tracing; geographic sharding; multi-master DB replication—in order to solve that scaling problem.

    There would also be scale-points that would require changes in the business logic: making IDs globally unique and sortable ala https://github.com/twitter/snowflake; deprecating but keeping around old APIs as new ones are added; "Ball of Mud" refactorings; isolated Enterprise clusters of the app; etc.

    Bonus points if later chapters actually go back and rip out solutions that were introduced in earlier chapters—not because they were mistakes, but just because they were right for 10^3/s but not 10^6/s. And bonus bonus points if they assume an SLA that requires that such switchovers occur without downtime.

  • by soneca on 12/18/16, 1:30 AM

    I finished the course a few days ago and it was awesome. Of course it is not a fully functional complete clone, but it is an incredible learning resource.

    It really starts from the beginning as in "first you have to install the proper tools and prepare your software development environment" beginning. Which is great to teach you things that you wouldnt learn in other free online courses.

    I think it is a essential resource that present you the full stack of a web app, acting as the perfect complement to more pure code oriented courses like freecodecamp and codecademy.

    And you can really start from zero coding knowledge. I fully recommend it.

  • by dom96 on 12/18/16, 9:44 AM

    This looks like a really cool course.

    In case anybody is interested in learning how to build a Twitter clone in Nim then consider taking a look at my book[1]. It's not free but it is a good way to learn Nim and web development concepts in a systems programming language.

    1 - https://manning.com/books/nim-in-action?a_aid=niminaction&a_...

  • by Veratyr on 12/18/16, 5:13 AM

    Interesting that your site doesn't work at all without allowing third party scripts. I don't think I've ever seen anything like this before, hosting the entire page on another domain.
  • by newscracker on 12/18/16, 3:44 PM

    I visited the page with uBlock on and nothing showed up. The I noticed that leadpages.net is blacklisted on it. So I had to remove the Ad Block and refresh the page.
  • by riffic on 12/18/16, 3:59 AM

    Cool, may I recommend building an OStatus-compliant twitter clone?

    https://www.w3.org/community/ostatus/

  • by wofo on 12/18/16, 3:40 PM

    Thanks for the course! I have a question unrelated to the contents: Why did you choose to release it for free? I guess you spent a lot of time preparing it, so I assume there must be some kind of (non-monetary?) benefit you expect to get from it.
  • by bootload on 12/18/16, 5:30 AM

    @Shane, is the course emailed in one hit, or in batches. If so that is an interesting way to do it (phased roll-out of course by email) in itself.
  • by rexreed on 12/18/16, 5:38 PM

    Ugh, I had to unblock a bunch of scripts to even view this page. Super fail. I'm going to reblock everything I just blocked. Thanks.
  • by Andrenid on 12/18/16, 7:06 AM

    Can you let the emails roll in, then do the course later in your own time? Or do the links expire?
  • by user5994461 on 12/18/16, 1:01 PM

    The page is empty. Blocked by uBlock Origin.
  • by was_boring on 12/18/16, 5:14 PM

    How did we as an industry go from "create a blog in 10 minutes" with rails to a "create a twitter clone in 7 days"?

    It seems we have gone backwards in terms of speed of getting things done in the last decade.

  • by DrewWeth on 12/18/16, 1:22 AM

    I got an email with the first course today and was pretty blown away tbh.
  • by chrismorgan on 12/18/16, 2:57 AM

    That 1.5MB of image on the landing page should be shrunk drastically—you could trivially shave a megabyte off it, or even more.
  • by codesternews on 12/18/16, 9:31 AM

    Is their any other sites/courses like this freely available?
  • by azdavis on 12/18/16, 3:37 AM

    Minor nitpick: it says "...you will learn how to:" and then one of the bullet points (the one about SQL) starts with "How to..."
  • by syngrog66 on 12/18/16, 7:42 PM

    if the feature scope and traffic scale is small enough you can build a Twitter-like in 7 hours. if not 7 minutes. given all the tools, frameworks and services avail today.

    scope and scale are key

  • by vijayr on 12/18/16, 1:59 PM

    Is there anything like this for heavier topics like AI,ML etc?
  • by arisAlexis on 12/18/16, 6:40 AM

    I built writedown.co which is a blockchain enabled immutable Twitter clone. Check it out.if you like
  • by fiatjaf on 12/18/16, 3:33 PM

    Twitter clones are the easiest thing to teach in a beginner programming class. That's ok, but don't say it like it is an amazing thing.
  • by zizimaza on 12/18/16, 1:42 AM

    Lurker here. Someone mentioned this the other day here too. Too bad Twitters dying, but you get the idea. https://news.ycombinator.com/item?id=13157254