# How to Build a Micro-services Infrastructure In 7 Days

- Speaker: [Gil Tayar](/wiki/speakers/gil-tayar.md)
- Event: [Reversim Summit 2016](/wiki/years/2016.md)
- Video: https://www.youtube.com/watch?v=RjNV6Iw6uME
- Transcript: [/transcripts/2016/49-RjNV6Iw6uME.md](/transcripts/2016/49-RjNV6Iw6uME.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [DevOps](/wiki/topics/devops.md), [Infrastructure](/wiki/topics/infrastructure.md), [Architecture](/wiki/topics/architecture.md), [Engineering Culture](/wiki/topics/engineering-culture.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker shares the story of a seven-day hackathon where a team successfully built a modern microservices infrastructure from scratch. The project focused on replacing an aging deployment system by leveraging industry-standard tools like Mesos Marathon, NginX, and Docker. The audience learns how a small team can design a robust infrastructure supporting blue-green deployments, service discovery, and isolated staging environments in a remarkably short time.

## Key points

- [0:00](https://www.youtube.com/watch?v=RjNV6Iw6uME) The speaker introduces the challenge of building a new microservices infrastructure during a one-week internal company hackathon.
- [1:54](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=114s) The existing deployment system based on Chef suffered from slow deployments, static host definitions, and painful rollbacks.
- [7:47](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=467s) The team chose to build a command-line interface called Apollo using Node.js to manage service deployments easily.
- [11:15](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=675s) Mesos Marathon was selected as the container scheduler to manage server farms, dynamic instance placement, and high availability.
- [13:23](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=803s) The team implemented a server-side service discovery pattern using NginX as a reverse proxy gateway due to time constraints.
- [21:48](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=1308s) Staging and testing environments were treated as first-class citizens by simply color-coding environments and parameterizing deployments.
- [23:51](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=1431s) A custom manager script periodically queries Marathon every ten seconds to automatically update the NginX configuration files without downtime.
- [25:56](https://www.youtube.com/watch?v=RjNV6Iw6uME&t=1556s) The team successfully won the hackathon, delivering a fully functional microservices infrastructure supporting blue-green deployments and staging in six days.

## Takeaways

- Use a command-line interface instead of building complex administrative graphical user interfaces during hackathons or rapid prototyping.
- Treat production as just another environment alongside staging to make multi-environment management significantly simpler.
- Leverage existing container orchestrators like Mesos Marathon to automatically handle blue-green deployments and high availability.

## Questions this talk answers

- How can you implement server-side service discovery using NginX and Mesos Marathon?
- What is the best way to handle staging and production environments using a unified deployment mechanism?
- How do you achieve zero-downtime configuration reloads in NginX for dynamic microservices?

## Technologies

Mesos, Marathon, Docker, NginX, Node.js, Bash, Chef, Amazon Web Services

## Tags

architecture, containers, deployment, devops, hackathon, infrastructure, microservices
