MEAN ¿otro buzzword?
-
Upload
jorge-jimenez -
Category
Software
-
view
529 -
download
0
Transcript of MEAN ¿otro buzzword?
Jorge Jiménez
www.semurat.es@semurat
Desarrollador software freelanceProstituto del código
Promiscuo con los lenguajesGeekFreak
Miembro de: AgileCyl CyLicon Valley
“Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient. Node.js' package ecosystem, npm, is the largest
ecosystem of open source libraries in the world.”
“Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient. Node.js' package ecosystem, npm, is the largest
ecosystem of open source libraries in the world.”
“Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient. Node.js' package ecosystem, npm, is the largest
ecosystem of open source libraries in the world.”
Javascript en el servidorOrientado a Eventos: Event-loop
No bloqueante: I/O asíncronaUn único thread
Problemas
Javascript para backend!!!Callback Hell
Ecosistema jovenDespliegue y packaging en clienteAprendizaje Javascript en backend
Middleware
app.use(logger('dev'));app.use(bodyParser.json());app.use(bodyParser.urlencoded({ extended: false }));app.use(cookieParser());app.use(express.static(path.join(__dirname, 'public')));
Routing
app.get('/employees/:id', function(res, res, next){...}); app.get(‘/employees/:id?', function(res, res, next){...});
Verbo (GET, POST, PUT, DELETE) + PATH
Alternativas
Hapi.js (http://hapijs.com/)Sails.js (http://sailsjs.org/)RESTify (http://mcavage.me/node-restify/)Derby (http://derbyjs.com/)Tower (http://towerjs.org/)Tako (https://github.com/mikeal/tako)Flatiron (http://flatironjs.org/)
Problemas
Limitada extensibilidad: Connect moduleLógica de Negocio: poco aislada, mala reutilización de servicios
Configuración por código
“MongoDB is an open-source schema-free document database that provides high performance, high availability, and automatic
scaling.”
NoSQLPros:
Se ejecutan en máquinas de poco recursosEscalabilidad horizontalGrandes cantidades de datosScheme-less
Frente SQL:No utilizan SQLScheme-lessNo permiten JOINs
MongoDB
Orientada a documentos (BSON)Se basa en colecciones
Balanceo de carga automático (auto-sharding)Soporte para índices
MongoDB
Ciertas aplicaciones webGestión de contenido semiestructurado
Analíticas en tiempo real & Trazabilidad en alta velocidad.Caching y Alta escalabilidad
Bueno para….
MongoDB
CRUD: insert, find, update, removeOperadores condicionales: $gt, $lt, $gte, $lte
$or, $not, $inExpresiones regulares
Operaciones sobre arraysConsultas sobre documentos embebidos
Operaciones
Problemas
Full text search: mejor ElasticsearchNo es relacional
No es transaccionalProblema con updates
Composición con agregadosSincronización de documentos en updates
AngularJS
SPA (Single Page Applications)2-way data binding
Inyección de dependenciasMVVM
Manipula el DOM, no HTML
AngularJSSPA (Single Page Applications)
Ember.js (http://emberjs.com/)Backbone (http://backbonejs.org/)Marionette (http://marionettejs.com/)Knockout (http://knockoutjs.com/)Batman (http://batmanjs.org/)React (http://facebook.github.io/react/)
Alternativas:
AngularJSDirectivas
Crear nuevas tags HTML que funcionen como widgets.“Decorar” elementos con comportamiento y manipular el DOM