Roberta  Ward

Roberta Ward

1596509040

How Sanoma Learning and MongoDB Atlas kept teaching as classes went virtual

Enterprise IT is awash in buzzwords: scalability, performance, responsiveness. If you worry about databases, you’ll have words like these etched on your eyeballs. Sometimes, though, they stop being words and become critical realities — not to be rolled out over months of planning and testing, but things that must work, if not this hour, then the next. And not just for your company, but for everyone who relies on you.

This is where Bingel, the online learning platform for primary education, found itself on Friday the 13th, March 2020, the day Belgium went into lockdown. Bingel, part of the leading pan-European Sanoma Learning group of educational technology companies, had been having a good few years until then. It had been the first to deploy — and was easily the leader in — interactive online learning for Belgian primary school children. It was expanding into neighboring territories. Its colorful, adaptive, thoroughly gamified experience of exercises proved very popular with children, parents and teachers alike. Growth was good — very good, with 1.5 million exercises completed daily.

Then came Friday the 13th. The Belgian government had looked at the data for the COVID-19 pandemic, and reached the only possible conclusion: shut down, go home, stay home. Suddenly, there were no classrooms to go to. For Belgium’s teachers, students and parents, they all went to the other familiar place they had come to trust and love over the past years, Bingel.

Becoming ‘critical infrastructure’

The company knew it had a role to play. Koen Rousseau, Digital Lead of Primary Education at Sanoma Learning, was leading the response. “Teachers had a million questions. We had to reach out and help. Over the weekend of the 14th and 15th, we opened up all our digital platforms, making everything freely available, reaching out to schools and saying, ‘We’re here, let’s do it together.’” By Sunday evening, there was nothing left to do but wait.

“Monday morning, 9 am, all hell broke loose,” says Rousseau. “We’d seen traffic skyrocketing since 8 am, but by 10 the first cracks started to appear. Parts of the system started to go down.”

One early sign came when his youngest daughter, who also had been using Bingel that morning, suddenly had trouble with the service and burst into the room yelling "Daddy, Bingel is broken, fix it! Rousseau knew he had to act quickly.

At first, the standard fallback procedure worked: “We switched it off and on again, and for a while it was running fine. Then at 1 pm it went down again.” Disk utilization reached saturation, with 12,000 queries per second and up to 96,000 connections. As the day progressed, the platform would crash three times. The magnitude of the problem — and the consequences — became clear. “I started to get calls from journalists. I once worked in the power industry, where I learned phrases like ‘critical infrastructure’ for things that, if you lose them, the nation’s in trouble. That afternoon, I realized that Bingel had become part of the nation’s critical infrastructure.” Rousseau needed a plan — and fast.

Fortunately, there was a plan. Not for this exactly, but the company had looked ahead to serving a lot more students. It just didn’t expect to have to do it overnight.

“We’d had a major crunch before, when we were much newer,” says Rousseau. “We’d started out with a very basic three-layer architecture, a front-end web server, some business logic and a plain relational database holding exercise resources.”

When the service was launched in 2011, there were low expectations. “We thought we were a bit too far into the future for our audience. It had so many new features, a digital currency to buy games, colorful islands you could leap between — it wasn’t like anything else.” But it turned out lots of children wanted the future to happen straight away. “Suddenly we had thousands upon thousands of children doing exercises at the same time, and the system couldn’t cope.”

#mongodb

What is GEEK

Buddha Community

How Sanoma Learning and MongoDB Atlas kept teaching as classes went virtual
Lawrence  Lesch

Lawrence Lesch

1662107520

Superdom: Better and Simpler ES6 DOM Manipulation

Superdom

You have dom. It has all the DOM virtually within it. Use that power:

// Fetch all the page links
let links = dom.a.href;

// Links open in a new tab
dom.a.target = '_blank';

Only for modern browsers

Getting started

Simply use the CDN via unpkg.com:

<script src="https://unpkg.com/superdom@1"></script>

Or use npm or bower:

npm|bower install superdom --save

Select

It always returns an array with the matched elements. Get all the elements that match the selector:

// Simple element selector into an array
let allLinks = dom.a;

// Loop straight on the selection
dom.a.forEach(link => { ... });

// Combined selector
let importantLinks = dom['a.important'];

There are also some predetermined elements, such as id, class and attr:

// Select HTML Elements by id:
let main = dom.id.main;

// by class:
let buttons = dom.class.button;

// or by attribute:
let targeted = dom.attr.target;
let targeted = dom.attr['target="_blank"'];

Generate

Use it as a function or a tagged template literal to generate DOM fragments:

// Not a typo; tagged template literals
let link = dom`<a href="https://google.com/">Google</a>`;

// It is the same as
let link = dom('<a href="https://google.com/">Google</a>');

Delete elements

Delete a piece of the DOM

// Delete all of the elements with the class .google
delete dom.class.google;   // Is this an ad-block rule?

Attributes

You can easily manipulate attributes right from the dom node. There are some aliases that share the syntax of the attributes such as html and text (aliases for innerHTML and textContent). There are others that travel through the dom such as parent (alias for parentNode) and children. Finally, class behaves differently as explained below.

Get attributes

The fetching will always return an array with the element for each of the matched nodes (or undefined if not there):

// Retrieve all the urls from the page
let urls = dom.a.href;     // #attr-list
  // ['https://google.com', 'https://facebook.com/', ...]

// Get an array of the h2 contents (alias of innerHTML)
let h2s = dom.h2.html;     // #attr-alias
  // ['Level 2 header', 'Another level 2 header', ...]

// Get whether any of the attributes has the value "_blank"
let hasBlank = dom.class.cta.target._blank;    // #attr-value
  // true/false

You also use these:

  • html (alias of innerHTML): retrieve a list of the htmls
  • text (alias of textContent): retrieve a list of the htmls
  • parent (alias of parentNode): travel up one level
  • children: travel down one level

Set attributes

// Set target="_blank" to all links
dom.a.target = '_blank';     // #attr-set
dom.class.tableofcontents.html = `
  <ul class="tableofcontents">
    ${dom.h2.map(h2 => `
      <li>
        <a href="#${h2.id}">
          ${h2.innerHTML}
        </a>
      </li>
    `).join('')}
  </ul>
`;

Remove an attribute

To delete an attribute use the delete keyword:

// Remove all urls from the page
delete dom.a.href;

// Remove all ids
delete dom.a.id;

Classes

It provides an easy way to manipulate the classes.

Get classes

To retrieve whether a particular class is present or not:

// Get an array with true/false for a single class
let isTest = dom.a.class.test;     // #class-one

For a general method to retrieve all classes you can do:

// Get a list of the classes of each matched element
let arrays = dom.a.class;     // #class-arrays
  // [['important'], ['button', 'cta'], ...]

// If you want a plain list with all of the classes:
let flatten = dom.a.class._flat;     // #class-flat
  // ['important', 'button', 'cta', ...]

// And if you just want an string with space-separated classes:
let text = dom.a.class._text;     // #class-text
  // 'important button cta ...'

Add a class

// Add the class 'test' (different ways)
dom.a.class.test = true;    // #class-make-true
dom.a.class = 'test';       // #class-push

Remove a class

// Remove the class 'test'
dom.a.class.test = false;    // #class-make-false

Manipulate

Did we say it returns a simple array?

dom.a.forEach(link => link.innerHTML = 'I am a link');

But what an interesting array it is; indeed we are also proxy'ing it so you can manipulate its sub-elements straight from the selector:

// Replace all of the link's html with 'I am a link'
dom.a.html = 'I am a link';

Of course we might want to manipulate them dynamically depending on the current value. Just pass it a function:

// Append ' ^_^' to all of the links in the page
dom.a.html = html => html + ' ^_^';

// Same as this:
dom.a.forEach(link => link.innerHTML = link.innerHTML + ' ^_^');

Note: this won't work dom.a.html += ' ^_^'; for more than 1 match (for reasons)

Or get into genetics to manipulate the attributes:

dom.a.attr.target = '_blank';

// Only to external sites:
let isOwnPage = el => /^https?\:\/\/mypage\.com/.test(el.getAttribute('href'));
dom.a.attr.target = (prev, i, element) => isOwnPage(element) ? '' : '_blank';

Events

You can also handle and trigger events:

// Handle click events for all <a>
dom.a.on.click = e => ...;

// Trigger click event for all <a>
dom.a.trigger.click;

Testing

We are using Jest as a Grunt task for testing. Install Jest and run in the terminal:

grunt watch

Download Details:

Author: franciscop
Source Code: https://github.com/franciscop/superdom 
License: MIT license

#javascript #es6 #dom 

Roberta  Ward

Roberta Ward

1596512700

How Sanoma Learning and MongoDB Atlas kept teaching as classes went virtual

Enterprise IT is awash in buzzwords: scalability, performance, responsiveness. If you worry about databases, you’ll have words like these etched on your eyeballs. Sometimes, though, they stop being words and become critical realities — not to be rolled out over months of planning and testing, but things that must work, if not this hour, then the next. And not just for your company, but for everyone who relies on you.

This is where Bingel, the online learning platform for primary education, found itself on Friday the 13th, March 2020, the day Belgium went into lockdown. Bingel, part of the leading pan-European Sanoma Learning group of educational technology companies, had been having a good few years until then. It had been the first to deploy — and was easily the leader in — interactive online learning for Belgian primary school children. It was expanding into neighboring territories. Its colorful, adaptive, thoroughly gamified experience of exercises proved very popular with children, parents and teachers alike. Growth was good — very good, with 1.5 million exercises completed daily.

Then came Friday the 13th. The Belgian government had looked at the data for the COVID-19 pandemic, and reached the only possible conclusion: shut down, go home, stay home. Suddenly, there were no classrooms to go to. For Belgium’s teachers, students and parents, they all went to the other familiar place they had come to trust and love over the past years, Bingel.

Becoming ‘critical infrastructure’

The company knew it had a role to play. Koen Rousseau, Digital Lead of Primary Education at Sanoma Learning, was leading the response. “Teachers had a million questions. We had to reach out and help. Over the weekend of the 14th and 15th, we opened up all our digital platforms, making everything freely available, reaching out to schools and saying, ‘We’re here, let’s do it together.’” By Sunday evening, there was nothing left to do but wait.

“Monday morning, 9 am, all hell broke loose,” says Rousseau. “We’d seen traffic skyrocketing since 8 am, but by 10 the first cracks started to appear. Parts of the system started to go down.”

One early sign came when his youngest daughter, who also had been using Bingel that morning, suddenly had trouble with the service and burst into the room yelling "Daddy, Bingel is broken, fix it! Rousseau knew he had to act quickly.

At first, the standard fallback procedure worked: “We switched it off and on again, and for a while it was running fine. Then at 1 pm it went down again.” Disk utilization reached saturation, with 12,000 queries per second and up to 96,000 connections. As the day progressed, the platform would crash three times. The magnitude of the problem — and the consequences — became clear. “I started to get calls from journalists. I once worked in the power industry, where I learned phrases like ‘critical infrastructure’ for things that, if you lose them, the nation’s in trouble. That afternoon, I realized that Bingel had become part of the nation’s critical infrastructure.” Rousseau needed a plan — and fast.

Fortunately, there was a plan. Not for this exactly, but the company had looked ahead to serving a lot more students. It just didn’t expect to have to do it overnight.

“We’d had a major crunch before, when we were much newer,” says Rousseau. “We’d started out with a very basic three-layer architecture, a front-end web server, some business logic and a plain relational database holding exercise resources.”

When the service was launched in 2011, there were low expectations. “We thought we were a bit too far into the future for our audience. It had so many new features, a digital currency to buy games, colorful islands you could leap between — it wasn’t like anything else.” But it turned out lots of children wanted the future to happen straight away. “Suddenly we had thousands upon thousands of children doing exercises at the same time, and the system couldn’t cope.”

#mongodb

Roberta  Ward

Roberta Ward

1596509040

How Sanoma Learning and MongoDB Atlas kept teaching as classes went virtual

Enterprise IT is awash in buzzwords: scalability, performance, responsiveness. If you worry about databases, you’ll have words like these etched on your eyeballs. Sometimes, though, they stop being words and become critical realities — not to be rolled out over months of planning and testing, but things that must work, if not this hour, then the next. And not just for your company, but for everyone who relies on you.

This is where Bingel, the online learning platform for primary education, found itself on Friday the 13th, March 2020, the day Belgium went into lockdown. Bingel, part of the leading pan-European Sanoma Learning group of educational technology companies, had been having a good few years until then. It had been the first to deploy — and was easily the leader in — interactive online learning for Belgian primary school children. It was expanding into neighboring territories. Its colorful, adaptive, thoroughly gamified experience of exercises proved very popular with children, parents and teachers alike. Growth was good — very good, with 1.5 million exercises completed daily.

Then came Friday the 13th. The Belgian government had looked at the data for the COVID-19 pandemic, and reached the only possible conclusion: shut down, go home, stay home. Suddenly, there were no classrooms to go to. For Belgium’s teachers, students and parents, they all went to the other familiar place they had come to trust and love over the past years, Bingel.

Becoming ‘critical infrastructure’

The company knew it had a role to play. Koen Rousseau, Digital Lead of Primary Education at Sanoma Learning, was leading the response. “Teachers had a million questions. We had to reach out and help. Over the weekend of the 14th and 15th, we opened up all our digital platforms, making everything freely available, reaching out to schools and saying, ‘We’re here, let’s do it together.’” By Sunday evening, there was nothing left to do but wait.

“Monday morning, 9 am, all hell broke loose,” says Rousseau. “We’d seen traffic skyrocketing since 8 am, but by 10 the first cracks started to appear. Parts of the system started to go down.”

One early sign came when his youngest daughter, who also had been using Bingel that morning, suddenly had trouble with the service and burst into the room yelling "Daddy, Bingel is broken, fix it! Rousseau knew he had to act quickly.

At first, the standard fallback procedure worked: “We switched it off and on again, and for a while it was running fine. Then at 1 pm it went down again.” Disk utilization reached saturation, with 12,000 queries per second and up to 96,000 connections. As the day progressed, the platform would crash three times. The magnitude of the problem — and the consequences — became clear. “I started to get calls from journalists. I once worked in the power industry, where I learned phrases like ‘critical infrastructure’ for things that, if you lose them, the nation’s in trouble. That afternoon, I realized that Bingel had become part of the nation’s critical infrastructure.” Rousseau needed a plan — and fast.

Fortunately, there was a plan. Not for this exactly, but the company had looked ahead to serving a lot more students. It just didn’t expect to have to do it overnight.

“We’d had a major crunch before, when we were much newer,” says Rousseau. “We’d started out with a very basic three-layer architecture, a front-end web server, some business logic and a plain relational database holding exercise resources.”

When the service was launched in 2011, there were low expectations. “We thought we were a bit too far into the future for our audience. It had so many new features, a digital currency to buy games, colorful islands you could leap between — it wasn’t like anything else.” But it turned out lots of children wanted the future to happen straight away. “Suddenly we had thousands upon thousands of children doing exercises at the same time, and the system couldn’t cope.”

#mongodb

Ida  Nader

Ida Nader

1596505080

How Sanoma Learning and MongoDB Atlas Kept Teaching as Classes Went Virtual

For more information on Sanoma Learning and MongoDB Atlas, check out the article here: https://bit.ly/2DghRQq

Subscribe to MongoDB ►►► https://bit.ly/3bpg1Z1

Connect with MongoDB: Website: https://bit.ly/2LjtNBZ

#mongodb

Query of MongoDB | MongoDB Command | MongoDB | Asp.Net Core Mvc

https://youtu.be/FwUobnB5pv8

#mongodb tutorial #mongodb tutorial for beginners #mongodb database #mongodb with c# #mongodb with asp.net core #mongodb