Apresentação common lisp
Como estou começando com django agora, ainda engatinhando, esta apresentação do Adriano Petrich ajudou *a lot* a me situar no universo pythonico aqui. Fica a dica aí pra quem tiver meio perdido sobre o que usar e como usar para testar seus projetos django.
Grande abraço,
Até a próxima!
Last weekend i've competed at Rails Rumble 2010, an awesome contest 48 hours Web Application Development. I've been part of Fanfateam, along with other 2 awesome developers (@ramonpage, @viniciusteles). Tapajos had some problems at the very last minute and (sadly) couldn't make it this year.
It's my second time (Portuguese only) at the contest and i must say that is definitely not my last; participating in such a competition like Rails Rumble is like experiencing all the phases of a "normal" software development project, but fast forwarded in a couple of days. If you are interested in web development - be it as a developer, devops, designer, etc... - you *should* be in a competition like that. It will impact for sure the way you face your projects now on. In our team, we had a great time building http://photoque.st which is simple and fun way to test your knowledge about places and, also, your friends as well. I would like to share some thoughts that we had in our team after this rumble:People that are judging have a lot (almost 300) of web apps to rate. Try to picture yourself in their shoes: you would not be happy to have to provide 300 different credentials in order to get the first taste of your software. Same applies in our non-rumble projects: user's attention is disputed among every single site at the Internet. Easing the transition from a user to a customer is
I understand that not every app can be 100% (or even near to it) public, but i think we as developers have to rethink twice if that is *indispensable* to ask our visitor's information. If it isn't strictly required, don't do it. Examples that have inspired us are: posterous.com, thingler.com and scrumy.com. Everyone of these sites offer the user the opportunity to taste their apps long before they need to provide their credentials to use. Lowering the barrier for a visitor to convert into a user is a great way to improve your conversion rate. Even with all the problems with our application, it has a very interesting low bounce rate. I believe that not requiring a login at all has dramatically made a difference in that case.Feedback is essential for any process. That includes developing rumble apps. It is essential to define, respect and to review your plans constantly. At photoque.st we had quickly "daily meetings" (according to the scrum terminology) every 2 hours. That was crucial for getting everyone in that sense of urgency, so much needed to reach our Minimum Viable Product as soon as possible. That led us to cut down every waste of energy and time as quickly as possible.
At the 8 hours we didn't formally setted a timebox. The difference of productivity was huge, after we had that time constraint in place.Man, if you don't want to follow any other advice, just follow this one! By any costs you should follow that. The last hours at rumble, you will be tired, you will be really stressed. The probability for you to let some hard-to-debug-in-last-single-minute bug creeps in your code is too damn high.
We agreed to do our feature freeze 3 hours before the end of the competition. But...hmm, actually... we didn't. Not following that single advice led us to find our first bug 20 minutes before the rumble deadline. Do i have to say how crazy were those last 20 minutes to hunt down, test and redeploy our app?Delaying a feature past the deadline in order to get it done with the ultra-premium-ninja-like quality standards will not help you at all at this competition. The 48 hours rule is very rigid.
I'm not saying that you should develop in a poor, non-professional manner. Not at all! I'm only saying that you have to focus on what will really add value to your app. The cost benefit can be the change between a team who can complete their app and the other who don't. In our case, we didn't pay much attention to the speed that our test suite was being run. We did TDD, BDD and everything that a professional developer should do. But that bad smell coming from our test suite wasn't bad enough for us to spend an hour or so to fix it, so we decided to move along. That did bite us at the end. The test suite was too damn slow for us to run it at the very exact moment that we most needed it - the end of competition. That led us to a cowboy frenzy coding at the end. As expected, we had that quality issue 20 minutes before the deadline. My advice is to pay attention to quality issues. Very closely. But not be too precious about it, since the cost benefit is very important in a situation like that.That was (once again) a experience that i would recommend to every designer, developer or tech geek. Being in a competition like that was really a tremendous rewarding experience. My special thanks to the members of Fanfateam and the organizers of the contest for their effort in putting together this great event for the Ruby/Rails community. I must also thank a lot to Rafael that, even without being part of the team, helped a lot giving a plenty of invaluable feedback about our webapp.
The definition of MVP has become far too broad for comfort. Lets try to call a spade a spade.
There has been an abundance of posts recently on entrepreneur communities talking of Minimum Viable Product. Posts such as this one. Posts that talk of their new startup's "MVP", which is nothing more than a landing page in front of a registration page (to test the market potential of an idea). Tim Ferris, Eric Ries and no doubt the respective cults of, would condone this as superb MVP-ing as is often discussed on their blogs. You're all doing it wrong. I'm here to help clear this up:When You Create a "Fake" Landing Page to Test The Market and Capture Customer Info...This is called Test Marketing, or a "Dry Test". It is not a new idea, it wasn't invented by the web crowd, and small companies to large multinationals have been doing it for decades. It is useful for testing the initial viability of a product or service on a macro level and is a cheap, accessible form of testing for all kinds of companies - not just technology companies.When You Create a Beta Product That Early-Adopter Customers Can Use to Give You Feedback and Improve the Product Through Iteration...This is an MVP. Notice how in this case, you've created an actual product. That's what the P stands for in MVP. It is almost exclusively associated with software companies because thanks to low costs of development / infrastructure coupled with agile methods of product iteration, there is little risk involved in delivering an MVP to a customer base and then quickly improving on it. Rather less so than say, trying to deliver an MVP and then improving on it if yours is a physical, manufactured product where iteration cycles are slow and costly.One of the key differences between the two is the stage of the customer life cycle you are testing with your approach. The cycle goes Reach, Acquisition, Conversion, Retention (and sometimes includes "Loyalty" at the very end).With a Dry Test, you can test Reach and Acquisition - are people interested in your product? Can you be heard over a competitors marketing efforts? Do people talk about your product's upcoming launch?With an MVP, you can test Conversion and Retention - what features do your customers want that will help them stick around (or pay more)? What do your customers think are the best and worst aspects of your product? Is your pricing right?You cannot test those latter questions on an unqualified group of visitors to a fake landing page. They need to be users (or even better, paying customers) of a product to give authoritative feedback about a product that will influence a feature roadmap beyond your MVP.You can jump straight to building an MVP or you can Dry Test, then build an MVP. And now, hopefully there won't be any confusion about what to call it.
Excelente artigo explicando a diferença entre Minimum Viable Product e Dry-test. Muita gente acaba fazendo confusão e, as vezes, até mesmo escolhendo caminhos errados para sua ideia justamente por desconhecimento do que significa cada uma dessas estratégias.
Leitura recomendada :)
Pouco tempo antes de entrar na faculdade, me inscrevi num curso de desenvolvimento web numa instituição de ensino bem tradicional aqui do Rio de Janeiro. Do conteúdo apresentado, lembro-me até de bastante coisa, mas, devido aos avanços da tecnologia, pouca coisa pode ser aproveitada nos dias de hoje.No entanto, um ensinamento jamais esquecerei: "O que você está aprendendo no seu emprego atual?"
Um professor nos deixou esta reflexão pela qual balizei todas as minhas escolhas profissionais até hoje: "Vocês, enquanto desenvolvedores, são o seu maior patrimônio", dizia ele, "o que vocês perdem por não estarem evoluindo no que fazem todos os dias, não vale nenhum salário neste mundo". Se você, acorda dia após dia e trabalha em algo que não te acrescenta em absolutamente nada, você está fazendo com que o seu maior ativo (você mesmo! Seu conhecimento!) se deprecie cada vez mais. O que dizer da sua empregabilidade então? Cairá na mesma velocidade. Por trabalharmos com tecnologia, o tempo todo estamos propondo mudanças nas vidas dos nossos clientes. Mais ainda: estamos realizando mudanças nos ambientes pelos os quais passamos. O que esperar de uma pessoa que, mesmo tendo uma função tão dinâmica, se acomoda nesta zona de conforto e não emprega absolutamente nada do que propõe?O que você está aprendendo no seu emprego atual? E nos projetos que você participa? De que forma você está contribuindo e que está tirando de proveitoso dessa relação? Qual foi a última vez que aprendeu alguma coisa nova? Este excelente twit do @viniciusteles me fez lembrar daquele ensinamento. Se quer uma vida diferente, não faça igual a todo mundo; se movimente. Mude. Agora. Foram realmente sábias palavras. Muito obrigado professor!
At the scale that Facebook operates, a lot of traditional approaches to serving web content break down or simply aren’t practical. The challenge for Facebook’s engineers has been to keep the site up and running smoothly in spite of handling close to half a billion active users. This article takes a look at some of the software and techniques they use to accomplish that.
Facebook’s scaling challenge
Before we get into the details, here are a few factoids to give you an idea of the scaling challenge that Facebook has to deal with:
- Facebook serves 570 billion page views per month (according to Google Ad Planner).
- There are more photos on Facebook than all other photo sites combined (including sites like Flickr).
- More than 3 billion photos are uploaded every month.
- Facebook’s systems serve 1.2 million photos per second. This doesn’t include the images served by Facebook’s CDN.
- More than 25 billion pieces of content (status updates, comments, etc) are shared every month.
- Facebook has more than 30,000 servers (and this number is from last year!)
Software that helps Facebook scale
In some ways Facebook is still a LAMP site (kind of), but it has had to change and extend its operation to incorporate a lot of other elements and services, and modify the approach to existing ones.
For example:
- Facebook still uses PHP, but it has built a compiler for it so it can be turned into native code on its web servers, thus boosting performance.
- Facebook uses Linux, but has optimized it for its own purposes (especially in terms of network throughput).
- Facebook uses MySQL, but primarily as a key-value persistent storage, moving joins and logic onto the web servers since optimizations are easier to perform there (on the “other side” of the Memcached layer).
Then there are the custom-written systems, like Haystack, a highly scalable object store used to serve Facebook’s immense amount of photos, or Scribe, a logging system that can operate at the scale of Facebook (which is far from trivial).
But enough of that. Let’s present (some of) the software that Facebook uses to provide us all with the world’s largest social network site.
Memcached
Memcached is by now one of the most famous pieces of software on the internet. It’s a distributed memory caching system which Facebook (and a ton of other sites) use as a caching layer between the web servers and MySQL servers (since database access is relatively slow). Through the years, Facebook has made a ton of optimizations to Memcached and the surrounding software (like optimizing the network stack).
Facebook runs thousands of Memcached servers with tens of terabytes of cached data at any one point in time. It is likely the world’s largest Memcached installation.
HipHop for PHP
PHP, being a scripting language, is relatively slow when compared to code that runs natively on a server. HipHop converts PHP into C++ code which can then be compiled for better performance. This has allowed Facebook to get much more out of its web servers since Facebook relies heavily on PHP to serve content.
A small team of engineers (initially just three of them) at Facebook spent 18 months developing HipHop, and it is now live in production.
Haystack
Haystack is Facebook’s high-performance photo storage/retrieval system (strictly speaking, Haystack is an object store, so it doesn’t necessarily have to store photos). It has a ton of work to do; there are more than 20 billion uploaded photos on Facebook, and each one is saved in four different resolutions, resulting in more than 80 billion photos.
And it’s not just about being able to handle billions of photos, performance is critical. As we mentioned previously, Facebook serves around 1.2 million photos per second, a number which doesn’t include images served by Facebook’s CDN. That’s a staggering number.
BigPipe
BigPipe is a dynamic web page serving system that Facebook has developed. Facebook uses it to serve each web page in sections (called “pagelets”) for optimal performance.
For example, the chat window is retrieved separately, the news feed is retrieved separately, and so on. These pagelets can be retrieved in parallel, which is where the performance gain comes in, and it also gives users a site that works even if some part of it would be deactivated or broken.
Cassandra
Cassandra is a distributed storage system with no single point of failure. It’s one of the poster children for the NoSQL movement and has been made open source (it’s even become an Apache project). Facebook uses it for its Inbox search.
Other than Facebook, a number of other services use it, for example Digg. We’re even considering some uses for it here at Pingdom.
Scribe
Scribe is a flexible logging system that Facebook uses for a multitude of purposes internally. It’s been built to be able to handle logging at the scale of Facebook, and automatically handles new logging categories as they show up (Facebook has hundreds).
Hadoop and Hive
Hadoop is an open source map-reduce implementation that makes it possible to perform calculations on massive amounts of data. Facebook uses this for data analysis (and as we all know, Facebook has massive amounts of data). Hive originated from within Facebook, and makes it possible to use SQL queries against Hadoop, making it easier for non-programmers to use.
Both Hadoop and Hive are open source (Apache projects) and are used by a number of big services, for example Yahoo and Twitter.
Thrift
Facebook uses several different languages for its different services. PHP is used for the front-end, Erlang is used for Chat, Java and C++ are also used in several places (and perhaps other languages as well). Thrift is an internally developed cross-language framework that ties all of these different languages together, making it possible for them to talk to each other. This has made it much easier for Facebook to keep up its cross-language development.
Facebook has made Thrift open source and support for even more languages has been added.
Varnish
Varnish is an HTTP accelerator which can act as a load balancer and also cache content which can then be served lightning-fast.
Facebook uses Varnish to serve photos and profile pictures, handling billions of requests every day. Like almost everything Facebook uses, Varnish is open source.
Other things that help Facebook run smoothly
We have mentioned some of the software that makes up Facebook’s system(s) and helps the service scale properly. But handling such a large system is a complex task, so we thought we would list a few more things that Facebook does to keep its service running smoothly.
Gradual releases and dark launches
Facebook has a system they called Gatekeeper that lets them run different code for different sets of users (it basically introduces different conditions in the code base). This lets Facebook do gradual releases of new features, A/B testing, activate certain features only for Facebook employees, etc.
Gatekeeper also lets Facebook do something called “dark launches”, which is to activate elements of a certain feature behind the scenes before it goes live (without users noticing since there will be no corresponding UI elements). This acts as a real-world stress test and helps expose bottlenecks and other problem areas before a feature is officially launched. Dark launches are usually done two weeks before the actual launch.
Profiling of the live system
Facebook carefully monitors its systems (something we here at Pingdom of course approve of), and interestingly enough it also monitors the performance of every single PHP function in the live production environment. This profiling of the live PHP environment is done using an open source tool called XHProf.
Gradual feature disabling for added performance
If Facebook runs into performance issues, there are a large number of levers that let them gradually disable less important features to boost performance of Facebook’s core features.
The things we didn’t mention
We didn’t go much into the hardware side in this article, but of course that is also an important aspect when it comes to scalability. For example, like many other big sites, Facebook uses a CDN to help serve static content. And then of course there is the huge data center Facebook is building in Oregon to help it scale out with even more servers.
And aside from what we have already mentioned, there is of course a ton of other software involved. However, we hope we were able to highlight some of the more interesting choices Facebook has made.
Facebook’s love affair with open source
We can’t complete this article without mentioning how much Facebook likes open source. Or perhaps we should say, “loves”.
Not only is Facebook using (and contributing to) open source software such as Linux, Memcached, MySQL, Hadoop, and many others, it has also made much of its internally developed software available as open source.
Examples of open source projects that originated from inside Facebook include HipHop, Cassandra, Thrift and Scribe. Facebook has also open-sourced Tornado, a high-performance web server framework developed by the team behind FriendFeed (which Facebook bought in August 2009).
(A list of open source software that Facebook is involved with can be found on Facebook’s Open Source page.)
More scaling challenges to come
Facebook has been growing at an incredible pace. Its user base is increasing almost exponentially and is now close to half a billion active users, and who knows what it will be by the end of the year. The site seems to be growing with about 100 million users every six months or so.
Facebook even has a dedicated “growth team” that constantly tries to figure out how to make people use and interact with the site even more.
This rapid growth means that Facebook will keep running into various performance bottlenecks as it’s challenged by more and more page views, searches, uploaded images, status messages, and all the other ways that Facebook users interact with the site and each other.
But this is just a fact of life for a service like Facebook. Facebook’s engineers will keep iterating and coming up with new ways to scale (it’s not just about adding more servers). For example, Facebook’s photo storage system has already been completely rewritten several times as the site has grown.
So, we’ll see what the engineers at Facebook come up with next. We bet it’s something interesting. After all, they are scaling a mountain that most of us can only dream of; a site with more users than most countries. When you do that, you better get creative.
Data sources: Various presentations by Facebook engineers, as well as the always informative Facebook engineering blog.
Excelente post!
A dica de hoje foi dada por Juarez Polleto (Jack DelaVega) no blog Tribo do Mouse.
- Acredite que você pode mudar o mundo
- Trabalhe rápido, mantenha as ferramentas a mão, trabalhe a qualquer hora, em qualquer lugar.
- Saiba quando trabalhar sozinho e quando trabalhar em grupo.
- Compartilhe ferramentas e idéias. Confie nos colegas.
- Sem política. Sem burocracia.
- É o cliente quem define se um trabalho foi bem feito.
- Ideias radicais não são más ideias.
- Invente diferentes maneiras de trabalhar.
- Faça uma contribuição todo o dia. O que não adiciona valor(não tem qualidade), não sai da Garagem.
- Acredite que juntos podemos fazer qualquer coisa.
- Invente.