An obscure but ubiquitous design pattern in PHP development is known as Funky Caching. Using real architectural examples as a lens to look at this one simple PHP design pattern, we see how we can design web architectures that are "organic, democratic, and lasting"
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
2019-03 PHP without PHP Architecture @ Confoo
1. PHP without PHP
The Philosophy of
Good Architecture
terry chay
2018-03-15T11:00+0500
Confoo, Montreal, Canada
http://bit.ly/confoo19-architecture
Expecting "Where Have
All My Servers Gone?"
Sorry, Last minute change, too late to
make the program.
(I guess the speaker found his servers.)
9. Code Complete
The metaphor of Code as
construction comes from this
book…
W e n o w k n o w t h i s i s
fundamentally wrong…
10. Mythical Man Month
“man-month” is a term from
construction work
The premise is that man and
months are interchangeable.
This means that in order to
reach a deadline I simply add
more people to the project.
11. F i r s t c o n s i d e r s o m e t h i n g l i k e
painting a fence: everything is
partionable (man-month).
…add a constant time for training.
…add communication cost: n(n-1)/2.
Compare to the unpartitionable
(single man)
Adding people to a late project
makes it later!
paritionable
with training
traning + communication
unpartitionable
29. PHP is “Cheap”
“A project done in Java will cost 5 times
as much, take twice as long, and be
harder to maintain than a project done
in a scripting language such as PHP or
Perl.”
—Phillip Greenspun
30. PHP is “Scalable”
“That a Java servlet performs better
than a PHP script, under optimal
conditions [has] nothing to do with
scalability. The point is can your
application continue to deliver
consistent performance as volume
increases. PHP delegates all the ‘hard
stuff’ to other systems.”
—Harry Fuecks
31. PHP is “Pragmatic”
“PHP is not about purity in CS
principles or architecture; it is about
solving the ugly web problem with an
admittedly ugly, but extremely
functional and convenient solution. If
you are looking for purity, you are in
the wrong boat. Get out now before
you get hit by a wet cat!”
—Rasmus Lerdorf
32. Not PHP? A framework?
Your language is a set of different
choices.
Some choices were made for you (by a
framework).
Choices create a different
environment.
Leverage those choices to be in
harmony with that environment!
41. Design Hubris?
“I'm a developer, I can make software
conform to my needs.”
Trying to “lord over the environment
with an isolated man-made imposition.”
“But what I mean is it’s all man-made in
software, there is no environment.”
Language, infrastructure, team, etc.
it's all the environment
55. Design Patterns
Defined
“Each pattern describes a
problem which occurs over
a n d o v e r a g a i n i n o u r
e n v i r o n m e n t , a n d t h e n
describes the core of the
solution to that problem, in
such a way that you can use
this solution a million times
over, without ever doing it
the same way twice.”
shorten quote
72. Organic
“Form and function are one”
think beyond funky-caching!
Funky-caching is just a sleight-of-
hand
…actually a design pattern you've
seen before and used many times.
76. Cache-Aside Pattern
Instead of dynamic page generation
maybe it's a database query or remote
web query
Instead cache in file system, the cache
could be Memcache or Redis
instead of bypassing app server, bypass
your entire website (reverse proxy or
Content Distribution Network)
Whether to use it an how is ALWAYS
determined by environment
ORGANIC: Form and function are one
78. Democratic
“design should accommodate needs.”
Me
"Ruby on Rails is a rounded rectangle.”
“PHP is a Ball of Nails.”
let me build a bridge to the ruby
world…
79. mod_ruby and AWS
mod_ruby shares app space
Ruby on Rails could not be used in a
shared environment, PHP could
2006: Amazon adds EC2 to AWS
Ruby world adopted it in droves
because of a NEED.
80. Ruby gave us modern devops
Puppet/Chef
GitHub
Heroku/Engineyard
vagrant
81. Ruby was Democratic
Ruby and cloud computing was design
accommodating need
Democratic: Design should
accommodate need
In the PHP world we adopt those
tools (php is scalable by being
"shared none")
(other worlds like Python and Go,
adopt and extend to give us things like
Ansible and docker)
84. JavaScript hits big time
Code richer libaries: JQuery,
Underscores, BackboneJS…
barrier to install: npm
Compiling those libraries into single
file: webpack
webpack means we have transpiler:
Coffeescript, TypeScript,…
Facebook's php mentality: "Practical":
webpack: ES5 (webpack) into
javascript, performance
85. NPM, Webpack & Plasticity
Facebook's PHP mentality:
"Practical": ReactJS
javascript framework focus on performance
(vdom)
we have webpack, why not write it in
ECMAScript6 and transpile it to browser code?
PHP's PHP mentality:
"Cheap"
“npm is great, let's copy it! (including its
package manafest)” -> composer
All things that remove barriers: Plasticity