Codebits Handivi

Post on 28-Jan-2015

104 views 0 download

Tags:

description

Presentation on what happens behind the scenes at handivi.com by Celso Pinto for SAPO's Codebits 2008

Transcript of Codebits Handivi

Technology in a startup @ 7syntax

Celso PintoCoder, headbanger, biker and founder

And Python lover

Then: 2 + 1 idea

Now: a 5 men army

Fighting the evil empire!

with

A tech startup lives by it's tech

TECH FAIL

From the very back end...

http://flickr.com/photos/your_teacher/133262843/

Question time!

So, about data storage

✔ Fast key based access✔ Cheetah-fast list fetches✔ Prefer to search with Lucene

Relational is dead... to me!

✔ Fast key based access✔ Cheetah-fast list fetches✔ Prefer to search with Lucene

Cheetah fast reads

✔ Standard mailboxes, accessible via POP/SMTP

Stuff I actually considered

✔ Standard mailboxes, accessible via POP/SMTP✔ Fixed block files

Stuff I actually considered

✔ Standard mailboxes, accessible via POP/SMTP✔ Fixed block files✔ MogileFS (plus Lucene for complete indexing)

Stuff I actually considered

But then...

Any day now

✔ Easy sharding✔ Incredibly fast reads, faster than cheetahs!✔ Develop views in a(ny) familiar language✔ One instance can handle 500.000 databases✔ Each database can easily store millions of records✔ Online backups/snapshots and compaction

What we get from CouchDB

✔ It's a “tad” slow on inserts✔ 50 inserts per second✔ We can push it to 500 by dropping fsync's and using

tmpfs

CouchDB has warts too :-(

But it doesn't matter: we <3 CouchDB!

Any questions so far?

Programming language(s)

Programming languages

Programming languages

No!

No!

Programming languages

The Snake

HisssssssssssssssssHiss hiss Hiss hiss Hissss hiss Hisss hisss Hissss hiss Hiss hiss Hiss hisss Hisss hisssssss Hiss hisss Hiss hissssss Hiss hiss Hisss hissss Hisss hiss Hiss hiss Hisss hiss Hisss hiss Hiss hiss Hiss hisss Hisss hisss Hiss hiss Hissss hissss Hiss hiss Hissss hisssssss Hiss hiss Hiss hiss Hiss hisss Hisssss hissss Hiss hiss Hissss hisssss Hiss hiss Hisss hiss Hisssss hiss Hisss hisss Hissss hiss Hisss hiss Hisss hiss Hissss hissssssss Hiss hisssssss Hissss hisss Hiss hisss Hissss hiss Hiss hisss Hiss hiss Hisss hisss Hissss hiss Hisss hissss Hiss hiss Hissss hisssssss Hiss hissss Hiss hissss Hiss hisss Hisss hissss Hisss hiss Hiss hisssss Hisss hisss Hissss hiss Hisss hisssssss Hiss hisss Hisss hissss Hiss hisss Hiss hissssss Hiss hisss Hissss hiss Hisss hiss Hiss hisss Hiss hiss Hisss hissss Hiss hiss Hissss hiss Hiss hisssss Hisss hisssssss Hiss hissss Hiss hisss Hissss hiss Hiss hiss Hiss hiss Hissss hisss Hissss hiss Hisss hisssssss Hiss hisssss Hisss hisss Hiss hiss Hiss hisss Hiss hiss Hisss hisss Hissss hiss Hisss hiss Hiss hiss Hiss hiss Hissss hisssss Hisssss hiss Hisssssss hissss Hiss hissss Hiss hisss Hisss hiss Hissss hissss Hiss hiss Hiss hisssss

* you need Acme::Python to understand this

Only one restriction

4 space indentsBut you should be doing that already!

Other advantages

Here we have Python Some other language

After one year

Still Python Some other language

On the mobile

On the mobile

On the web front

On the web front

Any questions?

Frameworks vs. Libraries

Siza Vieira

The blue pill

✔ Modular: we can replace have replaced many parts✔ Stable/solid: impressive # of tests, great docs!✔ Easily hackable: it's Python after all

Why Django?

No, seriously...

Alright, you win

✔ Auth: we built our own from the start✔ Sessions: in-house developed stateless sessions✔ ORM: now on it's way to meet the dodo!✔ By extension: we never got the chance to use the

admin application

What we replaced

✔ Templates: inheritance is great!✔ Request handling/routing rules engine✔ Forms: lots of validation there✔ … other bits I can't really remember

What we're keeping

How we're using Django

Any questions about Django?

Messaging

✔ Throttling, balancing, loose coupling✔ We can tap into any queues and experiment✔ Remember CouchDB? MQ is the MDA for each

“mailbox”

Why is it important to us?

Lots of good stuff out there

✔ ActiveMQ: stable, small and fast enough✔ Many protocols: we chose STOMP, nice to debug✔ Had to create AsyncIO Python lib

Our choice

✔ Does MDB mean anything to you?✔ Python has no MDB container, had to create one✔ Python + processing (new in Python 3000):

✔ Configuration similar to Django's✔ 1 process => 1 destination consumer

Final bits on messaging

Any questions about messaging?

Wrapping up

Current architecture

mobile ?mobile webmobile

perlbal

API (django apps)

static Ct. adapter

consumers

writes

accounts User 1 User 2 User nCouchDB

reads S3

Any final questions?

Thank you very much!

Celso Pinto // cpinto@7syntax.com