Valsa do Empreendedor


Eu vou montar um negocio, já pensei na ideia e sou programador
Tenho uma amiga designer, registrei um domínio, contratei servidor
É um momento novo na minha vida de trabalhador
Chega de ser empregado
Meu destino agora é ser empreendedor

Empreendedor, empreendedor,
O meu destino agora é ser empreendedor

Ter uma empresa é bacana,
Não tem chefe, não tem grana,
Basta um computador
Uma garagem já serve
Uns amigos, umas brejas e programar com ardor

Vou inovar, inventar, sei que vou encontrar um bom investidor
Chega de ser empregado
O que eu quero agora é ser empreendedor
Empreendedor, empreendedor,
O que eu quero agora é ser empreendedor

Minha startup deu certo,
Fiquei rico, sou esperto,
Já virei um mentor
Falo as besteiras pro povo
E eles ouvem, acreditam
Que eu sou seu salvador

Mas eu sou só um ser humano salvando a si mesmo entendendo a dor
Sei que empreender é uma arte
Tentando faz parte
A sorte o amor

Empreendedor, empreendedor,
O que eu quero agora é ser empreendedor
Empreendedor, empreendedor,
O meu destino agora é ser empreendedor
Empreendedor, empreendedor,
O que eu quero agora é ser empreendedor
Dor, dor, dor, dor, dor, dor, dor
O que eu quero agora é ser empreendedor

How I reduced 48% of my cloud cost by using Google Cloud preemptible instances

Google Cloud Platform has an amazing feature that few people use, partially because it is unknown, but mainly because it is very difficult to set up a system architecture that allows you to use. This feature is preemptible instances. How does it work? Simple: you have a virtual machine like any other, except that this VM will shutdown unexpectedly within 24 hours and be eventually unavailable for short periods. The advantage: this preemptive instances cost less than 50% compared to the ordinary machine.

Usually, people use this kind of machine for servers that run workers or asynchronous jobs, a kind of application that does not need 24/7 availability. In my case, I could use the preemptible instances for my internal API, an application that do need 24/7 availability. This internal API can’t stay offline, so the way I solved the unavailability problem was by running many servers in parallel  behind a haproxy load balancer. So, in basically 3 steps I could reduce my API infrastructure cost by 50%.

Step 1 – Setup the client to be fault tolerant

My code is in Scala language. Basically, I made the client to repeat a request when it eventually failed. This is necessary because, even if the API machines are behind the load balancer, the load balancer takes some time (seconds) to realize that a specific machine is down, so eventually it sends some requests to unavailable machines. The client code snippet is:

def query(params, retries = 0) {
  val response = api.query(params)
  response.onSuccess {
    codeForSuccess()
  }
  response.onFailure {
    case x => {
      LOG.error(s"Failure on $retries try of API request: " + x.getMessage)
      Thread.sleep(retries * 3000) //this sleep is optional
      query(params, retries + 1) //the could be a maximum number of retries here
    }
  }
}

Step 2 – put all servers behind a load balancer

I created a haproxy config file that I can auto-update based on a list of servers that I get from the gcloud command line. Here is the script that re-writes the haproxy config file with a list of all servers that has a specific substring in their names:

#!/bin/bash
SERVER_SUBSTRING=playax-fingerprint
EMPTY_FILE=`cat /etc/haproxy/haproxy.cfg |grep -v $SERVER_SUBSTRING`
NEW_LINES=`gcloud compute instances list |grep $SERVER_SUBSTRING | sed 's/true//g' |sed 's/ [ ]*/ /g'|cut -d" " -f4|awk '{print " server playax-fingerprint" $NF " " $NF ":9000 check inter 5s rise 1 fall 1 weight 1"}'`
echo "$EMPTY_FILE" >new_config
echo "$NEW_LINES" >>new_config
sudo cp new_config /etc/haproxy/haproxy.cfg
sudo ./restart.sh

The restart script reloads the haproxy configuration without any outage.

Step 3 – create an instance group for these servers

By creating an instance template and an instance group, I can easily add or remove servers to the infrastructure. The preemptible configuration is inside the instance template page in google cloud panel.

  1. Create an instance template with preemptible option checked
  2. Create an instance group that uses that template

Screen Shot 2016-05-04 at 10.40.58 PM

 

Screen Shot 2016-05-04 at 10.41.18 PM

One very important warning is that you need to plan your capacity to allow 20% of your servers to be down (remember that preemptible instances eventually are out). In my case, I had 20 servers before using the preemptible option. With the preemptible on, I changed the group to 25 servers.

Before After
Servers 20 24
Cost per server $0.07 $0.03
Total cost per hour $1.4 $0.72
Total cost per month $1,008 $518

Price reduction:  $490 or 48.6%

Graphs of server usage along 1 day (observe how many outages there are, but application ran perfectly ):

Screen Shot 2016-05-04 at 11.12.36 PM

Empreendedorismo em Linha Reta

IMG_0583

Meu nome é Álvaro. Sou empreendedor. Quando olho para os lados e vejo outros empreendedores, me sinto sozinho. Nunca conheci ninguém que tivesse levado porrada como eu. Todos os outros empreendedores parecem ser campeões em tudo.

E eu, tantas vezes ansioso, tantas vezes perdendo a paciência e pensando em desistir de tudo. Indescupavelmente sujo. Cheio de dúvidas, cometo um monte de erros, me sinto ridículo. Sou, de fato, muitas vezes ridículo, absurdo, grotesco, mesquinho, submisso, arrogante. Sofro porrada de todos os lados e me calo. Quando não me calo, sou mais ridículo ainda.

Chego a ser cômico com os meus funcionários. Estou falido, uma vergonha financeira, pedindo migalhas para tentar pagar as contas. Eu, que, quando chegou o momento do soco, me esquivo, para fora da possibilidade do soco. E sofro com a angústia das pequenas coisas ridículas. Nesse momento, percebo que não faço parte desse mundo.

Todo empreendedor que conheço e fala comigo, nunca teve um ato ridículo, nunca levou porrada, nunca foi senão um rei — todos eles reis — na vida…

Quem me dera ouvir de algum empreendedor a voz humana, que confessasse não algo grave, mas um pequeno errinho. Que contasse não uma falência, mas uma vacilada! Não, são todos o Ideal, quando falam e eu os ouço. Quem há neste mundo que me confesse que já perdeu e se ferrou?

Ó reis, meus irmãos, estou farto de semideuses! Onde é que há gente no mundo empreendedor?

Então sou só eu que comete erros e se ferra nessa terra?

Poderão não ter caído no gosto dos investidores, podem ter sido enganados por um sócio — mas ridículos nunca! E eu, que tenho sido ridículo sem ter sido enganado, como posso eu falar com os meus superiores sem vacilar? Eu, que tenho sido desprezível, literalmente fracassado, fracassado no sentido mesquinho e infame do fracasso.

Go up to the cloud

Prioritizing existing cloud solutions for features non-core to your business

When Daniel started to work in Elo7, the company website infrastructure was installed in two bare metal servers. Local SMTP server application was responsible for mail delivery. Server logs were stored in local drive. Managing and scaling bare metal servers was difficult, so everything was migrated to cloud instances. The mail delivery was decoupled from the application server and migrated to a service provider. Server logs were also migrated to a cloud PaaS, so developers would not need to log in the application servers to search in log files. These and other changes to the cloud lead to a lower cost and more flexible systems architecture, enabling the Startup to grow fast and solid.

Startups do not have time to build their own physical server infrastructure. They need to focus on their own product or service development. Nowadays, there are a lot of services that provide almost everything a Startup
needs to setup its business online. There are hundreds of offerings on Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS) layers. Moreover, most providers offer very low costs for low usage, as well as free tiers for beginners.

Today it is possible to build a technology company just by sticking together existing solutions. There are thousands of different Software as a Service (SaaS) platforms, most of them offering free tier for small companies
to solve a wide range of problems a company has, from file sharing applications to accounting software and communications tools. Almost everything is available freely online.

Software running into production is much more complex than running on developers machines. There are many cloud providers that offer simple solutions to deploy software in a mater of a mouse click, without needing any knowledge on system administrations. These Platform as a Service (PaaS) environments save a lot of precious time for startups, which in the beginning don’t have any specific requirement that justifies building its own
infrastructure.

Building a physical server infrastructure is hard, time consuming, and expensive. Developing commodity software is also a waste of time. Startups do not have time to spend on tasks other than their core business.

Startups usually have few software developers to do the entire job. It is impossible for a small team to be competent in all technologies. In a software startup, its product codebase is the most important place developers should spend they hours, learning about the business domain and creating inexistent and innovative solution to the startup customers. Moreover, every line of code deployed into production increases the maintenance costs. If developers spend time maintaining software non-core for the business, they have less time to work on core functionalities. It is a matter of cost benefit between building and buying. Building software non-core to your business will make you loose focus from your customers.

Therefore:

Use ready-made infrastructures over building your own solution. Prefer SaaS to PaaS, prefer PaaS to IaaS, prefer IaaS to ‘building your own infrastructure’, except for features core to your business.

The more non-core software you delegate to the cloud, the more time your team will have to work on what really matters: your customer. When you spend more time on your business software, you deliver more value and learn faster from your clients. By continuously delivering software to your customers you are bound to become competitive and profitable.

If you need a communication tool to keep the startup remote team together, you can use HipChat or Slack. For documents and spreadsheets creation, there is Google Drive, Microsoft Office 360. Virtual machines infrastructure
monitoring can be achieved with New Relic. Systems log processing and analysis can be done with Loggly or Splunk. Do remote pair programming with Screen Hero.

Most of these SaaS, PaaS and IaaS solutions were a startup someday. Off course if your startup product is a cloud system, developing a cloud service is core to you, so you won’t delegate these core functionalities to third
party companies. But even cloud service providers use third party software. IaaS companies use SaaS. SaaS companies use IaaS, and so on. The DevOps for Startups pattern can help you to choose the right balance between different cloud layers. A bad consequence of choosing the wrong cloud solution is that you can get stuck to a specific provider, so take care, preferring standard and replaceable solutions instead of proprietary hard to migrate architectures.

Startups, hack money incomes and outcomes – spend money on the right things

Hack money incomes and outcomes

Find creative ways to avoid unnecessary costs and get as much free resources as you can.

In the beginning of our startup, we didn’t have an office. My partner and I worked from our home, so we did not have to pay for an office space. But after some time, we were starting to grow the development team. We needed a place to meet with everybody. We rented a place at a very low cost. We tried to find co-working offices, but in our region it would cost more than having our own space. Then we needed to buy furniture. We discovered that new furniture prices were very expensive. We found a great alternative: asked some relatives for donation and also looked in auction websites. We could set up everything we needed for the office with less than US$500.

“In our company we have policy that you can spend company’s money on whatever you like, but you should treat it as it was yours. If you need something, it is ok to buy it, if you would pay for it yourself, too. It is kind of test that your really need that.” – Veli-Pekka (entrepreneur).

The day we bought furniture in an auction website
Continue reading

How to attract talents to your Startup?

Long term purpose instead of money

Differentiate from big companies to attract talents.

Work tableWhen I started Playax with my partner Juliano, we did not have money to pay high salaries for tech talent in São Paulo, one of the most expensive cities in Brazil. Our startup was a high-tech innovative platform in the music industry, so we needed the best developers to create complicated algorithms. On a first try, we offered bellow average salaries, but even if some developers were interested in the company’s challenges, they did not accept the job. When we started to offer equity, we attracted exactly the people we wanted to our team: people with passion and long-term commitment with the company. Moreover, people willing to give up high salaries in exchange of being part of the company’s construction and purpose. 

Continue reading

O Hype que só atrapalha

O tema startups e empreendedorismo virou moda. Tanto é que já virou até tema de novela na Globo. O fato de virar moda e de muito se falar sobre o assunto em si é até bom. Antes ninguém sabia o que era uma Startup. Esse hype estimula o empreendedorismo e o surgimento de empresas com potencial de inovação. Novos empreendedores nascem e se manifestam. As pessoas têm a oportunidade de aprenderem umas com as outras. Começa a se formar uma comunidade que se ajuda e se auto-motiva.

Junto com esse mar de possibilidades positivas para o empreendedor, surge também muita porcaria. Quando a onda vem forte e arrebenta, o que sobra é espuma, que só faz volume e não tem força alguma a não ser para obscurecer a nossa visão. Não me refiro apenas ao oportunismo ou mal caráter, mas também à incompetência, seja pela desinformação, seja pela falta de visão sistêmica ou pensamento holístico (e diria até falta de um certo altruísmo). Talvez tudo que exista de ruim em um ecossistema de Startups seja uma mistura de um pouco de cada uma dessas coisas.

Continue reading

Convite – exame de qualificação doutorado – Startup Ecosystem Framework

Convido colegas e professores ao meu exame de qualificação de Doutorado em Ciência da Computação, trabalho do grupo de pesquisa em Empreendedorismo de Software do IME-USP

Título: Startup Ecosystem Framework

Candidato: Daniel Cukier
Data: Terça-feira, 31 de março de 2015
Horário: 10:00 horas
Local: IME-USP, sala 2 – Bloco B

Comissão julgadora:

MEMBROS TITULARES
Prof. Dr. Fabio Kon (Presidente) IME – USP
Prof. Dr. Guilherme Ary Plonski FEA – USP
Prof. Dr. Paulo Antonio Borges Lemos UNICAMP

MEMBROS SUPLENTES
Prof. Dr. Marco Aurélio Gerosa IME – USP
Prof. Dr. Martinho Isnard Ribeiro de Almeida FEA – USP

Resumo:

After the popularization of Internet in the 90s and the mobile technologies in the 2000s, we saw an amazing growth on creation of new high-tech companies around the globe. Most of these companies, known as startups, are born in technology clusters also called startup ecosystems. The objective of this PhD research is to advance the understanding of how software startups work, what are the elements that influence their behavior and how startups relate with other players in their ecosystem. For that, we are developing a conceptual framework model by using qualitative research techniques. In these presentation, we will explain the methodology, as well as the preliminary results for both São Paulo and Israeli ecosystems and the expected outputs of a third case-study in a mature ecosystem