+ All Categories
Home > Technology > Delivering Data - Social Networking Personal

Delivering Data - Social Networking Personal

Date post: 27-Jun-2015
Category:
Upload: iasaireland
View: 721 times
Download: 0 times
Share this document with a friend
Popular Tags:
22
Social networking architectures what can we learn
Transcript
Page 1: Delivering Data - Social Networking Personal

Social networking architectures what can we

learn

Page 2: Delivering Data - Social Networking Personal

An enthusiasts view2

Page 3: Delivering Data - Social Networking Personal

How do sites with a social networking angle figure globally?

3

As ranked by AlexaSite Global rankingFacebook 2YouTube 3Yahoo 4Windows Live 5Blogger 7Wikipedia 8Twitter 10

Page 4: Delivering Data - Social Networking Personal

3 Principles4

3 common principles

1.Fast feature delivery is key

2.Cache everything everywhere

3.Relational data is dead

Page 5: Delivering Data - Social Networking Personal

Interesting stats5

Facebook - Serve 120 million queries per second without a single join

37 Signals - Developed a production application serving over 4 million items using only 579 lines of code

Flickr - 2 Billion photos served without using relational databases

Page 6: Delivering Data - Social Networking Personal

How did they do it?6

Nobody thought this was possible

Unencumbered by history or restrictive rules

Had to be creative in solving problems that nobody had experienced using very little capital outlay

Page 7: Delivering Data - Social Networking Personal

3 Principles7

1.Fast feature delivery is key

2. Cache everything everywhere

3. Relational data is dead

Page 8: Delivering Data - Social Networking Personal

Fast feature delivery is key8

Choose an appropriate language

Speed of development more important than speed of execution

Languages like PHP and Ruby commonly used for rapid development and deployment

Page 9: Delivering Data - Social Networking Personal

Language is not religion9

Page 10: Delivering Data - Social Networking Personal

3 Principles10

1. Fast feature delivery is key

2.Cache everything everywhere

3. Relational data is dead

Page 11: Delivering Data - Social Networking Personal

Cache everything everywhere11

You need a really good reason not to cache data for reading

Local caching a good start but more than one server means duplicating the cache no group invalidation memory limited to how much spare RAM on the server

Most social networks use a distributed cache like memcached

Page 12: Delivering Data - Social Networking Personal

Cache everything everywhere12

1. Check if the information is in the cache. If so, use it

2. If not, query the database put the result in the cache

3. On update delete from the cache. The next user goes to the database

function get_foo(int userid) { result = memcached_fetch("userrow:" + userid);

if (!result) { result = db_select("SELECT * FROM users WHERE userid = ?", userid); memcached_add("userrow:" + userid, result);

} return result;

Page 13: Delivering Data - Social Networking Personal

Responsivness is key13

Page 14: Delivering Data - Social Networking Personal

3 Principles14

1. Fast feature delivery is key

2. Cache everything everywhere

3.Relational data is dead

Page 15: Delivering Data - Social Networking Personal

Everybody wants to use a database15

Page 16: Delivering Data - Social Networking Personal

Relational issue No 1 - Normalisation16

Relational databases do not scale well because of normalisation

Why normalise?- reduce storage space- reduce anomalies

Today - storage is cheap- as data gets larger, joins are

expensive

Page 17: Delivering Data - Social Networking Personal

Relational issue No 2 - Transactions17

ACID principles govern transactions

Relational databases do not scale well because of transactions

Page 18: Delivering Data - Social Networking Personal

After relational18

Use BASE (basically available, soft state, eventually consistent)

Shard Data

Favour Name value pair stores over relational databases

Page 19: Delivering Data - Social Networking Personal

Lessons for enterprise19

Design of software should always be it depends.

Test your most basic assumptions

1. Dynamic languages and frameworks may be suitable to deliver a feature quickly

2. You don't need an RDBMS for everything, especially if you need huge scale

3. You should always cache data for read (unless you shouldn’t)

Page 20: Delivering Data - Social Networking Personal

Fresh ideas always welcome20

Page 22: Delivering Data - Social Networking Personal

Or find me here22


Recommended