Troubleshooting Java applications has the reputation of a dark art and is often compared to finding the needle in a haystack. Using tools bundled with the JDK and the OS, a few open source packages and lightweight approaches can help you zero in on a some common scenarios. We will explore working with local and remote JVMs, the myriad of startup flags, analyzing and correlating thread dumps with cpu consumption, system vs application level instrumentation, considerations for multi-tenant JVMs, getting around in an unfamiliar production environment and if we don’t forget, memory games.
If you could use more visibility into your Java application during development and production runs this talk is filled with practical tips, from the high level to the gritty details.
An absolute beginners guide to node.js . Done for a presentation at college. The presentation contains data from various sources ,sources are noted at the end slide. please inform me any mistakes ,since at that time i was in a bit of hurry :)
This is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
Troubleshooting Java applications has the reputation of a dark art and is often compared to finding the needle in a haystack. Using tools bundled with the JDK and the OS, a few open source packages and lightweight approaches can help you zero in on a some common scenarios. We will explore working with local and remote JVMs, the myriad of startup flags, analyzing and correlating thread dumps with cpu consumption, system vs application level instrumentation, considerations for multi-tenant JVMs, getting around in an unfamiliar production environment and if we don’t forget, memory games.
If you could use more visibility into your Java application during development and production runs this talk is filled with practical tips, from the high level to the gritty details.
An absolute beginners guide to node.js . Done for a presentation at college. The presentation contains data from various sources ,sources are noted at the end slide. please inform me any mistakes ,since at that time i was in a bit of hurry :)
This is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
3 Things Everyone Knows About Node JS That You Don'tF5 Buddy
Node.js is server side javascript. Here the complete presentation on Node JS with the 3 Things which everyone knows about Node JS and installation process of it. https://www.f5buddy.com
Developing realtime apps with Drupal and NodeJS drupalcampest
Based on Google's V8 JavaScript engine, NodeJS is a fairly new platform for creating scalable and real-time web applications. I will introduce you to NodeJS internals and ecosystem as well as exaplain why and how you can use Node in your Drupal based projects.
Introduction to node js - From "hello world" to deploying on azureColin Mackay
Slide deck from my talk on Node.js.
More information is available here: http://colinmackay.scot/2014/11/29/dunddd-2014-introduction-to-node-jsfrom-hello-world-to-deploying-on-azure/
Scaling and hardware provisioning for databases (lessons learned at wikipedia)Jaime Crespo
At the Wikimedia Foundation (host of Wikipedia and many other open collaborative projects) we work on a limited budget, donated by our many generous donors. As many other companies that are not Facebook- or Google-sized, we have to do more with less both in terms of budget and our small number of Ops in order to serve the over 400 thousand requests per second and the 1200 million monthly users. We made several mistakes (and a few successes) along the road regarding architecture and hardware decisions, especially for the database-distributed components, storage model, hardware chosen, server size, technology adoption, etc. Now we want to share those with you.
Bringing Interactivity to Your Drupal Site with Node.js IntegrationAcquia
Drupal is a powerful, flexible platform for building applications, but not something that handles realtime notifications easily. Node.js is a breath of fresh air in the Open Source web server landscape. It makes writing applications that handle thousands of open connections at the same time easily.
The Nodejs module integrates Drupal with Node.js, allowing for the best of both worlds. Realtime chat, push notifications and help desk functionality can all be easily added to your Drupal site via the Nodejs module, without the usual scalability and performance issues associated with these technologies on the LAMP stack.
Node js is said to be an open source. It is the cross-platform JavaScript runtime to developing different types of applications and tools. Thus the best node js course js is not a JavaScript framework with its many of the core modules which are mainly written in the JavaScript and even the developers to writing a new module. It is also primarily used to develop the input and output web applications like single page applications, video streaming sites with other web applications.
3 Things Everyone Knows About Node JS That You Don'tF5 Buddy
Node.js is server side javascript. Here the complete presentation on Node JS with the 3 Things which everyone knows about Node JS and installation process of it. https://www.f5buddy.com
Developing realtime apps with Drupal and NodeJS drupalcampest
Based on Google's V8 JavaScript engine, NodeJS is a fairly new platform for creating scalable and real-time web applications. I will introduce you to NodeJS internals and ecosystem as well as exaplain why and how you can use Node in your Drupal based projects.
Introduction to node js - From "hello world" to deploying on azureColin Mackay
Slide deck from my talk on Node.js.
More information is available here: http://colinmackay.scot/2014/11/29/dunddd-2014-introduction-to-node-jsfrom-hello-world-to-deploying-on-azure/
Scaling and hardware provisioning for databases (lessons learned at wikipedia)Jaime Crespo
At the Wikimedia Foundation (host of Wikipedia and many other open collaborative projects) we work on a limited budget, donated by our many generous donors. As many other companies that are not Facebook- or Google-sized, we have to do more with less both in terms of budget and our small number of Ops in order to serve the over 400 thousand requests per second and the 1200 million monthly users. We made several mistakes (and a few successes) along the road regarding architecture and hardware decisions, especially for the database-distributed components, storage model, hardware chosen, server size, technology adoption, etc. Now we want to share those with you.
Bringing Interactivity to Your Drupal Site with Node.js IntegrationAcquia
Drupal is a powerful, flexible platform for building applications, but not something that handles realtime notifications easily. Node.js is a breath of fresh air in the Open Source web server landscape. It makes writing applications that handle thousands of open connections at the same time easily.
The Nodejs module integrates Drupal with Node.js, allowing for the best of both worlds. Realtime chat, push notifications and help desk functionality can all be easily added to your Drupal site via the Nodejs module, without the usual scalability and performance issues associated with these technologies on the LAMP stack.
Node js is said to be an open source. It is the cross-platform JavaScript runtime to developing different types of applications and tools. Thus the best node js course js is not a JavaScript framework with its many of the core modules which are mainly written in the JavaScript and even the developers to writing a new module. It is also primarily used to develop the input and output web applications like single page applications, video streaming sites with other web applications.
Partorito da Salvio Giglio, fondatore proprietario della community in Google Plus 'AutoCAD, Rhino e SketchUp designer', questa rivista digitale assorbe molto del suo tempo, a questo dedicato per pura passione. Prodotti, novità, persone, eventi. Ammirevole.
Il progetto nasce dall’esigenza di rispondere ad una specifica richiesta di mercato: la virtualizzazione di postazioni grafiche, ovvero la possibilità di utilizzare applicativi grafici professionali su normali dispositivi come PC, Notebook o Thin Client in ambito locale ma anche geografico.
Heritage or Historic BIM? Information modeling for cultural heritage and facility management.
The presentation illustrates the state-of-the-art and the future researches on Historic Building Information Modeling (hBIM) at University of Padua.
Presentazione della ricerca del gruppo BIM@Unipd: dal BIM Execution Plan alla creazione di un modello interdisciplinare, le problematiche dell'information exchange in ambito strutturale (revit to Tekla/Midas)
Its a presentation about node.js. Here I have covered the basic things of node.js. Like what is node.js how it can be used. and explanation about some node.js frameworks
As per the trends captured in the job market from the year and the technology popularity , the usage of node.js is set to take off this year to a whole new level. This blog is an insight into understanding node.js. Touch points from ground up covering the basics of the platform to advanced use cases will be covered. The key features across the different facets around building enterprise application with node.js will be covered. Interesting use cases will be discussed on how this powerful technology is being used across the globe. The targeted audience can range from intermediate to advanced developers who would like to learn and employ the technology, architects to use it effectively for solutioning and sales team who can leverage the advantages of the technology in proposing quicker time to market like never before.
Since its first appearance in 2009, NodeJS has come a long way. Many frameworks have been developed on top of it. These all make our task easy and quick. It is us who need to decide which one to choose? So, here is the list of top 10 NodeJS frameworks that will help you build an awesome application.
“Node's goal is to provide an easy way to build scalable Network programs”
Asynchronous i/o framework
Core in c++ on top of v8
Rest of it in javascript
Swiss army knife for network Related stuffs
Can handle thousands of Concurrent connections with Minimal overhead (cpu/memory) on a single process
It’s NOT a web framework, and it’s also NOT a language
• Created by Ryan Dahl in 2009
• Development && maintenance sponsored by Joyent
• License MIT
• Last release : 0.10.31
• Based on Google V8 Engine
• +99 000 packages
Java script nirvana in netbeans [con5679]Ryan Cuprak
JavaOne 2016
NetBeans is not just a Java IDE. It supports JavaScript as a first-class citizen and provides a complete integrated development environment. It also provides project types for server-side JavaScript (Node.js) as well as web browsers and mobile (Apache Cordova). In addition, it supports Grunt, Mocha and Selenium, Angular and Knockout, and more. This session provides an update on NetBeans 8.1 and demonstrates the top new JavaScript features. You will see a Node.js application in action, look at the support for JavaScript unit testing, and also see how easy it is to debug an Apache Cordova application running on a tethered iPhone.
An Introduction to Node.js Development with Windows AzureTroy Miles
Node.js has taken off in popularity. Find out why major internet companies like Yammer, CouchOne, DocumentCloud, and LinkedIn are using Node to power their servers. And why Microsoft added support for it to Azure. In this session we will build a simple yet functional web server using Node, enhance it using plugins known as Modules, and hopefully explain why Node is such a powerful new web server paradigm.
- Web Worker context compared to SSJS context
- Mixte Synchronous / Asynchronous APIs
- Making Existing Client-side JS APIs recommendations adaptable to the server context
- Defining W3C recommendation for Server-side JavaScript APIs?
- Remote debugging for Remote (Server) Workers
- Potential common package/module format support (CommonJS, AMD, ECMAScript 6)
- DOM Events, ProgressEvent, EventSource, Server Events (EventEmitter?), & Client Events
- Feedback on previous work at CommonJS and from some SSJS implementations
- Feedback on our experiences in the Wakanda implementation
- start the activity of the community group
Guide to AngularJS Services - NOVA MEAN August 2014async_io
Presentation to the NOVA MEAN (Northern Virginia MongoDB/Express/AngularJS/NodeJS) meetup group August 19, 2014 on AngularJS services, what they are, and why and how to use them
Regardless of whether you're using chef or any other automated devops tool, you still need to consider where you are going to host things. Redundancy is good, so in this talk I will describe the tools I used as well as how and why I set up my own chef+git server to provide my own cauldron in which to cook up server deployments.
Presentation I gave to the node.dc meetup group March 13, 2013 on using Promises and the Q library to make flow of control easier to reason about in Javascript code using async and callbacks
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Mongo and node mongo dc 2011
1. Using MongoDB with node.js
Jonathan Altman
@async_io
http://async.io/
http://github.com/jonathana
MongoDC 2011
2. what is node.js?
• A non-browser Javascript toolkit/framework
started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via CommonJS
support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the core of the
framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
2
3. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X,
OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via CommonJS
support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the core of the
framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
3
4. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via
CommonJS support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the
core of the framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
4
5. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of
the box via CommonJS support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the
core of the framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
5
6. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via CommonJS
support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket
support baked into the core of the framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
6
7. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via CommonJS
support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the core of
the framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
7
8. what is node.js?
• A non-browser Javascript toolkit/framework started by Ryan Dahl
• Available for *nix-based systems: Linux, OS X, OpenSolaris, and now Windows
• Built on top of Google’s V8 Javascript engine
• Compatible with many common Javascript libraries out of the box via CommonJS
support (http://www.commonjs.org/)
• A batteries-included framework: HTTP and socket support baked into the core of the
framework
• A framework that is easy to build tooling on top of
• Most importantly: asynchronous from the ground up
8
9. getting started with node
• Longer than we have time for today
• I have some node.js resources pulled together at the
end of the presentation
• But (shameless plug) may I recommend http://
www.slideshare.net/async_io/dcjq-nodejs-presentation
as a good starting point?
10. why node with MongoDB?
• Both toolkits heavily leverage Javascript for their
capabilities
• Commonality of programming language
• MongoDB’s speed/programming model is highly
compatible with node’s asynchronous model
• Mostly compatible data types, but more on that later
11. using MongoDB in node.js
• connect-mongodb: web framework middleware for
a MongoDB-backed session
• node-mongodb-native: native node driver for
MongoDB
• mongoose: Javascript<->MongoDB object mapper
• mongolia: “non-magic” layer on the mongodb native
driver
12. installing the packages
• All packages are available through npm, the node package
manager:
npm install connect-mongodb
npm install mongodb #(node-mongodb-
native driver)
npm install mongoose
npm install mongolia
13. connect-mongodb
• Provides MongoDB-backed session storage for the
connect/express web development stack
• connect: Middleware layer for node.js (think python WSGI
or ruby’s rack for node)
• Express: “Sinatra inspired web development framework for
node.js -- insanely fast, flexible, and sexy”
• We are going to examine use with Express
• npm install express
14. wire connect-mongodb
sessions into express
var MongoDBSessionStore = require('connect-mongodb');
var app = module.exports = express.createServer(
express.bodyParser(),
express.methodOverride(),
express.cookieParser(),
// You *NEED* to use a better secret than this, and store it
in a better way...
express.session({store: new MongoDBSessionStore({ }), secret:
'foobar'})
);
15. get/set values from session
req.session.pageRenders = req.session.pageRenders || 0;
req.session.pageRenders++;
// increment some view counts
if ( !req.session.viewCount)
{ req.session.viewCount = {};}
if ( !req.session.viewCount.hasOwnProperty(calledPage) )
{ req.session.viewCount[calledPage] = 0; }
req.session.viewCount[calledPage] += 1;
17. how much magic do you
want?
node MongoDB database drivers
18. node-mongodb-native driver
• Exposes the MongoDB API to node
• Fairly light wrapper
• Pushes the need to write library/utility/wrapper
functionality onto the developer
• However, it has no preconceived vision of how to
interact with MongoDB, and very little with node
19. node-mongodb code snippet
var mongo = require('mongodb');
var Db= mongo.Db,
ObjectID= mongo.BSONPure.BSON.ObjectID,
Server= mongo.Server;
HeatmapProvider = function(host, port) {
this.db= new Db('heatNode', new Server(host, port, {auto_reconnect: true}, {}));
this.db.open(function(){});
};
HeatmapProvider.prototype.getCollection= function(callback) {
this.db.collection('heatevents', function(error, heatevents_collection) {
if( error ) callback(error);
else callback(null, heatevents_collection);
});
// Most of the *useful* code removed
20. mongoose: object mapping
and persistence
• Declarative description of Javascript objects that can be
persisted, retrieved, etc. with MongoDB
• Can provide defaults, constraints (validation), virtual
(calculated) fields
• Downside: reduces the plasticity of MongoDB
document collections through its Schema
• Has several useful plugins built on top of it:
authentication/authorization for example
21. using mongoose
• Define a schema:
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var HeatEvent = new Schema({
type : { type: String, enum: ['click']}
, eventStamp : { type: Date, default: Date.now }
, payload : {
clickTarget : String
, pageUrl : { type: String, index: true }
, clickPoint : {
X : Number
, Y : Number
}
}
});
HeatEvent.index({ 'type': 1, 'payload.pageUrl': 1});
var db = mongoose.connect('mongodb://localhost/heatNode');
module.exports = db.model('heatEvent', HeatEvent);
22. what did that schema buy us?
• CRUD and various other operations pre-built
• Constraints/Validation: built-in validation like this:
: type : { type: String, enum: ['click']}
or define your own callbacks
• Defaults: , eventStamp : { type: Date,
default: Date.now }
• Synthetic fields: map non-persisted values into/out of other
persisted fields in the schema
23. mongolia: no-magic object
mapping
• Layer built on top of the native mongodb driver
• Exposes the collection operations of the driver
• Provides a way to build type mapping
• Provides an event-hook system where you can build
validations, defaulting, other features
• Not magic because it provides facilities for you to roll
your own magic
24. tradeoffs in the drivers
• native mongodb driver: least overhead, but you
will end up needing to customize on top
• mongolia: tools to build mapping, data type/casting
support, event hooks. Some overhead, even for unused
capabilities
• mongoose: full field-level declarative mapper, events;
plugin system. “Full stack” object mapper, full overhead
• More magic == more overhead
26. sample web development
stack
• node-inspector: debugging
• express (and connect): web framework, middleware, routing, controllers, views
• spark2: nice front-end for controlling node servers
• ejs templates: embedded javascript, for views
• connect-mongodb: mongoDB-backed sessions
• mongoose: mongoDB-based object mapper for models
• test: yeah, you should pick some and use them
• jsdom: manipulate html DOMs server-side
• jquery and/or YUI3: do cool stuff server side with the DOM
• backbone: nifty client and server controller framework
• socket.io: client/server Comet toolkit
26
27. more from me on node.js
and MongoDB:
• A longer presentation I did on what node.js is, and
getting it up and running: http://www.slideshare.net/
async_io/dcjq-nodejs-presentation
• Heatmapper app I built with node and MongoDB:
https://github.com/jonathana/heatNode
28. more info on the packages:
• connect-mongodb: https://github.com/masylum/
connect-mongodb
• node-mongodb-native: https://github.com/
christkv/node-mongodb-native
• mongolia: https://github.com/masylum/mongolia
• mongoose: http://mongoosejs.com/ and https://
github.com/learnboost/mongoose/
29. appendix: Resources
• Ryan Dahl: (http://tinyclouds.org/, https://github.com/ry)
• Ryan’s jsconf 2009 presentation: http://s3.amazonaws.com/four.livejournal/20091117/
jsconf.pdf
• Simon Willison’s blog post re: node.js: http://simonwillison.net/2009/Nov/23/node/
• node.js home: http://nodejs.org/, git repo: https://github.com/joyent/node/
• node modules: https://github.com/joyent/node/wiki/modules
• Isaac Schlueter: (npm and nave) https://github.com/isaacs/, http://blog.izs.me/
• Dav Glass’ mind-bending demonstration of using YUI server-side: http://
developer.yahoo.com/yui/theater/video.php?v=glass-node
• Nice list of some apps built using node.js + express: http://expressjs.com/
applications.html
29