
Ask HN: If you had to build a clone of Facebook, what tools would you use? Why? - mariusandra
If you had to build the current version of Facebook from scratch, which technologies you would use and why?<p>Let&#x27;s assume you had to build an application of complexity comparable to the current version of Facebook and can take all the time you need.<p>What technologies would you use for each part of the application? Why these? Which languages would you build it in? Any existing libraries or would you write everything from scratch? Why?
======
contingencies
I like your question... it's a shame it hasn't garnered more response.

Fundamentally, by removing the time consideration the question becomes very
unrealistic, but I'll bite anyway.

First, you'd have to establish some purpose beyond cloning. Cloning to free
the world of a centralized facebook and the surveillance burden that goes with
it? Let's run with that.

Design-wise, we're looking for adoption. The easiest identifiers to use are
email addresses and phone numbers, though neither are particularly secure we
can play on the fact that many people have both to offer two factor
authentication of public keys while supporting the only-has-one use case with
snail mail or alternate communications path (eg. in person key digest
validation) recommendations. OK, so now we've got half a basis for some
decentralized exchange that supports mass adoption.

Next up is sell. How to make this more interesting to the average punter than
Facebook, while maintaining global appeal and not having to take on the burden
of content creation ourselves? Perhaps with strong support for the content
classes people are time and time again proven to care about: drugs, porn and
p2p media. This doesn't necessarily have to break any laws, but it probably
will in some self-labelling-as-democracy-exporter draconian regime, so we have
to include this factor in the design. Luckily, decentralization will be a big
help.

Finally, we would want to incentivize people to market outside of the network
to pull in new friends. This could be done by developing some unique physical
use cases like phone-to-phone ad-hoc wifi based sharing and public use local
storage drop wifi boxes around major cities.

The total hardware weight of such a clone would not be as big as Facebook,
simply because of its distributed nature. In fact, it would be far smaller.
The search would be different, and would only affect people who chose to
register in a central registry. This could even be developed by a third party
(or better: multiple third parties, seeded by giving away a proof of concept
open source codebase) in order to enhance diversity and thereby strengthen the
infrastructure against authoritarian takedowns.

Well, just some ideas. Less tech-stack oriented because connecting to fewer
peers would probably remove most of the scaling problems. I think that mobile
platforms generally demand a certain tech stack, and of course web stacks have
been done to death here...

------
byoung2
A lot of the tools Facebook uses now are out of necessity because of the
massive number of active users. Do I have to build something to support
billions of users from day one? Or do I just have to support all of the
functionality but just a handful of users? The two scenarios would require
vastly different approaches.

~~~
abestic9
Well said.

If I had to scale for tens of millions of users, 80% of which log in at least
once per day, I would be focusing my effort on the most EFFICIENT technologies
(watts per request). If there's capital, I'd look at what Facebook has done
already and give it my own twist. I'd purchase the property and hardware up
front and get to work building the platform, forking existing code where
needed.

If we're talking about 10,000 users, then I'm going to pick a technology that
gives me a lot more flexibility. In fact, I would probably just extend an off-
the-shelf PHP/MySQL package with an nginx EC2 instance to save myself the
effort of building from scratch, because I wouldn't have to.

