2. Introduction
● Code that you can scale without needing to
refactor.
● Start with everything in one process, and split it
all out onto multiple systems when you need to.
● Instead of building a monolithic 100 000 line
codebase, build 100 small services, each 100
lines long.
● Fred George, (the inventor of programmer
anarchy) one of the biggest proponents of this
approach, calls these small programs
micro-services.
3. Micro-Services...
● We can use biological cells as an inspiration for
building robust scalable systems.
● Biological cells have a number of interesting
properties.
■ They are small and single-purpose.
■ There are many of them.
■ They communicate using messages.
■ Death is expected and natural.
4. Features
● Define commands that work by taking in some
JSON, and, optionally, returning some JSON.
● The command to run is selected by
pattern-matching on the the input JSON.
● There are built-in and optional sets of
commands that help you build Minimum Viable
Products: data storage, user management,
distributed logic, caching, logging, etc.
● And you can define your own product by
breaking it into a set of commands
6. Benefits of MicroServices
● Scalability
− By default distributable and parallelizable. It only
need a message and the required resources to
work on. To scale you just clone your
micro-services.
− You can upgrade parts of your system without any
downtime
7. Benefits of MicroServices
● Simplicity
− Easier to Debug: Microservices results in less then
100 lines of code, which is easier to maintain and
debug, you may no longer need unit tests.
− Easily Coordinate: You only has a very specific set
of requirements, what's the input and what should
be the output
− Independent of the implementation language: Our
only requirement is that it should accept a message
and give expected output after processing
8. Demo Time
● How easy it is to build microserives which are
distributed and scalable -
● Let's see:
● http://bit.ly/1lV4VcE or
https://gist.github.com/shanlalit
● use client.js
● My laptop IP 192.168.10.103
9. Why use Seneca?
● Seneca provides plugins - sets of commands - that look after the foundations
of your app for you:
− Organize your business logic
− Network API
− Data layer
− Caching
− Logging
− User management
− Distributed processing
● Seneca is not a web framework, it's a business logic organizer. You can use
it with any web framework.
● Seneca exposes any plugin HTTP interface by returning a middleware
function from the seneca.service method.
10. Summary
● Is it SOA (Service-Oriented Architecture)?
It does has similar goals, in context of micro-services SOA is very big
specialized service
● In Adrian words "Micro-Services has been evolving out of
hard-earned lessons by engineers with decades of experience
building really complex enterprise level systems....and they might
become a secret ingredient in the ‘real-time web’ recipe."