php is the king, nodejs is the prince and lua is the fool
TRANSCRIPT
![Page 1: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/1.jpg)
Alessandro Cinelli (cirpo)
PHP is the king,
nodejs is the prince,
Lua is the fool
![Page 2: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/2.jpg)
![Page 3: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/3.jpg)
![Page 4: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/4.jpg)
dubai
![Page 5: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/5.jpg)
dubai
![Page 6: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/6.jpg)
namshi
![Page 7: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/7.jpg)
dubai
![Page 8: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/8.jpg)
Namshi
almost 3 years old
~250 ppl
IT team ~15 ppl
million+ visits per month
serving the UAE and GCC
![Page 9: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/9.jpg)
![Page 10: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/10.jpg)
![Page 11: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/11.jpg)
![Page 12: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/12.jpg)
![Page 13: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/13.jpg)
![Page 14: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/14.jpg)
![Page 15: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/15.jpg)
PHP
![Page 16: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/16.jpg)
Architecture
![Page 17: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/17.jpg)
a monolithic architecture
![Page 18: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/18.jpg)
so far so good… but we started growing…
![Page 19: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/19.jpg)
“we need a brand new feature for the warehouse…”
![Page 20: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/20.jpg)
SOA
![Page 21: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/21.jpg)
Service Oriented Architecture
![Page 22: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/22.jpg)
– A.Nadalin (@_odino_)
“A software design based on discrete software components, "services", that collectively
provide the functionalities of the larger software application”
– A.Nadalin (@_odino_)– A.Nadalin (@_odino_)
![Page 23: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/23.jpg)
– A.Nadalin (@_odino_)– A.Nadalin (@_odino_)
“Microservice Architecture" […] a particular way of designing software applications
as suites of independently deployable services…”
– M.Fowler
FULL STACK IS DEAD!
![Page 24: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/24.jpg)
services as Lego bricks
![Page 25: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/25.jpg)
Unix Philosophy
“Write programs that do one thing and do it well.”
![Page 26: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/26.jpg)
SOA Benefits
scalability avoid single point of failure easier and faster deploys isolation maintainability easier to replace existing parts
![Page 27: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/27.jpg)
how do you connect services?
![Page 28: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/28.jpg)
HTTP
A protocol that is almost 25 years old and is here to stay!
![Page 29: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/29.jpg)
GET vs POST
“The difference is that in
a GET request you have the parameters in the url ,
with
a POST the parameters are in the request’s body”
answered by 80% of candidates during the interview
![Page 30: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/30.jpg)
![Page 31: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/31.jpg)
“you don’t know HTTP? you shall not pass”
- Gandalf
![Page 32: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/32.jpg)
Rabbitmq
![Page 33: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/33.jpg)
using crons!
![Page 34: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/34.jpg)
Rabbitmq
![Page 35: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/35.jpg)
Rabbitmq
![Page 36: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/36.jpg)
Rabbitmq
Language and protocol format agnostic You can easily create an event driven architecture Messages stay in the queue if a service goes down Too many messages? add more consumers!
![Page 37: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/37.jpg)
PHP
![Page 38: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/38.jpg)
PHP
It follows standards (PSR-*)
Decoupled components
Huge and active opensource community
Easy to plug in your domain code
Not just a framework, but a project…
Designed starting from the HTTP protocol
![Page 39: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/39.jpg)
PHP
bundle -> app -> service
![Page 40: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/40.jpg)
PHP
UserBundle
WarehouseBundle
CheckoutBundle
ProductBundle
[…]
![Page 41: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/41.jpg)
Once you have a SOLID set of api foundation you can easily start building other awesome applications
![Page 42: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/42.jpg)
PHP
silex
the PHP micro-framework based on Symfony2 components
![Page 43: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/43.jpg)
PHP
![Page 44: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/44.jpg)
Let’s eat those apis!
![Page 45: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/45.jpg)
Javascript
![Page 46: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/46.jpg)
Javascript
Two way data-binding Single page application
Built-in services on top of XHR Routing
Controller Model
![Page 47: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/47.jpg)
Javascript
it’s a MVW framework:
Model-View-Whatever
![Page 48: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/48.jpg)
Javascript
![Page 49: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/49.jpg)
Javascript
![Page 50: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/50.jpg)
Javascript
![Page 51: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/51.jpg)
Javascript
![Page 52: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/52.jpg)
party time!
![Page 53: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/53.jpg)
from statefull to stateless
Removed server sessions Sessions on the client (localstorage)
![Page 54: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/54.jpg)
stateless
JSON Web Signature
http://tools.ietf.org/html/draft-jones-json-web-signature-04
![Page 56: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/56.jpg)
PHP - JWS
![Page 57: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/57.jpg)
PHP - JWS
![Page 58: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/58.jpg)
double party time!
![Page 59: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/59.jpg)
lets do the same for the desktop website…
![Page 60: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/60.jpg)
some customers were experiencing some issues…
![Page 61: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/61.jpg)
Javascript
![Page 62: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/62.jpg)
Javascript
![Page 63: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/63.jpg)
Javascript
![Page 64: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/64.jpg)
we rebuilt the desktop website in two weeks!
![Page 65: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/65.jpg)
Javascript
Rapid application development Quick setup Event driven Javascript!
why node?
![Page 66: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/66.jpg)
Javascript
mockserver mock your APIs
in a matter of seconds!
github.com/namshi/mockserver
![Page 67: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/67.jpg)
Javascript
mockserver
![Page 68: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/68.jpg)
Javascript users_GET.mock file
mockserver
![Page 69: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/69.jpg)
Javascript
mockserver
![Page 71: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/71.jpg)
Javascript
shisha
.smoke file
![Page 72: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/72.jpg)
Javascript
shisha
![Page 73: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/73.jpg)
redis
![Page 74: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/74.jpg)
redis
Key types: lists, hashes, sets, sorted sets Persistent to disk
Up to 512MB per key Pub/sub
Transactions with optimistic locking Lua scripting embedded
![Page 76: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/76.jpg)
lua
![Page 77: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/77.jpg)
lua
![Page 78: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/78.jpg)
actual architecture
other
![Page 79: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/79.jpg)
RabbitMq
publish consumeq u
![Page 80: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/80.jpg)
WHAT’S NEXT?
![Page 81: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/81.jpg)
WHAT’S NEXT?
![Page 82: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/82.jpg)
WHAT’S NEXT?
![Page 83: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/83.jpg)
we love php because
![Page 84: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/84.jpg)
il mondo è bello perché è vario
The world is beautiful because it is varied
il mondo è bello perché è vario
![Page 85: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/85.jpg)
il mondo è bello perché è vario
The world is beautiful because it is varied
be open
![Page 86: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/86.jpg)
il mondo è bello perché è vario
The world is beautiful because it is varied
use the right tool
![Page 87: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/87.jpg)
il mondo è bello perché è vario
The world is beautiful because it is varied
you can solve problems in different ways
![Page 88: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/88.jpg)
That’s all folks
![Page 90: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/90.jpg)
we are hiring!tech.namshi.com/join-us
github.com/namshi
twitter.com/TechNamshi
tech.namshi.com
![Page 91: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/91.jpg)
![Page 92: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/92.jpg)
THANKS
![Page 93: PHP is the king, nodejs is the prince and Lua is the fool](https://reader037.vdocuments.us/reader037/viewer/2022110204/55d57775bb61eb7e038b474b/html5/thumbnails/93.jpg)
credits
https://farm3.staticflickr.com/2199/2365883747_3a5c753719_o.jpg https://www.flickr.com/photos/karen_roe/8912245799
https://www.flickr.com/photos/anaxila/367953499/sizes/l https://www.flickr.com/photos/onigiri_chang/5356325784/sizes/o/
http://www.slideshare.net/odino/soa-with-symfony2-confoo-2014-in-montreal-ca https://www.flickr.com/photos/ejpphoto/2314610838/sizes/o/
https://www.flickr.com/photos/cesarastudillo/3981364314/sizes/l https://www.flickr.com/photos/piers_nye/2501994750/sizes/o/
https://www.flickr.com/photos/36247316@N00/3108399560/sizes/o/ https://www.flickr.com/photos/ironpoison_photos_69/9604127837/sizes/k/