background preloader

Meteor

Facebook Twitter

Large Meteor projects - best practices. High-Level Guide to Scaling Meteor. The first and highest-impact place to optimize is in softwareland: Mongo schema design, indexing, and oplogSubscription and query design (also try to avoid types of queries that use the polling driver) For server architecture, place at the front a SockJS-safe, sticky-session load balancer that distributes connections to app servers based on least connections.

High-Level Guide to Scaling Meteor

On the application servers: CPU: Run an instance of meteor for each CPU core, since node is single-threaded. Memory: Meteor’s MergeBox is keeping on the server a copy of each client’s client-specific subscription data, so make as many publications as you can general-purpose (as in, they return the same data for all users or a group of users, rather than different data for each user). A floor for your per-client memory usage is how much additional memory your publications take up when another user connects. However, in Arunoda’s experience, CPU is more often the bottleneck than memory. Kudos.

CLI, boilerplate, scaffolding

Meteor Toys. Meteor.js Iron Router Filters, Before and After Hooks. Introduction The Meteor.js Iron Router is the one package that helps me so much and is the first one I add in every application.

Meteor.js Iron Router Filters, Before and After Hooks

If you do not know the Iron-Router make sure to learn how to use it because it realy helps so much! The Iron Router basically decides what to render for the current Route (URL). Also do not think that you are building a so called one-page app and you do not need urls. You always need urls (e.g. share a state, bookmarking). What are Iron Router Hooks? The Iron Router basically works like this: A new route is calledThe Iron Router checks if there are before hooks and runs them allIf all before hooks are done and ready the rendering takes placeNow the after hooks are all run That means we can create functions that are run before any route and this is amazing if you for example want to filter a route to be only for logged in users. The Meteor Chef. Awatson1978/meteor-cookbook. Ericdouglas/Meteor-Learning. App from scratch. Last updated 06 May 2015 A meteor hitting our planet and killing everyone Please note that this tutorial is in Coffeescript.

App from scratch

If you prefer Javascript you can read my new Meteor book here (free to read online - and available as PDF/mobi etc for a fee). In this tutorial we're going to build a simple app that allows you to record the scores of your foosball matches (you play foosball at work right?). Current chapters: Build Fast & Efficient Meteor apps. Documentation - Meteor. Meteor is an ultra-simple environment for building modern websites.

Documentation - Meteor

What once took weeks, even with the best tools, now takes hours with Meteor. The web was originally designed to work in the same way that mainframes worked in the 70s. The application server rendered a screen and sent it over the network to a dumb terminal. Whenever the user did anything, that server rerendered a whole new screen. This model served the Web well for over a decade. But the best teams, with the biggest budgets and the longest schedules, now build applications in JavaScript that run on the client. They've built them the hard way. Quick start! Meteor supports OS X, Windows, and Linux. On Windows? On OS X or Linux? Curl | sh The Windows installer supports Windows 7, Windows 8.1, Windows Server 2008, and Windows Server 2012. Once you've installed Meteor, create a project: meteor create myapp Run it locally: cd myapp meteor Unleash it on the world (on a free server we provide): Main Page - Meteorpedia.

Deploy

Oplog. Tutorials. Packages. Tips, tricks, stackoverflow. Apps. Blaze: easy reactive templating. Extremely easy to use With Blaze, you can write your app with normal-looking templates in the language of your choice.

Blaze: easy reactive templating

You don't need to declare dependencies or write any code to manage how the screen updates: it's all automatic. High performance When your data changes, Blaze makes the smallest possible update to just the piece of the DOM that needs to change or move and batches those updates to minimize page reflows. Since most apps only update a few pieces of data at a time, this approach leads to very efficient updates.

Works well with other libraries Since Blaze only makes the smallest possible updates to the DOM, apps written with Blaze can take advantage of jQuery plugins or other JavaScript libraries that modify elements in your app — including the same elements managed by Blaze. The following examples show how to use Blaze in your apps. Simplest data bindings You spent 1 seconds on this page. You spent <b>{{seconds}}</b> seconds on this page. Use reactive variables in your code Contacts. Hackpad - meteor.