Never heard of the JAMStack? Maybe not directly – but if you are doing web dev you have for sure heard of some of the players in this field, like Jekyll, Hugo, Jigsaw or GatsbyJS just to name a few.

Indeed monoliths CMS like WordPress or Drupal (just to name these two but Wikipedia list easily a few dozen of major players across all stacks and companies) are often being criticised for being slow at scale or hard to customise and the overhead of growing beyond a certain point start to become ROI negative due to the heavy lifting you need to deploy to get the CMS to do what you want.

This has driven the development of a new approach based on integrating loosely coupled piece of software to generate a new philosophy around Content Management.

The JAMstack is defined as a modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup.

It’s basically javascript deployed to integrate Static Generators with headless CMS – this open the doors an entirely new way to think about content management which can get especially complex in large organisations where legacy software and internal politics can create some challenges hard to solve with a monolith CMS.

#1 – Rise of the JAMstack — Mathias Biillman

Our first speaker is Mathias Biillman and he works at Netlify, a company who also maintain the open source product Netlify CMS – open-source React app that acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API.

#2 – Git-based or API-driven CMS – Chris Macrae

Second talk which is longer but also go deeper into the various considerations of static sites and the JAMstack.

Also from the same company you have an other talk that goes over the general landscape of the JAMStack : check it out here.

#3 – Future of the CMS, 2017 Edition

Todd Ross Nienkerk from Four Kitchens takes a deep dive into the content aspect of content management and how content is changing faster than traditional CMSs

Kyle Mathews: GatsbyJS — How to Create The Fastest Sites In The World — ReactNext 2017

Building A Website Using Hugo

Hugo is a Go engine for static site generation. Here is a demo on a small project.

That’s it! (That’s also close to 3h of content to watch so that’s probably enough to get you started).

I am going to go deeper on GatsbyJS as it answer some of my needs for various projects I am working on. Will update.

What is it?

source code on github

From the website :

SRS delivers rtmp/hls/http/hds live on x86/x64/arm/mips linux/osx, supports origin/edge/vhost and transcode/ingest and dvr/forward and http-api/http-callback/reload, introduces tracable session-oriented log, exports client srs-librtmp, with stream caster to push MPEGTS-over-UDP/RTSP to SRS, provides EN/CN wiki and the most simple architecture.

Basically it is a simple way to set up and get going with an RTMP server.

How to Create an SRS Server

I obsviously still need to test it live. But this looks like a nice option.
Alternative is to go with Nginx as a server like for example in this demo.

I haven’t made my mind yet which is the best option to go with.
I’d tend to say Nginx is more robust … but maybe just because of the brand and actual SRS is as good and maybe simple to manage… dunno yet…

Some research I have made recently while working on a broadcasting module of an app.
Just saving here some of the best link I have found – as backup and maybe of interest for some people.

Obviously if you are looking for a super structured article – I am far from it at this point – but that’s still the filtered version of a few hours of research to find the relevant and usable stuff – and it is practically what I have used to get to the point of a transcoding version of ffmpeg with facebook live (next step is to turn it into a nodejs microservice)

Setting up a RTMP server

Getting started with nginx-rtmp-module: a FOSS alternative to Wowza, FMS, et al.

How to set up your own private RTMP server using Nginx/

Streaming Video on Demand with nginx and RTMP Module

Facebook Live with nodejs

https://stackoverflow.com/questions/38027059/live-video-facebook-api-with-ffmpeg-nodejs

https://stackoverflow.com/questions/42803724/live-video-stream-on-a-node-js-server

FFmpeg to facebook live

https://stackoverflow.com/questions/40644596/using-ffmpeg-to-stream-to-facebook-live-video-can-preview-but-not-go-live

https://stackoverflow.com/questions/38994744/how-to-live-stream-on-facebook-via-ffmpeg

FFMPEG

http://keycorner.org/pub/text/doc/ffmpeg-tutorial.htm

https://videoblerg.wordpress.com/2017/11/10/ffmpeg-and-how-to-use-it-wrong/

http://www.squarebox.com/transcoding-with-ffmpeg/

https://trac.ffmpeg.org/wiki/EncodingForStreamingSites

https://stackoverflow.com/questions/19774975/unknown-encoder-libfaac

Cicada 3301 is an organization who used puzzles to possibly recruit codebreakers/linguists from the public.

The first internet puzzle started on January 4, 2012, and ran for approximately one month.

A second round began one year later on January 4, 2013, and a third round following the confirmation of a fresh clue posted on Twitter on January 4, 2014.

MongoDB Schema Design – Many small documents or fewer large documents?

Source : Stackoverflow

Modeling One-to-Few

An example of “one-to-few” might be the addresses for a person. This is a good use case for embedding – you’d put the addresses in an array inside of your Person object.

One-to-Many

An example of “one-to-many” might be parts for a product in a replacement parts ordering system. Each product may have up to several hundred replacement parts, but never more than a couple thousand or so. This is a good use case for referencing – you’d put the ObjectIDs of the parts in an array in product document.

One-to-Squillions

An example of “one-to-squillions” might be an event logging system that collects log messages for different machines. Any given host could generate enough messages to overflow the 16 MB document size, even if all you stored in the array was the ObjectID. This is the classic use case for “parent-referencing” – you’d have a document for the host, and then store the ObjectID of the host in the documents for the log messages.

How should I implement this schema in MongoDB?

User:
   username_name: string

Campaign:
   title: string
   description: string
   link: string

UserCampaign:
   user_id: integer
   camp_id: integer

Click:
   os: text
   referer: text
   camp_id: integer
   user_id: integer

(Source)

MongoDB relationships: embed or reference?

(source)

  • Put as much in as possible

    The joy of a Document database is that it eliminates lots of Joins. Your first instinct should be to place as much in a single document as you can. Because MongoDB documents have structure, and because you can efficiently query within that structure (this means that you can take the part of the document that you need, so document size shouldn’t worry you much) there is no immediate need to normalize data like you would in SQL. In particular any data that is not useful apart from its parent document should be part of the same document.

  • Separate data that can be referred to from multiple places into its own collection.

    This is not so much a “storage space” issue as it is a “data consistency” issue. If many records will refer to the same data it is more efficient and less error prone to update a single record and keep references to it in other places.

  • Document size considerations

    MongoDB imposes a 4MB (16MB with 1.8) size limit on a single document. In a world of GB of data this sounds small, but it is also 30 thousand tweets or 250 typical Stack Overflow answers or 20 flicker photos. On the other hand, this is far more information than one might want to present at one time on a typical web page. First consider what will make your queries easier. In many cases concern about document sizes will be premature optimization.

  • Complex data structures:

    MongoDB can store arbitrary deep nested data structures, but cannot search them efficiently. If your data forms a tree, forest or graph, you effectively need to store each node and its edges in a separate document. (Note that there are data stores specifically designed for this type of data that one should consider as well)

    It has also been pointed out than it is impossible to return a subset of elements in a document. If you need to pick-and-choose a few bits of each document, it will be easier to separate them out.

  • Data Consistency

    MongoDB makes a trade off between efficiency and consistency. The rule is changes to a single document are always atomic, while updates to multiple documents should never be assumed to be atomic. There is also no way to “lock” a record on the server (you can build this into the client’s logic using for example a “lock” field). When you design your schema consider how you will keep your data consistent. Generally, the more that you keep in a document the better.

Mongo schema design (Youtube playlist)