SlideShare uma empresa Scribd logo
1 de 74
Baixar para ler offline
Your microservice
as a Function
Phil Calçado
SoundCloud
> 11 hours of audio uploaded
every minute
~ 300 million people every month
for this talk:
implementation: code
design: how you abstract
concepts in your system
architecture: how systems talk
to each other
how I got started with
object-oriented
programming
Relationships Between BOUNDED CONTEXTS
Shared Kernel
Gzs%ef..
.....
,...
....
......
....
...
..,
....
......
..
..
....
....
......
Permissiontocopywithoutfeeallorpartofthismaterinlis
grantedprowdedthatthetopicsarenotmadaordistributedfor
directcommcrcioladvantage,theACMcopyrightnoticeondtho
lillcofthepublicationanditsdareappear.andnoticeisgiven
thatcopyingisbypermissionoftheAssociationforComputing
Machinery.Tocopyothcrwisc,ortorepublish.requiresBfee
and/orspecificpornlission.
HOPL-11/4/93/MA,USA
o1993ACM0-89791.571.2/93/0004/0069...$1.50
:LJ
2
2
.xE
.m8
al
:5a
.6
69ACMSIGPLANNotices,Volume28,No.3March1993
😧😆😄😃😀😧
how I got started with
functional programming
Gzs%ef..
.....
,...
....
......
....
...
..,
....
......
..
..
....
....
......
Permissiontocopywithoutfeeallorpartofthismaterinlis
grantedprowdedthatthetopicsarenotmadaordistributedfor
directcommcrcioladvantage,theACMcopyrightnoticeondtho
lillcofthepublicationanditsdareappear.andnoticeisgiven
thatcopyingisbypermissionoftheAssociationforComputing
Machinery.Tocopyothcrwisc,ortorepublish.requiresBfee
and/orspecificpornlission.
HOPL-11/4/93/MA,USA
o1993ACM0-89791.571.2/93/0004/0069...$1.50
:LJ
2
2
.xE
.m8
al
:5a
.6
Programming R. Morris
Techniques Editor
On the Criteria To Be
Used in Decomposing
Systems into Modules
D.L. Parnas
Carnegie-Mellon University
This paper discusses modularization as a mechanism
for improving the flexibility and comprehensibility of a
system while allowing the shortening of its development
time. The effectiveness of a "modularization" is
dependent upon the criteria used in dividing the system
into modules. A system design problem is presented and
both a conventional and unconventional decomposition
are described. It is shown that the unconventional
decompositions have distinct advantages for the goals
outlined. The criteria used in arriving at the decom-
positions are discussed. The unconventional decomposi-
tion, if implemented with the conventional assumption
that a module consists of one or more subroutines, will
be less efficient in most cases. An alternative approach
to implementation which does not have this effect is
sketched.
Key Words and Phrases: software, modules,
modularity, software engineering, KWIC index,
software design
CR Categories: 4.0
Introduction
A lucid statement of the philosophy of modular
programming can be found in a 1970 textbook on the
design of system programs by Gouthier and Pont [1,
¶I0.23], which we quote below: 1
A well-defined segmentation of the project effort ensures
system modularity. Each task forms a separate, distinct program
module. At implementation time each module and its inputs and
outputs are well-defined, there is no confusion in the intended
interface with other system modules. At checkout time the in-
tegrity of the module is tested independently; there are few sche-
duling problems in synchronizing the completion of several tasks
before checkout can begin. Finally, the system is maintained in
modular fashion; system errors and deficiencies can be traced to
specific system modules, thus limiting the scope of detailed error
searching.
Usually nothing is said about the criteria to be used
in dividing the system into modules. This paper will
discuss that issue and, by means of examples, suggest
some criteria which can be used in decomposing a
system into modules.
Copyright @ 1972,Association for Computing Machinery, Inc.
General permission to republish, but not for profit, all or part
of this material is granted, provided that reference is made to this
publication, to its date of issue, and to the fact that reprinting
privileges were granted by permission of the Association for Com-
puting Machinery.
Author's address: Department of Computer Science, Carnegie-
Mellon University, Pittsburgh, PA 15213.
1053
A Brief Status Report
The major advancement in the area of modular
programming has been the development of coding
techniques and assemblers which (l) allow one module
to be written with little knowledge of the code in
another module, and (2) allow modules to be reas-
sembled and replaced without reassembly of the whole
system. This facility is extremely valuable for the
production of large pieces of code, but the systems most
often used as examples of problem systems are highly-
modularized programs and make use of the techniques
mentioned above.
1Reprinted by permission of Prentice-Hall, Englewood
Cliffs, N.J.
Communications December 1972
of Volume 15
the ACM Number 12
1 Introduction
The fundamental purpose of a type system is to prevent the occurrence of execution errors dur-
ing the running of a program. This informal statement motivates the study of type systems, but
requires clarification. Its accuracy depends, first of all, on the rather subtle issue of what consti-
tutes an execution error, which we will discuss in detail. Even when that is settled, the absence
of execution errors is a nontrivial property. When such a property holds for all of the program
runs that can be expressed within a programming language, we say that the language is type
sound. It turns out that a fair amount of careful analysis is required to avoid false and embar-
rassing claims of type soundness for programming languages. As a consequence, the classifica-
tion, description, and study of type systems has emerged as a formal discipline.
The formalization of type systems requires the development of precise notations and defi-
nitions, and the detailed proof of formal properties that give confidence in the appropriateness
of the definitions. Sometimes the discipline becomes rather abstract. One should always remem-
ber, though, that the basic motivation is pragmatic: the abstractions have arisen out of necessity
and can usually be related directly to concrete intuitions. Moreover, formal techniques need not
be applied in full in order to be useful and influential. A knowledge of the main principles of
type systems can help in avoiding obvious and not so obvious pitfalls, and can inspire regularity
and orthogonality in language design.
When properly developed, type systems provide conceptual tools with which to judge the
adequacy of important aspects of language definitions. Informal language descriptions often fail
to specify the type structure of a language in sufficient detail to allow unambiguous implemen-
tation. It often happens that different compilers for the same language implement slightly dif-
ferent type systems. Moreover, many language definitions have been found to be type unsound,
allowing a program to crash even though it is judged acceptable by a typechecker. Ideally, for-
mal type systems should be part of the definition of all typed programming languages. This way,
typechecking algorithms could be measured unambiguously against precise specifications and,
if at all possible and feasible, whole languages could be shown to be type sound.
In this introductory section we present an informal nomenclature for typing, execution er-
rors, and related concepts. We discuss the expected properties and benefits of type systems, and
we review how type systems can be formalized. The terminology used in the introduction is not
completely standard; this is due to the inherent inconsistency of standard terminology arising
from various sources. In general, we avoid the words type and typing when referring to run time
concepts; for example we replace dynamic typing with dynamic checking and avoid common
but ambiguous terms such as strong typing. The terminology is summarized in the Defining
Terms section.
Type Systems
Luca Cardelli
Microsoft Research
Gzs%ef..
.....
,...
....
......
....
...
..,
....
......
..
..
....
....
......
Permissiontocopywithoutfeeallorpartofthismaterinlis
grantedprowdedthatthetopicsarenotmadaordistributedfor
directcommcrcioladvantage,theACMcopyrightnoticeondtho
lillcofthepublicationanditsdareappear.andnoticeisgiven
thatcopyingisbypermissionoftheAssociationforComputing
Machinery.Tocopyothcrwisc,ortorepublish.requiresBfee
and/orspecificpornlission.
HOPL-11/4/93/MA,USA
o1993ACM0-89791.571.2/93/0004/0069...$1.50
:LJ
2
2
.xE
.m8
al
:5a
.6
Programming R. Morris
Techniques Editor
On the Criteria To Be
Used in Decomposing
Systems into Modules
D.L. Parnas
Carnegie-Mellon University
This paper discusses modularization as a mechanism
for improving the flexibility and comprehensibility of a
system while allowing the shortening of its development
time. The effectiveness of a "modularization" is
dependent upon the criteria used in dividing the system
into modules. A system design problem is presented and
both a conventional and unconventional decomposition
are described. It is shown that the unconventional
decompositions have distinct advantages for the goals
outlined. The criteria used in arriving at the decom-
positions are discussed. The unconventional decomposi-
tion, if implemented with the conventional assumption
that a module consists of one or more subroutines, will
be less efficient in most cases. An alternative approach
to implementation which does not have this effect is
sketched.
Key Words and Phrases: software, modules,
modularity, software engineering, KWIC index,
software design
CR Categories: 4.0
Introduction
A lucid statement of the philosophy of modular
programming can be found in a 1970 textbook on the
design of system programs by Gouthier and Pont [1,
¶I0.23], which we quote below: 1
A well-defined segmentation of the project effort ensures
system modularity. Each task forms a separate, distinct program
module. At implementation time each module and its inputs and
outputs are well-defined, there is no confusion in the intended
interface with other system modules. At checkout time the in-
tegrity of the module is tested independently; there are few sche-
duling problems in synchronizing the completion of several tasks
before checkout can begin. Finally, the system is maintained in
modular fashion; system errors and deficiencies can be traced to
specific system modules, thus limiting the scope of detailed error
searching.
Usually nothing is said about the criteria to be used
in dividing the system into modules. This paper will
discuss that issue and, by means of examples, suggest
some criteria which can be used in decomposing a
system into modules.
Copyright @ 1972,Association for Computing Machinery, Inc.
General permission to republish, but not for profit, all or part
of this material is granted, provided that reference is made to this
publication, to its date of issue, and to the fact that reprinting
privileges were granted by permission of the Association for Com-
puting Machinery.
Author's address: Department of Computer Science, Carnegie-
Mellon University, Pittsburgh, PA 15213.
1053
A Brief Status Report
The major advancement in the area of modular
programming has been the development of coding
techniques and assemblers which (l) allow one module
to be written with little knowledge of the code in
another module, and (2) allow modules to be reas-
sembled and replaced without reassembly of the whole
system. This facility is extremely valuable for the
production of large pieces of code, but the systems most
often used as examples of problem systems are highly-
modularized programs and make use of the techniques
mentioned above.
1Reprinted by permission of Prentice-Hall, Englewood
Cliffs, N.J.
Communications December 1972
of Volume 15
the ACM Number 12
1 Introduction
The fundamental purpose of a type system is to prevent the occurrence of execution errors dur-
ing the running of a program. This informal statement motivates the study of type systems, but
requires clarification. Its accuracy depends, first of all, on the rather subtle issue of what consti-
tutes an execution error, which we will discuss in detail. Even when that is settled, the absence
of execution errors is a nontrivial property. When such a property holds for all of the program
runs that can be expressed within a programming language, we say that the language is type
sound. It turns out that a fair amount of careful analysis is required to avoid false and embar-
rassing claims of type soundness for programming languages. As a consequence, the classifica-
tion, description, and study of type systems has emerged as a formal discipline.
The formalization of type systems requires the development of precise notations and defi-
nitions, and the detailed proof of formal properties that give confidence in the appropriateness
of the definitions. Sometimes the discipline becomes rather abstract. One should always remem-
ber, though, that the basic motivation is pragmatic: the abstractions have arisen out of necessity
and can usually be related directly to concrete intuitions. Moreover, formal techniques need not
be applied in full in order to be useful and influential. A knowledge of the main principles of
type systems can help in avoiding obvious and not so obvious pitfalls, and can inspire regularity
and orthogonality in language design.
When properly developed, type systems provide conceptual tools with which to judge the
adequacy of important aspects of language definitions. Informal language descriptions often fail
to specify the type structure of a language in sufficient detail to allow unambiguous implemen-
tation. It often happens that different compilers for the same language implement slightly dif-
ferent type systems. Moreover, many language definitions have been found to be type unsound,
allowing a program to crash even though it is judged acceptable by a typechecker. Ideally, for-
mal type systems should be part of the definition of all typed programming languages. This way,
typechecking algorithms could be measured unambiguously against precise specifications and,
if at all possible and feasible, whole languages could be shown to be type sound.
In this introductory section we present an informal nomenclature for typing, execution er-
rors, and related concepts. We discuss the expected properties and benefits of type systems, and
we review how type systems can be formalized. The terminology used in the introduction is not
completely standard; this is due to the inherent inconsistency of standard terminology arising
from various sources. In general, we avoid the words type and typing when referring to run time
concepts; for example we replace dynamic typing with dynamic checking and avoid common
but ambiguous terms such as strong typing. The terminology is summarized in the Defining
Terms section.
Type Systems
Luca Cardelli
Microsoft Research
😀 😧😐😒😓😧
😀 😧😐😒😓😧
there isn’t a lot out
there on engineering for
functional programming
but there are two
principles good functional
programs follow
(g ∘ f )(x) = g(f(x))
(g ∘ f )(x) = g(f(x))
function composition
avoid side-effects
avoid manage side-effects
HTTP
HTTP
MySQL
what if we apply
functional principles?
turns out functional
principles correlate with
good implementation
and we knew this already
going up one level
life of a request to
SoundCloud.com
Actual
Feature
Request Validator
User
what if we apply
functional principles?
basically
basically
Actual
Feature
Request Validator
User
Authentication Geo IP Rate Limiting
Available
Features
Actual
Feature
User
Actual
Feature
User
Filters
Service
}
we have heaps of filters
turns out functional
principles correlate with
good design
and we knew this already
going up one level
metadata
track
credentials
user
track
pageplayback groups
facebook
integration
database api …
what if we apply
functional principles?
you want your services to
be stateless as possible
you want to be careful
where you store stuff
💽
💽
💽
💽
💽
💽
💽
💽
💽
💽
💽
💽
💽
💽Filters
}
Services
track page
<track <track
metadata>stats>
<user
metadata>
💽 💽 💽
<content
filtering>
<monetisation
rules>
turns out functional
principles correlate with
good architecture
and we knew this already
we still lack material
around engineering in
functional languages, but
the basic principles already
offer a good framework
tl;dr
small functions + small
combinators all the
way up
Q&A

Mais conteúdo relacionado

Destaque

Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at WorkPhil Calçado
 
SoundCloud Masterclass on Brazil
SoundCloud Masterclass on BrazilSoundCloud Masterclass on Brazil
SoundCloud Masterclass on BrazilPhil Calçado
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloudPhil Calçado
 
APIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodAPIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodPhil Calçado
 
CSS 4 - What's coming up
CSS 4 - What's coming upCSS 4 - What's coming up
CSS 4 - What's coming upDiego Eis
 
Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in ScalaPhil Calçado
 
Os cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web DesignOs cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web DesignDiego Eis
 
Cloud Reliability Patterns
Cloud Reliability PatternsCloud Reliability Patterns
Cloud Reliability Patternsrafaelferreira
 
Vida longa para SOA com microservices
Vida longa para SOA com microservicesVida longa para SOA com microservices
Vida longa para SOA com microservicesFábio Rosato
 
Microservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenosMicroservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenosVinícius Krolow
 
Amadurecendo Equipes com Microservices
Amadurecendo Equipes com MicroservicesAmadurecendo Equipes com Microservices
Amadurecendo Equipes com Microservicessanchez_ivan
 
A Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsA Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsPhil Calçado
 
Um pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoftUm pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoftDiego Eis
 
Integração utilizando REST API e Microservices
Integração utilizando REST API e MicroservicesIntegração utilizando REST API e Microservices
Integração utilizando REST API e MicroservicesDenis Santos
 
Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.Diego Eis
 
DOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render PathDOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render PathDiego Eis
 
Workshop soa, microservices e devops
Workshop soa, microservices e devopsWorkshop soa, microservices e devops
Workshop soa, microservices e devopsDiego Pacheco
 

Destaque (20)

Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
 
SoundCloud Masterclass on Brazil
SoundCloud Masterclass on BrazilSoundCloud Masterclass on Brazil
SoundCloud Masterclass on Brazil
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloud
 
APIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodAPIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog Food
 
CSS 4 - What's coming up
CSS 4 - What's coming upCSS 4 - What's coming up
CSS 4 - What's coming up
 
Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in Scala
 
Os cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web DesignOs cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web Design
 
Cloud Reliability Patterns
Cloud Reliability PatternsCloud Reliability Patterns
Cloud Reliability Patterns
 
Desafio dos testes em uma arquitetura de micro serviços
Desafio dos testes em uma arquitetura de micro serviçosDesafio dos testes em uma arquitetura de micro serviços
Desafio dos testes em uma arquitetura de micro serviços
 
Vida longa para SOA com microservices
Vida longa para SOA com microservicesVida longa para SOA com microservices
Vida longa para SOA com microservices
 
Microservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenosMicroservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenos
 
Amadurecendo Equipes com Microservices
Amadurecendo Equipes com MicroservicesAmadurecendo Equipes com Microservices
Amadurecendo Equipes com Microservices
 
A Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsA Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing Organisations
 
Um pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoftUm pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoft
 
Integração utilizando REST API e Microservices
Integração utilizando REST API e MicroservicesIntegração utilizando REST API e Microservices
Integração utilizando REST API e Microservices
 
Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.
 
Microservices
MicroservicesMicroservices
Microservices
 
DOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render PathDOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render Path
 
Introdução à Microservices
Introdução à MicroservicesIntrodução à Microservices
Introdução à Microservices
 
Workshop soa, microservices e devops
Workshop soa, microservices e devopsWorkshop soa, microservices e devops
Workshop soa, microservices e devops
 

Semelhante a Rhein-Main Scala Enthusiasts — Your microservice as a Function

Phil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionPhil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionScala Italy
 
hints for computer system design by Butler Lampson
hints for computer system design by Butler Lampsonhints for computer system design by Butler Lampson
hints for computer system design by Butler Lampsonmustafa sarac
 
UNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptUNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptManjuAppukuttan2
 
Comparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugComparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugStefano Di Paola
 
System Structure for Dependable Software Systems
System Structure for Dependable Software SystemsSystem Structure for Dependable Software Systems
System Structure for Dependable Software SystemsVincenzo De Florio
 
36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructureWashington Garcia
 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSijdpsjournal
 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collectionsijdpsjournal
 
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docxgilbertkpeters11344
 
Factors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxFactors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxZain Abid
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3Diane Allen
 
A tlm based platform to specify and verify component-based real-time systems
A tlm based platform to specify and verify component-based real-time systemsA tlm based platform to specify and verify component-based real-time systems
A tlm based platform to specify and verify component-based real-time systemsijseajournal
 
A Man-Computer Interactive System
A Man-Computer Interactive SystemA Man-Computer Interactive System
A Man-Computer Interactive SystemJames Heller
 
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : Notes
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : NotesIs Multicore Hardware For General-Purpose Parallel Processing Broken? : Notes
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : NotesSubhajit Sahu
 
Secret Twists to Efficiently Develop Reactive Software Systems
Secret Twists to Efficiently Develop Reactive Software SystemsSecret Twists to Efficiently Develop Reactive Software Systems
Secret Twists to Efficiently Develop Reactive Software SystemsBart Jonkers
 
STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages ijseajournal
 

Semelhante a Rhein-Main Scala Enthusiasts — Your microservice as a Function (20)

Phil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionPhil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a function
 
Typeful programming
Typeful programmingTypeful programming
Typeful programming
 
hints for computer system design by Butler Lampson
hints for computer system design by Butler Lampsonhints for computer system design by Butler Lampson
hints for computer system design by Butler Lampson
 
UNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptUNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.ppt
 
Comparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugComparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World Bug
 
System Structure for Dependable Software Systems
System Structure for Dependable Software SystemsSystem Structure for Dependable Software Systems
System Structure for Dependable Software Systems
 
36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure
 
Porcorn tutorial
Porcorn tutorialPorcorn tutorial
Porcorn tutorial
 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONS
 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collections
 
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx
29A Methodology for Testing CPU EmulatorsLORENZO MARTI.docx
 
Factors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxFactors Affecting the System Safety || Linux
Factors Affecting the System Safety || Linux
 
Operating system done_by_ashok
Operating system done_by_ashokOperating system done_by_ashok
Operating system done_by_ashok
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
A tlm based platform to specify and verify component-based real-time systems
A tlm based platform to specify and verify component-based real-time systemsA tlm based platform to specify and verify component-based real-time systems
A tlm based platform to specify and verify component-based real-time systems
 
Fuzz
FuzzFuzz
Fuzz
 
A Man-Computer Interactive System
A Man-Computer Interactive SystemA Man-Computer Interactive System
A Man-Computer Interactive System
 
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : Notes
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : NotesIs Multicore Hardware For General-Purpose Parallel Processing Broken? : Notes
Is Multicore Hardware For General-Purpose Parallel Processing Broken? : Notes
 
Secret Twists to Efficiently Develop Reactive Software Systems
Secret Twists to Efficiently Develop Reactive Software SystemsSecret Twists to Efficiently Develop Reactive Software Systems
Secret Twists to Efficiently Develop Reactive Software Systems
 
STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages
 

Mais de Phil Calçado

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowthPhil Calçado
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderPhil Calçado
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)Phil Calçado
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019Phil Calçado
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessPhil Calçado
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing MicroservicesPhil Calçado
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of MicroservicesPhil Calçado
 
The Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbaneThe Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbanePhil Calçado
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)Phil Calçado
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Phil Calçado
 
Finagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudFinagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudPhil Calçado
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real appPhil Calçado
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVMPhil Calçado
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular APIPhil Calçado
 
SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...Phil Calçado
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil UsersPhil Calçado
 
(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven DevelopmentPhil Calçado
 
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...Phil Calçado
 
mistaeks i’ve made developing software products
mistaeks i’ve made developing software productsmistaeks i’ve made developing software products
mistaeks i’ve made developing software productsPhil Calçado
 
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...Phil Calçado
 

Mais de Phil Calçado (20)

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing Microservices
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of Microservices
 
The Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbaneThe Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 Brisbane
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
 
Finagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudFinagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloud
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular API
 
SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
 
(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development
 
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
 
mistaeks i’ve made developing software products
mistaeks i’ve made developing software productsmistaeks i’ve made developing software products
mistaeks i’ve made developing software products
 
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
 

Rhein-Main Scala Enthusiasts — Your microservice as a Function

  • 1. Your microservice as a Function Phil Calçado SoundCloud
  • 2.
  • 3.
  • 4. > 11 hours of audio uploaded every minute ~ 300 million people every month
  • 5. for this talk: implementation: code design: how you abstract concepts in your system architecture: how systems talk to each other
  • 6. how I got started with object-oriented programming
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Relationships Between BOUNDED CONTEXTS Shared Kernel
  • 19. how I got started with functional programming
  • 20. Gzs%ef.. ..... ,... .... ...... .... ... .., .... ...... .. .. .... .... ...... Permissiontocopywithoutfeeallorpartofthismaterinlis grantedprowdedthatthetopicsarenotmadaordistributedfor directcommcrcioladvantage,theACMcopyrightnoticeondtho lillcofthepublicationanditsdareappear.andnoticeisgiven thatcopyingisbypermissionoftheAssociationforComputing Machinery.Tocopyothcrwisc,ortorepublish.requiresBfee and/orspecificpornlission. HOPL-11/4/93/MA,USA o1993ACM0-89791.571.2/93/0004/0069...$1.50 :LJ 2 2 .xE .m8 al :5a .6 Programming R. Morris Techniques Editor On the Criteria To Be Used in Decomposing Systems into Modules D.L. Parnas Carnegie-Mellon University This paper discusses modularization as a mechanism for improving the flexibility and comprehensibility of a system while allowing the shortening of its development time. The effectiveness of a "modularization" is dependent upon the criteria used in dividing the system into modules. A system design problem is presented and both a conventional and unconventional decomposition are described. It is shown that the unconventional decompositions have distinct advantages for the goals outlined. The criteria used in arriving at the decom- positions are discussed. The unconventional decomposi- tion, if implemented with the conventional assumption that a module consists of one or more subroutines, will be less efficient in most cases. An alternative approach to implementation which does not have this effect is sketched. Key Words and Phrases: software, modules, modularity, software engineering, KWIC index, software design CR Categories: 4.0 Introduction A lucid statement of the philosophy of modular programming can be found in a 1970 textbook on the design of system programs by Gouthier and Pont [1, ¶I0.23], which we quote below: 1 A well-defined segmentation of the project effort ensures system modularity. Each task forms a separate, distinct program module. At implementation time each module and its inputs and outputs are well-defined, there is no confusion in the intended interface with other system modules. At checkout time the in- tegrity of the module is tested independently; there are few sche- duling problems in synchronizing the completion of several tasks before checkout can begin. Finally, the system is maintained in modular fashion; system errors and deficiencies can be traced to specific system modules, thus limiting the scope of detailed error searching. Usually nothing is said about the criteria to be used in dividing the system into modules. This paper will discuss that issue and, by means of examples, suggest some criteria which can be used in decomposing a system into modules. Copyright @ 1972,Association for Computing Machinery, Inc. General permission to republish, but not for profit, all or part of this material is granted, provided that reference is made to this publication, to its date of issue, and to the fact that reprinting privileges were granted by permission of the Association for Com- puting Machinery. Author's address: Department of Computer Science, Carnegie- Mellon University, Pittsburgh, PA 15213. 1053 A Brief Status Report The major advancement in the area of modular programming has been the development of coding techniques and assemblers which (l) allow one module to be written with little knowledge of the code in another module, and (2) allow modules to be reas- sembled and replaced without reassembly of the whole system. This facility is extremely valuable for the production of large pieces of code, but the systems most often used as examples of problem systems are highly- modularized programs and make use of the techniques mentioned above. 1Reprinted by permission of Prentice-Hall, Englewood Cliffs, N.J. Communications December 1972 of Volume 15 the ACM Number 12 1 Introduction The fundamental purpose of a type system is to prevent the occurrence of execution errors dur- ing the running of a program. This informal statement motivates the study of type systems, but requires clarification. Its accuracy depends, first of all, on the rather subtle issue of what consti- tutes an execution error, which we will discuss in detail. Even when that is settled, the absence of execution errors is a nontrivial property. When such a property holds for all of the program runs that can be expressed within a programming language, we say that the language is type sound. It turns out that a fair amount of careful analysis is required to avoid false and embar- rassing claims of type soundness for programming languages. As a consequence, the classifica- tion, description, and study of type systems has emerged as a formal discipline. The formalization of type systems requires the development of precise notations and defi- nitions, and the detailed proof of formal properties that give confidence in the appropriateness of the definitions. Sometimes the discipline becomes rather abstract. One should always remem- ber, though, that the basic motivation is pragmatic: the abstractions have arisen out of necessity and can usually be related directly to concrete intuitions. Moreover, formal techniques need not be applied in full in order to be useful and influential. A knowledge of the main principles of type systems can help in avoiding obvious and not so obvious pitfalls, and can inspire regularity and orthogonality in language design. When properly developed, type systems provide conceptual tools with which to judge the adequacy of important aspects of language definitions. Informal language descriptions often fail to specify the type structure of a language in sufficient detail to allow unambiguous implemen- tation. It often happens that different compilers for the same language implement slightly dif- ferent type systems. Moreover, many language definitions have been found to be type unsound, allowing a program to crash even though it is judged acceptable by a typechecker. Ideally, for- mal type systems should be part of the definition of all typed programming languages. This way, typechecking algorithms could be measured unambiguously against precise specifications and, if at all possible and feasible, whole languages could be shown to be type sound. In this introductory section we present an informal nomenclature for typing, execution er- rors, and related concepts. We discuss the expected properties and benefits of type systems, and we review how type systems can be formalized. The terminology used in the introduction is not completely standard; this is due to the inherent inconsistency of standard terminology arising from various sources. In general, we avoid the words type and typing when referring to run time concepts; for example we replace dynamic typing with dynamic checking and avoid common but ambiguous terms such as strong typing. The terminology is summarized in the Defining Terms section. Type Systems Luca Cardelli Microsoft Research
  • 21. Gzs%ef.. ..... ,... .... ...... .... ... .., .... ...... .. .. .... .... ...... Permissiontocopywithoutfeeallorpartofthismaterinlis grantedprowdedthatthetopicsarenotmadaordistributedfor directcommcrcioladvantage,theACMcopyrightnoticeondtho lillcofthepublicationanditsdareappear.andnoticeisgiven thatcopyingisbypermissionoftheAssociationforComputing Machinery.Tocopyothcrwisc,ortorepublish.requiresBfee and/orspecificpornlission. HOPL-11/4/93/MA,USA o1993ACM0-89791.571.2/93/0004/0069...$1.50 :LJ 2 2 .xE .m8 al :5a .6 Programming R. Morris Techniques Editor On the Criteria To Be Used in Decomposing Systems into Modules D.L. Parnas Carnegie-Mellon University This paper discusses modularization as a mechanism for improving the flexibility and comprehensibility of a system while allowing the shortening of its development time. The effectiveness of a "modularization" is dependent upon the criteria used in dividing the system into modules. A system design problem is presented and both a conventional and unconventional decomposition are described. It is shown that the unconventional decompositions have distinct advantages for the goals outlined. The criteria used in arriving at the decom- positions are discussed. The unconventional decomposi- tion, if implemented with the conventional assumption that a module consists of one or more subroutines, will be less efficient in most cases. An alternative approach to implementation which does not have this effect is sketched. Key Words and Phrases: software, modules, modularity, software engineering, KWIC index, software design CR Categories: 4.0 Introduction A lucid statement of the philosophy of modular programming can be found in a 1970 textbook on the design of system programs by Gouthier and Pont [1, ¶I0.23], which we quote below: 1 A well-defined segmentation of the project effort ensures system modularity. Each task forms a separate, distinct program module. At implementation time each module and its inputs and outputs are well-defined, there is no confusion in the intended interface with other system modules. At checkout time the in- tegrity of the module is tested independently; there are few sche- duling problems in synchronizing the completion of several tasks before checkout can begin. Finally, the system is maintained in modular fashion; system errors and deficiencies can be traced to specific system modules, thus limiting the scope of detailed error searching. Usually nothing is said about the criteria to be used in dividing the system into modules. This paper will discuss that issue and, by means of examples, suggest some criteria which can be used in decomposing a system into modules. Copyright @ 1972,Association for Computing Machinery, Inc. General permission to republish, but not for profit, all or part of this material is granted, provided that reference is made to this publication, to its date of issue, and to the fact that reprinting privileges were granted by permission of the Association for Com- puting Machinery. Author's address: Department of Computer Science, Carnegie- Mellon University, Pittsburgh, PA 15213. 1053 A Brief Status Report The major advancement in the area of modular programming has been the development of coding techniques and assemblers which (l) allow one module to be written with little knowledge of the code in another module, and (2) allow modules to be reas- sembled and replaced without reassembly of the whole system. This facility is extremely valuable for the production of large pieces of code, but the systems most often used as examples of problem systems are highly- modularized programs and make use of the techniques mentioned above. 1Reprinted by permission of Prentice-Hall, Englewood Cliffs, N.J. Communications December 1972 of Volume 15 the ACM Number 12 1 Introduction The fundamental purpose of a type system is to prevent the occurrence of execution errors dur- ing the running of a program. This informal statement motivates the study of type systems, but requires clarification. Its accuracy depends, first of all, on the rather subtle issue of what consti- tutes an execution error, which we will discuss in detail. Even when that is settled, the absence of execution errors is a nontrivial property. When such a property holds for all of the program runs that can be expressed within a programming language, we say that the language is type sound. It turns out that a fair amount of careful analysis is required to avoid false and embar- rassing claims of type soundness for programming languages. As a consequence, the classifica- tion, description, and study of type systems has emerged as a formal discipline. The formalization of type systems requires the development of precise notations and defi- nitions, and the detailed proof of formal properties that give confidence in the appropriateness of the definitions. Sometimes the discipline becomes rather abstract. One should always remem- ber, though, that the basic motivation is pragmatic: the abstractions have arisen out of necessity and can usually be related directly to concrete intuitions. Moreover, formal techniques need not be applied in full in order to be useful and influential. A knowledge of the main principles of type systems can help in avoiding obvious and not so obvious pitfalls, and can inspire regularity and orthogonality in language design. When properly developed, type systems provide conceptual tools with which to judge the adequacy of important aspects of language definitions. Informal language descriptions often fail to specify the type structure of a language in sufficient detail to allow unambiguous implemen- tation. It often happens that different compilers for the same language implement slightly dif- ferent type systems. Moreover, many language definitions have been found to be type unsound, allowing a program to crash even though it is judged acceptable by a typechecker. Ideally, for- mal type systems should be part of the definition of all typed programming languages. This way, typechecking algorithms could be measured unambiguously against precise specifications and, if at all possible and feasible, whole languages could be shown to be type sound. In this introductory section we present an informal nomenclature for typing, execution er- rors, and related concepts. We discuss the expected properties and benefits of type systems, and we review how type systems can be formalized. The terminology used in the introduction is not completely standard; this is due to the inherent inconsistency of standard terminology arising from various sources. In general, we avoid the words type and typing when referring to run time concepts; for example we replace dynamic typing with dynamic checking and avoid common but ambiguous terms such as strong typing. The terminology is summarized in the Defining Terms section. Type Systems Luca Cardelli Microsoft Research
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 33. there isn’t a lot out there on engineering for functional programming
  • 34. but there are two principles good functional programs follow
  • 37.
  • 40.
  • 42. what if we apply functional principles?
  • 43.
  • 44. turns out functional principles correlate with good implementation
  • 45. and we knew this already
  • 46. going up one level
  • 47. life of a request to SoundCloud.com
  • 49. what if we apply functional principles?
  • 50.
  • 54. Authentication Geo IP Rate Limiting Available Features Actual Feature User
  • 56. we have heaps of filters
  • 57. turns out functional principles correlate with good design
  • 58. and we knew this already
  • 59. going up one level
  • 61. what if we apply functional principles?
  • 62.
  • 63.
  • 64. you want your services to be stateless as possible
  • 65. you want to be careful where you store stuff
  • 68.
  • 69. track page <track <track metadata>stats> <user metadata> 💽 💽 💽 <content filtering> <monetisation rules>
  • 70. turns out functional principles correlate with good architecture
  • 71. and we knew this already
  • 72. we still lack material around engineering in functional languages, but the basic principles already offer a good framework
  • 73. tl;dr small functions + small combinators all the way up
  • 74. Q&A