LATEST FROM OUR BLOG

Take your daily dose of (only) relevant news, useful tips and tricks and valuable how to's on using the latest web technologies shaping the digital landscape. We're here to do all the necessary information sifting for you, so you don't have to, to provide you with content that will help you anticipate the emerging trends about to influence the web.

How to Start Building a Web App Using React: 5 Steps to Creating Your First App with React.js
Building a web app using React for the first time? Then it must be a simple "Hello World" type of app that you're planning to set up. One that would guarantee you a smooth first-hand experience with React.js... So, you're wondering: "What's the fastest way to build a basic app in React?"   A question then followed by a... myriad of other questions:   "What dependencies should I use?" "What React stack should I go for if it's just a simple web app that I want to create?" Now it's about time that you moved from questioning yourself to code writing, don't you think? Here's a simple and easy-to-follow tutorial on how to create a React app from scratch.   1. Create a New React Project Folder  The very first step to take is to start a new React project. Obviously! Note: Make sure you have NPM and Node installed in your environment first things first! For this, just run the command here below: npm install -g create-react-app Tada! Your React boilerplate app creator has just bee installed! Now the second code that you'll run is going to create your "Hello World" React app itself: create-react-app hello-world Running an imaginary magnifying glass across your app's structure you can't help not noticing the 3 major file types there:   public/index.html files src/index.js files src/App.js  files   And scanning your app's backbone a little deeper you'll spot:   a div with the id root this piece code here below in the index.js.file: ReactDOM.render(, document.getElementById(‘root’)); If we were to translate this code segment into plain language it would go something like this: React injects your app component into the div by using the root id.   2. Write the Simplest React Component  "But what is an app component more precisely?"  Take it as React's convention to use the same names both for JavaScript files and the component.  And now the code for your more-than-basic component would look something like this: import React, { Component } from 'react'; class App extends Component { render() { return ( <div className="greeting"> <h1> Hello World! </h1> </div> ); } } Feel free to create a JavaScript class for it and to extend it from the Component class. Next, implement the render () method, which will return a whole suite of elements (unlike prior to React 16, when one had to return a single element per each render method that was being implemented). Then, running the npm start command in your app's directory, you'll see the "Hello World" text message displayed at http://localhost:3000.   Hello World!   3. Building a Web App Using React and JSX And I feel that I should start by defining JSX, right? Before I go ahead and delve into details on how to use it with React: An extension to the JavaScript language — therefore a template language — with a structure similar to HTML. One that makes a great team with React. Its true "power" is that it... empowers you to write your HTML components and React components in an HTML-like tag: <HelloWorld /> And here's JSX "in action", right in this "Hello World" app that we're building here: The following code: const element = ( <h1 className="greeting"> Hello, world! </h1> ); ... gets compiled to the familiar JavaScript code here below: const element = React.createElement( 'h1', {className: 'greeting'}, 'Hello, world!' ); See? A familiar HTML-tag language that makes structuring an app's code a whole lot easier for any developer! And this is JSX's main role and the very reason why it works perfectly with React.   4. How to Use State vs Props in React.js How about creating another component as we're building a web app using React? Let's name it "Mary": import React, { Component } from 'react'; class Mary extends Component { render() { return ( <div> <h2> Hi, I am Mary </h2> </div> ); } } export default Mary; Bravo! Next, we can include it, as a child component, into our existing React App component: import React, { Component } from 'react'; import Mary from './Mary'; class App extends Component { render() { return ( <div className="greeting"> <h1> Hello World! </h1> <Mary/> </div> ); } } export default App; Note: Noticed the import statement for our "Mary" component? It plays a key role since without it our React app wouldn't work. And this because React wouldn't be able to identify, all by itself, the component that corresponds to the Mary tag. Curious now how you could manipulate your "Mary" component? How you can control its behavior? By manipulating its... state object, that's how! Note: each React component comes with its own state object. import React, { Component } from 'react'; import Mary from './Mary'; class App extends Component { constructor() { super(); this.state = { greeting: "Hello World!" } } render() { return ( <div className="greeting"> <h1> {this.state.greeting} </h1> <Mary/> </div> ); } } export default App; See the "greetings" property — having the "Hello World" value — that corresponds to the state object? Remember that you're free to add as many properties as needed. Next, how about trying to pass data from our App component into its child one, Mary: import React, { Component } from 'react'; import Mary from './Mary'; class App extends Component { constructor() { super(); this.state = { greeting: "Hello World!", parentMessage: "Hello Mary!" } } render() { return ( <div className="greeting"> <h1> {this.state.greeting} </h1> <Mary newMsg={this.state.parentMessage} /> </div> ); } } export default App; Noticed the "newMsg" key there? It's precisely this key that's responsible with the data transfer. Now, as for the child component "Mary": import React, { Component } from 'react'; class Mary extends Component { constructor(props) { super(props) this.state = { greeting: props.newMsg } } render() { return ( <div> <h2> {this.state.greeting} </h2> </div> ); } } export default Mary; If you're willing to give this piece of code a deep scan, you'll notice that there's a "props" method argument in there.  Keep in mind that it's precisely this object that stores all the data transferred from the parent component to the child React component. Also, another "detail" that you should be able to detect is the "newMsg" property (transferred from the parent/App component); we've used it to initialize the state of the Mary component.   5. How to Use The React (Component) Lifecycle Hooks I won't get into too many details, since React's documentation is already more than "enlightening" when it comes to:   the different lifecycle methods (or hooks) to be invoked for each state of a React component  the precise times in the development process for triggering each hook   Nevertheless, I'll briefly add that all these methods to be used across your React components' lifecycles fall into 3 main categories:   mounting hooks: use them at the very start, when your React component is being rendered in the browser page updating hooks: fire them when your component gets re-rendered on the web page. And this happens if/when changes are made to the state/props objects unmounting hook: invoke the componentWillUnmount() hook shortly after your component gets removed from the DOM     Note: Since React 16, the collection of hooks has enriched with a brand new one: componentDidCatch()! Fire it whenever you're dealing with an exception during the other lifecycle methods of your component. In other words: invoke it whenever a component fails to function as it should when you're building a web app using React! As for the specific way that React manipulates DOM via the Virtual DOM that it creates, feel free to have a look at our post precisely on this topic: How React Virtual DOM Works! The END! Your turn now: go through all the steps included here and, step by step, set up your first basic React application!  ... Read more
RADU SIMILEANU / May 31'2018
Top Enterprise Content Management Systems vs Drupal: Comparing Features and Prices 
Content is a way too valuable asset not to handle it with utmost care — from its creation to its revision, all the way to its... distribution. And with utmost efficiency, as well! But how do you choose the business software to “orchestrate” your entire content workflow? Since, on one hand, you have the top enterprise content management systems in 2018 and, on the other hand, you have... Drupal? And the dilemma that you're facing right now could be summed up like this: Choosing between a complex ECM system with a load of powerful tools that comes at a cost and a feature-rich one — already famed for its robustness and customization options — with no price tag on... Now to ease your decision-making process, let's compare these enterprise information management solutions, the top rated ones, to Drupal, by weighing their feature loads and costs.   1. But What Is an Enterprise Content Management System More Precisely? First, let's try to define what we mean by “content” in relation to a content management software: Content is all the written pieces of information entering and “moving about” your organization. It comes in the form of: internal process documents content for your company website (or blog) sales-focused content targeted, custom content available to paying cutomers only ... and the list goes on. As you can see, I've intentionally left out graphical and audio-visual content. And this because it's only text-based digital content that a CMS would handle. Now, coming back to our initial question: An enterprise content management system is a software geared at managing all the processes in your content's lyfecycle: creation, revision, publication, distribution to multiple channels, promotion etc. Packed with different sets of tools designed to automate all your content-based processes, an ECM system is a... “Swiss knife” type of business software. The one you'd use to streamline your content workflow(s).   2. M-Files, One of the Top Enterprise Content Management Systems in 2018 Introducing the enterprise-leveled information management solution of the year: M-files! The promise that it makes?  To break the “siloed information” pattern and enable users to access specific content from any buiness system, any device. … to easily access it, but also to organize it, to manage it, to identify particular information/documents, to set up custom workflows and even to manage document reviews.    Top features   version control  automated workflows pre-built search engine: you get to track documents by type, name, keywords; it provides within-text search features as well  notifications: users get alerted whenever they'll need to review or approve changes made to documents approval processing  permission management and offline access  integration capabilities: it easily integrates with Microsoft Dynamics, NetSuite, SAP, Salesforce  document collaboration tools: co-authoring features and check-in/check-out tools    Price Mi-files is one of those enterprise content management vendors that leverage the quote-based method for pricing their services. Basically, there are no standard prices, as there are no standard packages that they offer, only tailored content management solutions.   Cons The great majority of negative user feedbacks revolve around the M-Files mobile app's limited functionality.   2. OnBase  Another one of the top enterprise content management systems in 2018 is OnBase: An all-in-one software coming “equipped” with: business process management tools integrated document management tools records management tools And before I “expose” to you its most heavy-weighing features, I feel that I should put the spotlight on its versatility feature first: You get to easily configure your OnBase ECM system to fit any environment of choice.   Top Features    approval process control indexing version control built-in search engine document management   Cons Do expect a steep learning curve! So, be prepared to invest a significant amount of time in growing comfortable with using it. In learning to “juggle” with all its apps and functionalities.   Price You'll need to contact the OnBase team for a custom pricing plan.   3. Box  Box is a cloud content management platform built to assist you with:   online sharing your files storing your files integrating content across your entire “infrastructure” of digital tools via open APIs collaborating within your team   Top Features    granular access permission easy integration with other platforms  advanced security capabilities: device trust, watermarking, data governance easy integration with other platforms collaboration tools: a document management system that enhances collaboration among end-users on various file types and devices; tools which also enable them to choose the right storage place, to set up metadata-driven content workflows etc.   Cons Even top enterprise content management systems manage to collect their own “pile” of “bad reviews”. What users reproach OnBase here, for instance, is its user-based pricing model.  In other words, if you have +100 people in your company, expect to get charged separately for each email domain... and thus to overstretch your budget over time.   Price Box pricing plans start from €4.50 per user/month (we're talking about a starter business plan here) and can go up to $500 per month or more if it's a “build with BOX platform” plan that you'll select.   4. Drupal  And now that we've put the top-rated ECM systems in 2018 into the spotlight, let's see what Drupal here has to offer. How it can counterbalance all these heavy loads of tools, features, and functionalities.   Drupal's Key Features    advanced integration capabilities: Drupal “spoils” its end-users with conveniently accessible API, backed by a rich collection of modules built precisely for 3rd party integrations no maintenance effort required: since it runs in Acquia Enterprise cloud, Drupal gets automatically updated; maintenance is already included in the Enterprise support costs plan feature richness: and we're talking here about features, plug-ins (thousands of them) and content management tools that you get right out of the box modular architecture: which goes hand in hand with the unlimited freedom of customization that you'll get to leverage high performance: Drupal's already famed for its robustness and capabilities to withstand high influxes of traffic unmatched scalability a full toolbox (contributed modules here included) put at editors' disposal: Drupal's also won its reputation as a CMS that's been constantly improved to enrich the experience; all the in-built content-handling tools speak best of its “empower the content creator/end-user” philosophy   Price   license costs: unlike the top enterprise content management systems previously outlined, Drupal's open source; there are no license costs, only support costs associated with the Acquia Enterprise Platform  vendor lock-in: all modules and plug-ins that you might select and mix and match to custom-tune your CMS are free development costs: Drupal resources are available to anyone who wants to build and then to custom tune and scale up its CMS   In conclusion... … Drupal comes feature-packed and, moreover, it “spoils” you with unlimited freedom of customization. And all this without putting a price tag on. On the other hand, some of the top enterprise content management systems do tempt you with their feature richness, but at a cost. One that can go up precisely if you feel like customizing your ECM solution or scaling it up sometime in the future.  In short: you do get your share of customization freedom... but not for free. So, it's not really an “apples vs oranges” type of dilemma that you're facing, but rather an: Apples vs Apples with a price tag on ... Read more
Adriana Cacoveanu / May 29'2018
How to Create an Angular Project with Angular CLI in 5 Simple Steps
About to build your very first Angular app? Then you must be planning to create an Angular project with Angular CLI, right? The much-acclaimed tool that the Angular team built precisely to jumpstart the whole development process. … to have a simple app scaffolded, generated and deployed in no time, by entering just a few commands (so they say, at least).  And since I'm sure that you don't want to waste these bundles of convenience by letting yourself tangled up in overly complex explanations instead, I've kept things simple with this guide. So, here's how you create and run your first Angular project via the Angular command-line interface:   1. But How Precisely Can Angular CLI Jumpstart Your App's Development Process? Take this command-line interface as a starter kit “present” that the Angular team has nicely wrapped for you:   it's practically geared at empowering you to get up and start developing a new Angular app in no time it takes just one short command to generate a default Angular project that would include all the needed dependencies (in the node_modules folder), as well as testing files for each component   Now, this is what I call a major kickstart! It's got you covered from the stage of setting everything up, to creating the Angular project itself, to testing it and finally deploying it. Other key usages of the Angular CLI that we're not going to focus on in this tutorial here are:   real-time server maintenance and support building applications for production adding new features to your existing app  running tests on your application units    2. Setting It Up: Install Angular CLI Globally Before you jump to the part where you create an Angular app using Angular CLI, you need to install the command-line interface itself. Globally! And this is the “power” command to enter in your terminal with the npm installed: npm install -g @angular/cli Notes: if you already have the CLI installed, make sure it's the latest version if you need to update it, these are the commands to enter: npm uninstall -g angular-cli npm uninstall --save-dev angular-cli And there's more! A few more must-have dependencies that you need to make sure that are already installed and upgraded to their latest versions: Node.js: v6.9.x + npm: 3.x.x +   3. Create an Angular Project With Angular CLI With your command line interface ON, use it to enter THE one and only command that will generate a new Angular project for you. One incorporating, by default, all the needed dependencies: ng new ng-yourproject Tada! A “yourproject” named directory has just been generated. That's where your new Angular project — along with all the requested dependencies — gets stored. Eager to test it out? Just run the following command in your terminal: ng serve   Your Angular app will then get built and served up to localhost:4200. Feel free to open this URL in your browser and it's the here-below screen that you should be able to see: Basically, it's the default application shell itself rendered by the CLI.   4. “Deconstructing” Your New Angular Project: What Does It Include? Now, before you go ahead and do your “tweaking” on your newly created app, let's see what you've got in there! What are the elements that the CLI has generated for you to help you jump to development right out of the box? For this quick “scan”, open your Angular project in your IDE of choice and start “exploring” your src/folder:   src/*    styles.css any styles that you'll plan to apply globally, it's this file that you can add them to; and it's here, as well, that you can import new .css files (Bootstrap or any other styling frameworks of your choice)   index.html  where your Angular app gets started   src/app/*    app.component.ts this is where your app's one and only (for now at least) component gets stored   app.module.ts  the modules Angular needs for managing your app's components note: @NgModule marks the class file as a module and this is what makes it similar to @Component   5. Create a New Component  Remember your “one and only component” that I mentioned during the previous “inventory” of all the “bunch of stuff” that CLI has generated in your project? Well, how about creating a new one now? One that would load under that root component? Just run the following command to generate it: ng generate component the-quote Next, time to “show it off” in your browser: <h3>{{myQuote.quote}}</h3> <small>- {{myQuote.by}}</small> Add the app-the-quote selector to the root component that the CLI generated in your Angular project: <h1> {{title}} </h1> <app-the-quote></app-the-quote> 6. Apply External Styling  Now you do agree that when you create an Angular project with Angular CLI applying styling is a key step. So, let's add your favorite CSS framework to your new application! Me, it's Bulma that I'll be using in this tutorial here: npm install bulma --save With our CSS framework installed, we'll need to enable it to load the CSS file into our Angular app. For this, just place the relative path within the .angular-cli.json file., to the file in the styles array more precisely. ... "styles": [ "../node_modules/bulma/css/bulma.css", "styles.css" ], ...   “Tempted” to display some icons now, as well? Then go ahead and add the font-awesome library as cdn link. For this, just include the stylesheet right into your index.html: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> Et voila! This is how you create an Angular project with Angular CLI! What do you think? Is the Angular command-line interface an extremely useful tool to jumpstart your project with or did you expected your “starter kit” to include, right out-of-the-box, more elements to get you started? ... Read more
RADU SIMILEANU / May 25'2018
How to Speed up Your Magento 2 Store on Mobile Devices: 5 Tweaks That You Can Make
What can you do to speed up your Magento 2 store on mobile devices? For let's face it: Magento 2's “ecosystem” of third-party extensions and overall its modular architecture is convenience at its best for any developer! For any eStore owner. It empowers them both to start small and then scale it up to their most daring goals. Yet, all this power placed in your hand does come at a cost: reduced speed. And top speed is crucial if you're determined to deliver a great mobile user experience. So, what are the tweaks that you can make to boost your eStore's performance? Luckily, there are plenty, ranging from:   well-known (and too frequently underrated) best practices, like optimizing your product images to slightly more in-depth “tweaks”, like inlining critical CSS   But, let's dive right in! Here's your “emergency kit“ of 5 solutions to apply to your Magento 2 store for improving its performance on mobile:   1. Reduce Page Size to Increase Page Loading Speed  And it's still those “too obvious to be truly effective” type of techniques that have the biggest impact on an eStore's performance on mobile devices: Lower your web page size and it will make a drastic difference for your mobile users' experience with your online store; especially for those accessing your site from mobile devices with low bandwidth. Now here are a few simple, yet effective tweaks that you can make to reduce page size:   1.1. Use GZIP  to Compress Your Pages A handy “trick” that you can perform is to enable GZIP (if it's not already enabled) and let it “work its magic” on your web page's size. It will compress:   fonts CSS files external scripts JS   … cutting your pages' “weight” down by almost 70%. Note: put any of your front-end pages to the Google PageSpeed Insights “test”; take note of the GZIP-related warnings popping up and ensure that the CSS/JS compression feature is enabled.   1.2. Enable JavaScript/CSS Files Minification Here's another built-in Magento 2 feature that all you need to do is... trigger to speed up your Magento 2 store on mobile devices: CSS/JS files minification. Note: do keep in mind, though, that it works in production mode only (so not in default or developer mode, as well)! Here's how you enable it:   Navigate to the backend menu Stores > Configuration > Advanced > Developer Set your app/site's production mode:   php bin/magento deploy:mode:set production Note: not sure what mode your eCommerce site's running on now? Enter the following command to identify its current mode: php bin/magento deploy:mode:show 1.3. Optimize Your Product Pages  And the more crowded your product catalog is, the more important this solution becomes! “Are you implying that I should take each and every one of my product images and optimize them... one by one?” you might ask yourself. Definitely not! Since there are at least 2 easy solutions that you could go for:   you can use a content delivery network (CDN) as it will take the image optimization “burden” off your back you can leverage the Google PageSpeed (GPS) server extension; it will compress your images in no time, among other “tricks” that it performs to speed up your Magento 2 store on mobile   2. Reduce The Server Response Time to Speed up Your Magento 2 Store  Optimizing your server's response time (or “time to first byte”) is another critical tweak that you can do to boost your Magento 2 store's speed.  Set your “target” to 0.5s, the time a browser would need to wait for your website's server response. “But why bother, since Magento provides me with full-page cache functionality right out of the box”, you might wonder. That's true, but just consider particular pages, such as checkout, customer pages, cart, that this pre-built functionality can't “work its magic” on.   2.1. Run a Throughout Audit on Your Third-Party Extension "Load"  Start reducing your server response time with a basic, yet so very effective step: Audit your entire modules infrastructure! identify any issues with your current plugins and (if any) look for a patch or replace them with more performant ones turn them on and off just to detect any negative impacts on your Magento 2 site's performance    Note: as a rule of thumb, try keeping your Magento 2 third-party extensions to a minimum! Trim down your collection of modules keeping only the must-have ones; otherwise, its weight will affect your eCommerce site's performance!   2.2. Use Magento 2 Profiler to Detect Any Server Performance Issues “What's a profile?” you ask.  A program geared at identifying just how much time a code block needs to execute. Using a profile you'll be actually drilling deep(er) into your Magento 2 store's internals to detect the very root cause of your bad server response time!   2.3. Consider Upgrading Your Hosting Plan Is it time you upgraded your hosting server? More RAM and CPU will always have a huge impact on your eCommerce website's performance, you know. So, how do you know whether it's time to upgrade? Just install a brand new Magento 2 website on your current server. If it's speedier than your live website, there's no need to change your current hosting plan. In this case, you'll only need to focus on the other tweaks included in this list here to speed up your Magento 2 store on mobile.   2.4. Use Varnish as a Full-Page Cache (FPC) Solution Another trick for improving Magento 2's performance is to leverage Varnish, the software that caches and serves content. The good news is that Magento 2 supports it natively. And here's how you trigger its “power”:   navigate to the backend menu Stores > Configuration > Advanced > System > Full Page Cache   Note: you'll need to enter a hostname, port and Varnish export configuration; if in doubt, ask your system admin for a hand to set everything up properly. 3. Load and Render Above-the-Fold Content First  Prioritize the content that appears before scrolling down! It will make all the difference when it comes to your Magento 2 eStore's page loading time! And now, here are the techniques at hand for loading and displaying this content first:   3.1. Defer Loading JavaScript  Moving all your JS code to the bottom of the page (“beneath the fold”) will implicitly make your AF (above-the-fold) content load quicker. You'll basically postpone the time-consuming parsing of JS code and thus speed up your Magento 2 store on all mobile devices! The good news is that there already are Magento 2 extensions that do the job for you. They'll move all your non-critical JS scripts beneath the fold!   3.2. Inline Critical Above-the-Fold CSS “But what about the above-the-fold CSS?” you might legitimately ask yourself.  How do you approach these critical files? For you definitely can't place ALL your CSS at the bottom of the page, now can you? Well, first you:   extract/isolate precisely this “critical” CSS then you inline it straight to the HTML; right between <head> and </head> tags   This way, it will get loaded and rendered first (before the non-critical CSS), along with the rest of the above-the-fold content.  Note: you might be tempted to go for one of those tools “promising” you to extract this CSS for you. Unfortunately for you, manually setting the critical CSS for each one of your pages (homepage, checkout, category etc.) is the right way to do it.   4. Leverage the Power of HTTP/2  By moving your Magento 2 website over to HTTP/2 you'll grant your eStore users a secure and faster-browsing experience. Not to mention the impact that it will have particularly on the experiences of those customers using a slow mobile network to access your online store. The tremendous news is that Magento 2 co-exist with HTTP/2 by default. Yet, there are 2 conditions that you need to make sure your online store meets:   your hosting server should already support HTTP/2 your eCommerce web pages should be served via SSL   Note: run your own "investigation" and look for some suitable extensions providing server pushes.   5. Magento 2 Performance Optimization: Disable JS Bundling But why would you want to disable a Magento 2 feature that actually lowers the HTTP requests made by your browser for loading and rendering a web page? Because it comes with its own side-effects, the main one being the oversized JS file that this feature generates, of about 5-10 Mb. Moreover, it's proven that downloading this huge external file takes more time than the time you'd actually be saving by reducing the no. of HTTP requests. Now that we've tackled the “Why”, let's focus on the “How”, as well. Here's how you disable JS bundling:   go to your website's backend menu Stores > Configuration > Advanced > Developer and apply the following configuration:   Note: there's no need to disable this JS files grouping feature if you're already using HTTP/2! The END! These are but 5 of the handiest solutions that you could use to speed up your Magento 2 store on mobile. As you can see, the list includes nothing more than predictable “tweaks” and well-known best practices that you should stick to.   ... Read more
Silviu Serdaru / May 23'2018
How to Integrate Alexa with Your Drupal 8 Website: A Step-by-Step Guide
Just imagine: a user asks Amazon Alexa to read out loud to him/her the headline of your latest blog post! Or maybe to look for a specific section on your Drupal site! Or, even better: quit imagining this and start implementing it instead! Right on your website. And here's how you integrate Alexa with your Drupal 8 website via the Alexa integration APIs. A 7-step tutorial:   on how to get Alexa to “talk to” your site users/online customers on turning your site's content into the needed “raw material” for setting up your custom Alexa skills on how you can leverage Drupal 8's outstanding third-party integration capabilities to “fuel” your implementation plan with   So, here's how it's done:    But Why Precisely Amazon Alexa over Other Voice Assistants? Because Amazon Alexa stands out with its top notch integration capabilities. Its integration APIs make it possible for this particular voice service to be “plugged into” various devices and web services. As simple as that! Alexa's more than just a voice assistant making voice (obviously!) interaction possible: It's a voice service that empowers you to integrate it even with your Drupal 8 website quickly and smoothly, via its own built-in APIs!   Introducing Alexa: The Drupal Module for Amazon Alexa Integration With Alexa “doing its own part” and the voice service bringing its Alexa integration APIs into the equation, it was only fair that the Drupal community should play their own part, as well. The result of their sustained efforts? The Alexa Drupal module:   which provides an endpoint for your Drupal 8 website, where it would receive the vocal user requests “stored” in the Alexa Skills "user requests” which get converted into text strings before getting sent over to the Alexa module on your Drupal site   Note: do keep in mind that the Alexa module is still under development, but with a more than promising, long-term future ahead of it. For now, it offers basic integration with Amazon's Alexa. And this is precisely why you'll need to build a custom module, as well, to integrate Alexa with your Drupal 8 website. But more details on this, in the tutorial here below:   Integrate Alexa With Your Drupal 8 Website: A 7-Step Guide    Step 1: Make Sure Your Site Uses HTTPs In other words: make sure your Drupal 8 website's “easily detectable” by Amazon's servers! The very first step to take will be to switch your site over to an HTTPs domain (a step you can skip if your site's already on HTTPs)   Step 2: Install the Alexa Module Go “grab” the Alexa Drupal module and get it installed and enabled on your website.    Step 3: Set Up Your Alexa Skill  With your dedicated Drupal module ON, it's time to focus on all the needed setting up to be done on the Amazon Developer site. And the very first step to take is to create your own new Alexa Skill in the Skills Kit there. Step 4: Copy & Paste Your Application ID And this is no more than a quick 2-step process:   first, you copy the Application ID provided in your “Skill information” section, on the Amazon developer site then you submit it to your website's configuration at /admin/config/services/alexa   Step 5: Configure Your New Alexa Skill A key 3-part step to take when you integrate Alexa with your Drupal 8 website, where you:   give a name to the Alexa skill (in the Alexa app) to be triggered set up an Invocation Name for your users to utter for “activating” your newly created Alexa skill set up the custom vocal commands or “intents” that Alexa will need to respond to   For this, you'll need to go to the Amazon Development website again and access the “Skill Information” section. Note: maximize the odds that it's precisely those intents that your users will utter by adding more phrasings of the very same question/vocal command.  Another note: this flexibility proves that you get to harness the power of... variables when setting up your custom intents. “Variables” that you'll use with the custom module that you're going to build at the following step of the process:   Step 6: Create a Custom Module for Triggering The Right Responses to Your Intents What should happen when your custom intents get invoked and sent through to your Drupal 8 website?  You'll need to create a custom Drupal 8 module that would handle responses. For this, insert the following info in the demo_alexa.info.yml file: name: Alexa Latest Articles Demo type: module description: Demonstrates an integration to Amazon Echo. core: 8.x package: Alexa dependencies: - alexa Note: Do keep in mind to add the Alexa Drupal module as a dependency! Now, time to build the custom module itself:    create a file at src/EventSubscriber/ name it RequestSubscriber.php    As for the code that will “populate” your module, first of all it's the namespace and use statements that you'll need to create: namespace Drupal\demo_alexa\EventSubscriber; use Drupal\alexa\AlexaEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Drupal\paragraphs\Entity\Paragraph; Then, you'll need to set up your main class, as well as a function to trigger the event: /** * An event subscriber for Alexa request events. */ class RequestSubscriber implements EventSubscriberInterface { /** * Gets the event. */ public static function getSubscribedEvents() { $events['alexaevent.request'][] = ['onRequest', 0]; return $events; } Next, set up the function “responsible” for giving responses to each one of your custom intents.  With the code for your responses at hand, the very last file that you'll need to focus on is the demo_alexa.services.yml: services: alexa_demo.request_subscriber: class: Drupal\demo_alexa\EventSubscriber\RequestSubscriber tags: - { name: event_subscriber } Note: Remember to enable your demo Alexa module, then to navigate to the Amazon Developer site once again!   Step 7: Test Out Your New Alexa Skill  Another essential step to take when you integrate Alexa with your Drupal 8 website is testing your newly created Alexa skill.  And there's even a Test tab on https://developer.amazon.com for that! Click on this specific tab, ensure that your new Alexa skill is enabled and thus ready to be tested and... see whether you'll get the right responses! The END! This is the “how it's made” for getting Amazon Alexa to “talk to” your Drupal 8 website via:   the Alexa integration APIS the Alexa module a custom-built Drupal 8 module   ... Read more
RADU SIMILEANU / May 18'2018
When Should You Not Consider Using Node.js? 3 Unsuitable Use Cases
It's undebatable: Node.js has practically laid the foundation of the real-time web! The real-time, two-way connection web apps have revolutionized the old web response paradigm. The one where it was just the client who could initiate communication, never the server, as well. Even so, there are certain cases when using Node.js is not the best decision you could make. Specific use cases for which the otherwise flexible and revolutionary web server technology turns out not to be... unsuitable. So: “When shouldn't I use Node.js?” You might legitimately ask yourself. Here are the 3 bad use cases for this JavaScript runtime environment. Scan them through, take note all the factors that I'll be outlining and think them through before rushing to use Node.js to power your next project with.   1. A CPU-Heavy Application: Using Node.js Is Simply a Bad Idea Face it, deal with it and... adjust your decisions to it: There are plenty of better solutions (other than Node.js) for powering your CPU-intensive app. It's just not the best technology at hand when it comes to heavy computation. Now here's why, by using Node.js, you'll only end up “sabotaging” its very advantages, instead of turning it into a true “horsepower” for your app, as you might expect:   Node.js leverages an event-based, non-blocking I/O model, using a single CPU  hence, all that intense CPU-processing activity will actually block the incoming requests … since the thread will get “held up” with number-crunching   The direct effect of “exploiting” Node.js in the context of heavy server-side computation?  The very benefits of its event-driven, non-clocking I/O model would get practically... nullified in the context of CPU-intensive operations. Given this, why would you stubbornly stick to Node.js, when there are other technologies more suitable for building your CPU-heavy software with? With better results?   2. A Simple CRUD (or HTML) Application No need to get your hopes high when using Node.js with a basic CRUD or HTML application: It might turn out to be just “slightly” more scalable, yet don't expect a traffic flood just because it's Node.js-powered. In short: use cases like this one, where data's provided, straightforwardly, by the server and where there's no need for a separate API, render Node.js superfluous. There are other frameworks suited specifically for this type of projects (take Ruby for instance). Using Node.js in this case would be like driving a Formula 1 car while... stuck in rush hour traffic.    3. A Relational Database-Backed Server-Side App Why isn't Node.js your best choice for a relational data access type of project? Because its relational database tools aren't as reliable, robust and easy to work with as other frameworks' toolboxes (take Rails for instance!). Rails, for example, would “spoil” you with:   already matured Data Mapper and Active Record data access layer implementations out-of-the-box data access setup DB schema migrations support tools … and the list goes on   In short: if there already are frameworks perfectly “equipped” for this type of project “scenarios”, why would you stick to using Node.js? Since its relational DB toolbox is not (yet) as advanced?   In Other Words... With these 3 “bad” use cases for Node.js “exposed”, allow me to put together a short “inventory” here, one including all the “gotchas”, aspects to consider before kicking off your Node.js project and limitations to be aware of:   Node.js hasn't been built with the “solving the compute scaling” issue in mind   … but it has been created to solve the I/O scaling issue instead   excepting contexts of CPU-heavy operations, Node.js still is the best technology at hand for powering your real-time, scalable web apps with   do reconsider your decision of using Node.js if for developing your piece of software you depend on some kind of threading model   there are also poor quality packages available in npm, free to use in your Node.js application; do keep this in mind as you dig deep into the “load” of  Node.js packages   Node.js will never be “the best choice” for event loop-blocking use cases (take asynchronous parsing XML, for instance)   … nor for powering apps relying on intense computation   Node'js “worker” is geared at solving HTTP server calling issues (rather than intense computing issues)   The END! ... Read more
RADU SIMILEANU / May 17'2018
What Is Node.js Used for? What Projects Can You Build Using It? 7 Best Use Cases
Not exactly the “jumping on the latest trend" type? Therefore, you're still a bit hesitant to get on the Node.js bandwagon? And this because you still haven't got some crystal-clear answers to your “What is Node.js used for?” question? You're legitimately hesitant then! For everyone's gone crazy over it these days, but you know that there must be certain factors to consider. Specific use cases for Node.js, as well as cases when... well... it just isn't the best idea. You're well aware that there are some particular applications that call precisely for this JavaScript runtime environment. And you need to be 101% sure that your project fits the “profile”. One of the “best use cases of Node.js”. But let's not meander any longer and get you some clear answers to your questions instead:   Why should you even consider Node.js one of the possible technologies to choose from for your next project?   Which are the ideal use cases for Node.js?    1. Why Would You (Even) Consider Node.js for Your Project?  Why should Node.js be on your list of... options, in the first place? On your shortlist of technologies that might power your next project? There must be some “bundles of convenience”, some major benefits that you can “reap” from using it, right? Benefits that make it worth building your project using this specific environment. Well, let us shed some light on these clear advantages of developing your application in Node.js:   it's a Google JavaScript engine (a runtime environment) which, translated into clear benefits, means that: it's fast and scalable web apps that you'll build using it   speaking of its scalability: Node.js's built to scale on individual process basis and to leverage multi-core processing on modern servers (via its Cluster module)   it's JavaScript-based... so the “pool” of developers with some kind of JS knowledge/expertise is conveniently large: 99,9% of them know at least “some” JavaScript   … no to say that this turns Node.js into the perfect choice if there are beginner developers in your team (even junior developers are at least familiarized with JS)   any developer will be able to gain a quick understanding of your Node.js app's codebase   it speeds up developers' work with a collection of modules (Grunt, NPM, etc.)   it provides your development team with a great package manager, npm, with a widely available and increasingly heavy “load” of open-source tools    it's backed and actively maintained by an ever-growing community ready to... support you; the knowledge base that your development team needs to get a grip on Node.js is accessible and... free   it's open-source: you'll benefit from a single, free codebase    it's just... fast, there's no point in debating over this: the event loop and Google's innovative technologies are “turbocharging” it   it cuts down costs, as simple as that: Node.js enables your team to use the same language on the front-end and on the back-end, which translates into boosted efficiency, cross-functionality and implicitly... reduced costs   you're “tempted” with a whole range of hosting options to select from   it supports native JSON: it's in this specific format that you'll get to keep your data stored in your database   Now if I was to trim this list to just 3 answers to your “what is Node.js used for?” dilemma, it's these 3 key benefits that I'd stubbornly stick to:   performance: Node.js is simply... fast, faster than other JS languages; moreover, as a runtime language it has enhanced JavaScript with new capabilities versatility: from backend to front-end apps, to clips to... pretty much everything in between, Node.js enables you to build any kind of project that you have in mind; as long as it's written in JavaScript, of course agility: regardless of your/your team's level of JavaScript expertise, Node.js empowers you to kick-start your project, to get it up and running in no time; it's developer productivity-oriented (just think same language for both back-end and front-end!!!), with a low learning curve    2. What is Node.js Used for? 7 Great Use Cases Now back to the very question that started this post: “What exactly is Node.js good/used for?” There are specific app projects that this server-side JavaScript technology makes the best choice for: 2.1. Chat servers And generally speaking any type of fast-upload system challenged to respond, in real-time, to an “avalanche” of incoming requests. 2.2. Real-time apps  This is the use case that Node.js “rocks at”. Where you get to make the most of its capabilities. Apps geared at processing high volumes of short messages, where low latency becomes critical, make the best possible answer to your “what is Node.js used for?” question. Here's why:   it enables sharing and reusing Node.js packages that store library code it processes ideally fast: quick data sync between the client and server it's perfectly “equipped” to cope with multiple client requests   In short: if scalability and real-time data processing are 2 critical factors to consider when choosing the best technology for your project, think Node.js! It's built to suit specifically those situations that are “overly demanding” of our servers. 2.3. Video conference apps  ...applications using VoIP or specific hardware.  Projects involving intense data streaming — audio and video files — make the best use cases for Node.js. 2.4. Instant-messaging, live-chat apps  2.5. Highly scalable apps Think Trello or Uber-alike apps, that depend on a server-side server technology enabling them to scale out on multi-CPU servers. Node.js, thanks to its cluster-based architecture, will always make the best choice for apps depending on a technology that would spread out the load across a multi-core server. Note: speaking of scalability requirements, should I also mention that Node.js is... conveniently lightweight, too? 2.6. eCommerce transaction software and online gaming apps “What is Node.js used for?”  For powering apps for which online data is of critical importance. Like these 2 examples here! 2.7. Server-side applications  Being an event-driven model of programming, the flow is determined by messages, user actions, and other specific events of this kind.   3. Afterword Does this clear the picture for you a bit more?  As a conclusion or “final” answer to your “what is Node.js used for?” type of dilemma, the key takeaway from this post here is that: Node.js is used primarily for web applications, but it's starting to get used more and more often for developing enterprise apps, too, thanks to its versatility. What does the future have in store for this increasingly (still) popular technology:   rising potential for Node.js to be used for building IoT solutions …. for “experimenting” with enterprise data more and more big names (adding to Netflix, IBM, Amazon, Uber, LinkedIn, etc.) choosing it over legacy languages such as Java or PHP   ... Read more
RADU SIMILEANU / May 10'2018
Reservoir or Decoupling Drupal Made Easy for Anyone: Non-Drupal Developers and Editors
Here's how the ideal decoupling Drupal scenario looks like: Stripping Drupal to its essential role, that of a robust and flexible content repository, no Drupal expertise needed. Then using it to back your front-end with; one that you'd be free to build by leveraging any modern (JavaScript) technology of your choice. … a Drupal back-end content store that would still preserve all its content editing and managing functionalities, needless to add. Luckily, this is no longer “daydreaming”. Not since Reservoir, the headless Drupal distribution, has been available.  Here are some of its “promises” or well-known challenges, if you prefer, that this distribution's geared at solving:   to make Drupal far more accessible (cutting the intimidating Drupal setting up and configuration out of the equation) to developers of all stripes   to empower developers with all the best practices for building their Drupal-backed front-ends quick and easy   to provide an opinionated starting point enabling any developer to build a Drupal content repository backing his non-Drupal application with... no Drupal knowledge needed, actually   Your Current Situation: Why Would You (Even) Consider “Headless” Drupal? Here you are now, dealing with the pressure of:   having to deliver content agnostically across any given channel and device: single-page JS apps, mobile apps, digital signage, AR and VR-driven content, IoT apps etc...   … all while storing it (content) in one single place    providing your editorial team with a... way to edit, manage and overall administrate content conveniently easy, via an editor-friendly UI   … independently of the development team, of course   finding a way to enable your developers to easily send content across this entire “ecosystem” of channels, devices and platforms   In other words: you're grappling with the challenge of making Drupal ideally accessible to your (non-Drupal) developers; so they can easily build their Drupal-based content store enabling them to deliver content to any given device. … to serve it to any given app/site. And this definitely calls for a decoupling Drupal approach.   Decoupling Drupal: The Most Discouraging Challenges You Must Be Facing  Let's assume that you're already considering headless Drupal as a solution for your current challenge, that of delivering content to multiple channels, devices, platforms. Whether you're planning to decouple Drupal for:   building a Drupal-backed front-end, leveraging one of your modern JavaScript frameworks of choice or using it as a content store for your non-Drupal app   Then, it's these specific challenges that you must be facing right now:   your non-Drupal developers are having trouble maneuvering Drupal content; they're not familiar with all the dials and knobs needed for making the most of Drupal's REST API  Drupal's serialization format is... alien to them  there's no starting point or well-defined best practices for non-Drupalists, that would ease their way to turning Drupal into a content repository … one that they could back their front-ends with   True story! And still, there is hope...   5 Reasons For Being “Skeptical” About Distributions You must be legitimately cautious right now when it comes to using an API-first distribution for Drupal. And that's due to some bad experiences with... distributions. Now let me try and guess some of your “fears” regarding Reservoir:   that it might turn out to be overly complex  that you risk getting “stuck with” architectural debt that its maintainers might someday lose interest in it that it's built primarily for other use cases, for scenarios different from your own decoupled Drupal implementation project that you risk “inheriting” bugs in features that you haven't even used    And the list of reasons why you're not yet jumping on this decoupling Drupal trend could go on...   Introducing Reservoir: The Headless Drupal 8 Distribution! How Is It Different? Before putting it into the spotlight and giving it a “full scan”, let me try to read your mind and identify the questions that you must be asking yourself right now:   “How precisely do I use Reservoir as a content store backing my front-end website or app?”   “Which are the bare essential Drupal modules and core functionality that this distribution comes packed with?”   “How can I leverage these ready-to-use components for decoupling Drupal?”   And now that we've put your valid queries into words, let me try and define Reservoir for you:   1st definition: a distribution for decoupling Drupal   2nd definition: an ideally flexible and minimalist tool empowering developers of all backgrounds to build content repositories for their apps to “consume”   3rd definition: the headless Drupal 8 distribution “specialized” in manipulating content and interacting with it via HTTP APIs   4th definition: a Drupal-based content store with all the web service APIs backed into, so that any developer can jump straight to building his front-end app   5th definition: simply a... content repository; one that just happens to be Drupal-based, as the Reservoir project's maintainers admitted.   Now the 4 key goals behind this distribution for decoupling Drupal —  besides that of providing a simple way of building a content repository enabling you to use any technology for your front-end —  are:   on-boarding developers or all stripes, making Drupal ideally accessible to... anyone providing a much-needed opinionated starting point for any type of decoupled Drupal implementation; no Drupal knowledge required  keeping itself away from the scope creep that end-user facing products risk falling into serving a specific decoupled use case   Decoupling Drupal Made Easy & Accessible: Key Reservoir Features  “But how does Reservoir make building Drupal-based content repositories so much easier than other... distributions?”  “How precisely does it make Drupal accessible to non-Drupal developers, as well?” You're more than entitled to ask yourself that... Therefore, let me outline here the out-of-the-box Reservoir features geared at speeding up any decoupled Drupal implementation. Regardless of the developer's background:   an opinionated selection of API-first/ web services modules — Reservoir offers each developer a much-needed starting point/”push” so that he can ramp up and have his content stores built in no time: Simple OAuth modules here included   quick and easy access to the content back-end via JSON API    auto-generated documentation (API documentation), that gets automatically updated, as well, as you're browsing it, as your content model changes   OpenAPI format export, that supports hundreds of tools integrating with the OpenAPI specification    easy-boarding/tailored UI —  expect a “welcoming tour” once you've installed Reservoir, one focused on getting you familiar with modeling and managing content, web service APIs, mapping out new content models etc.   a permission system and content editing UI empowering your editorial team to easily manage content    SDKs, libraries and references —  included in the Waterwheel ecosystem —  so that your development team can skip the time-consuming API learning phase and jump straight to “attaching” Drupal back-end content to their front-end apps   Note: Reservoir, the distribution for decoupling Drupal, deliberately shakes off some of Drupal's functionality that's irrelevant for content repositories (modules such as Breakpoint, Views, Content, the user-facing front-end etc.) For we couldn't even talk about speeding up your decoupled Drupal project when there's an unnecessarily heavy weight of Drupal modules and features “dragging down” the whole implementation process, right?   Wrapping Up: What Reservoir Aims At Is... ... enabling your developers to jumpstart building self-hosted content repositories capable to serve any given front-ends. Front-ends that they get to build independently, tapping into the technologies they prefer, on a project-by-project basis. Pretty convenient, don't you agree?  ... Read more
Adrian Ababei / May 09'2018
How to Scale Your Node.js App: Best Strategies and Built-In Tools for Scalability 
Whether it's the increasingly challenging workload or you simply want to enhance your Node.js app's tolerance to failure and availability, there comes a time when you just need to scale it up, right? To “squeeze” the best performance out of your entire infrastructure of... nodes. Well then, here's how to scale your Node.js app: And scaling up your web back-end app at different levels —  overall improving its throughout — sure isn't an afterthought with Node.js: Scalability is built in the very core of the runtime. And the infrastructure of nodes, strategically distributed, communicating with each other, is what makes this framework particularly scalable. So, what is the best way to scale up your Node.js app? Which are the most powerful built-in tools for scalability to explore and to “exploit”? And what are the best strategies to go for depending on your specific scenario and scalable architecture needs?   Horizontally Scaling Your Node.js App  Horizontal scaling comes down to... duplicating: Basically, you duplicate your application instance, enabling it to “cope with” a larger number of incoming connections. Note: you can horizontally scale your Node.js app either across different machines or on a single multi-core machine. A word of caution: do keep in mind, though, that this scaling solution might add up unnecessary complexity to your app's infrastructure; it might entail the need to provision and to maintain a load balancer, might make troubleshooting more challenging, and even change the way you deploy your app. That being said: make sure that it's specifically this Node.js scaling solution that your project needs before you go ahead and implement it!   Vertical Scaling If your scalability architecture needs involve nothing more than:   injecting more power  adding more memory   … with no particular “tweaking” applied to the code, then vertical scaling might just be the right answer to the “how to scale your Node.js app” dilemma. Here's why:   by default, Node won't use more than 1.76GB of 64-bit machines' memory in case of a 32GB of RAM machine, for instance, the Node process will limit itself to only a fraction of its memory   Have Multiple Processes Running on The Same Machine Here's another possible answer to your “How to Scale your Node.js app” question: Have multiple processes running on the same port. It goes without saying that this scaling solution calls for some kind of internal load balancing that would distribute the incoming connections across the entire ecosystem of cores/processes. Word of caution! Not sure whether there's any need to add this: keep the number of running processes lower than that of the cores! Hereinafter, let's focus on 2 Node.js built-in tools for scalability that you might want to tap into:   The Cluster Module  Node's cluster module makes a great starter for scaling up your application on a single machine. How does it work precisely? It makes setting up child processes sharing server ports conveniently easy.  Practically, one “master” process will be in charge with spawning all the child processes (and there's one “worker” for each core), those that actually run your Node.js app. Feel free to dig here into more details on the whole process.  Yet, there are certain limitations to this basic scaling solution:   in case one of your child processes “dies”, it doesn't... regenerate itself you'll need to handle the master-worker processes difference... the “old school way”, using an “if-else” block there's no way of modifying multiple processes, at once, on-the-fly!   Note: yet, when it comes to the “dead child processes” drawback, there's... hope. For instance, use this piece of code that would enable the master process to... respawn the “worker”: cluster.on('exit', (worker, code, signal) => { cluster.fork(); }); And voila! This drawback has been taken off your list!    The PM2 Cluster Module Using the PM2 cluster module, “how to scale your Node.js app” dilemma turns into: “Lay back and let the PM2... clusterfy your server for you!” All you need to do is “trigger” this command's superpower: pm2 start app.js -i 4 –name="api" It will instantly create a 4-node cluster for you! Now, here are some more details about what's going on “under the hood” during this process:   the PM2 daemon will take over the ex “master process'” role and spawn N processes (the former “worker processes”) while relying on round-robin balancing moreover, if it's PM2 process manager that you're using, your process gets automatically scaled across all the existing cores (no need to trigger the cluster module for that anymore) also, the same PM2 process manager will ensure that processes restart, instantly, if they happen to crash   You'll just need to write your Node.js app as if it were for single-core usage and the PM2 module will make sure that it gets scaled for multi-core. Note: now if you want to scale your Node.js application further, you might want to consider deploying more machines...    Scaling Across Multiple Machines with Network Load Balancing The underlying process is more than similar to the “multiple core scaling” one, if you come to think of it: Instead of several cores, you'll have several machines; each one will be running one or more processes and will get “backed up” by a load balancer redirecting traffic to each machine in this infrastructure. “And how does a network balancer work, more precisely?” you might ask yourself: Once a request is sent to a node, the balancer sends the traffic to a specific process. And there are 2 ways of deploying your internal balancer:   deploy a machine and set up a network balancer yourself, using NGINX use a managed load balancer (like Elastic Load Balancer); setting it up is conveniently easy and it “spoils” you with all kinds of built-in features, such as auto-scaling   Now if your “How to scale your Node.js app” question turns into a “Isn't it risky to have just one point of failure for my infrastructure?": Just deploy multiple load balancers instead of relying on a single balancer.  They would be all pointing to the same servers, needless to add. Note: for distributing traffic across your “ecosystem” of internal balancers, you could just add several DNS “A” records to your main domain.   How to Scale Your Node.js App: 3 Scaling Strategies to Consider 1. Decomposing “Microservice” is another word for this scaling strategy. For practically you'll be “juggling” with multiple microservices (although their size is of no significant importance, actually). Or multiple applications, with different codebases (and in many cases, each one of them has its own UI and dedicated database). And it's by services and functionalities that you'll be decomposing/scaling your Node.js app. A strategy that can lead to unexpected issues in the long run, but which, if implemented correctly, translates into clear gains for your apps' performance.   2. Splitting Or “horizontal partitioning” or “sharding”, if you prefer. This strategy involves splitting your app into multiple instances, each one responsible for a single, specific part of your app's data! Word of caution: data partitioning calls for a lookup before you carry out each operation; this way you'll identify the right instance of the application to be used. Take this example here: You might want to partition your Node.js app's users by language or area of interest. In this case, a lookup step is a must; you'll need to check that information, first things first.   3. Cloning And this is the easiest strategy at hand for solving your “How to scale your Node.js app” dilemma! Just clone your Node.js back-end application, multiple times, and assign a specific part of the workload to each cloned instance! It's both effective and cost-effective! Moreover, Node's cluster module makes cloning on a single server ideally easy to implement! And this is “How to scale your Node.js app”! See? You have not just one, but several Node.js built-in tools at hand and various strategies to choose from, depending on your scaling needs. Which scaling solution suits you/your app project best? ... Read more
RADU SIMILEANU / May 03'2018