O'Reilly logo

Meteor Design Patterns by Marcelo Reyna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

External APIs

Now that we know how to secure our application, we need to understand how to keep external data sources up to date. There are two patterns that we can use to ensure that the information on our server is recent: synchronization and webhooks.

Synchronization

Synchronization will, basically, get data from our source continuously and refresh the database. This type of technique is useful when we need to save information from our data source and use that information to produce analytical data via the aggregation framework.

To keep our servers synchronized, we need to make sure that the process that fetches information does not block the server. We can ensure that this happens using nonblocking functions like Meteor.setInterval.

Let's synchronize ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required