How to find a Meteor Mastermind Group

The answer is easy: just ask!

That is what I did 9 days ago in the Meteor Forum and some days later I found myself with a great Mentor and 4 other learning Padawans in a Slack channel.

Our first Meetup we organised via Google Hangouts was a great experience meeting for one of my first times other coding oriented people. I am not having the “normal” coder CV as I studied Economics and tried to learn coding myself the last years. I played around with Meteor the last 6 months and felt stuck with advanced stuff in the last weeks.

In the first 10 minutes we introduced ourself and thanks to our Mentor Serkan, we had a great Q&A Session in the next 50 minutes.

What did we learn in the first Session?

  • First of all take care of the infrastructure, find someone who make notes and someone who record the video. This is a great way to help your group to remember things and to contribute to the Meteor Community by publishing it for others.
  • My opinion: Keep the group small with 3–6 people per one Mentor so you have enough time for everyone.
  • Have one person to be the moderator while video chatting

… and technically? A lot.

  1. How to manage Uploads (the example was profil pictures) in Meteor?

2. How to create a chat application

  • Chat is different in the sense that persisting messages on the db and using collections to get the messages across can be intensive on the server
  • use the streams approach that’s discussed by arunoda and implemented by rocket chat
  • From my understanding you need to decide at the begining if you want to have the chat saved in the MongodB (have history) or not. I will try to work on the chat this week and study the Rocket Chat approach.

3. How to start a new meteor app, what to use?

  • Don’t get caught up in the distractions, there will be a tech of the day every coming year
  • Follow the official meteor guide, the topics and patterns are relevant to all those stacks
  • Choose the right tools for the right job. Atmosphere has great forms and tables packages, so a line of business app can benefit from blaze more than it can benefit from react where a game-like interface packed full of “components” may do better off with react
  • Mongodb is not a bad database. database programming existed 50 years ago where there was no such thing as acid and developers had to implement those paradigms within the app itself, use those ideas on top of mongodb

4. What are transactions and how to manage them

  • Transactions are not always needed, remember, right tools for the right job
  • A transaction is basically a series of database operations that need to happen all together or not at all
  • The problem is, if the server crashes in the middle, we need to “roll back”
  • Mongodb has a fairly sufficient “two phase commit” tutorial on its docs. It can be implemented as a strategy
  • A not-so-strictly-transactional approach where opt in rollbacks can be achieved would be to use the babrahams:transactions package
  • Yes, transactions are somewhat similar to how redux operates

5. How to manage mobile connections where an app consists of a backend and a mobile ui, how to ddp.connect?

  • Meteor docs is your friend, read the raw docs
  • Packages that wrap ddp for better mobile experiences are good but you should first understand how the raw api works and then opt in to use a package when you do actually know what problem it solves and that it is relevant in your use case
  • Meteor 1.3 is on its way packed full of new mobile features like the new wkwebview and better hot code push
  • Ddp is not only choice, you can rely on mongodb to communicate over from your backend to your mobile ui
  • Use packages and the upcoming imports to structure out common pieces like database access and server side methods so that you can use them in separate apps
  • Ddp is not only relevant to mobile, think about microservices
  • You can always separate out aand independently scale parts of your app depending on their specific resource requirements

After our Class I watched some Videos on that and I think this one from Martijn Walrave helps a lot: DDP Video.

6. How to structure and query data that involves embedded array of objects

  • Avoid if you can
  • Read the mongodb official docs, it has great examples
  • Read through the array and positional operators
  • Updating a nested object in an array by its index may unfortunately require reading the whole object and replacing the whole array

The next topic is really interesting as Deployment is a big topic for everyone it was great to get some experience from Serkan about his best practise:

7. How to scale and automate (digital ocean) deployments, autoscale jenkins deployments with mup? Is it possible? What are alternatives?

  • Galaxy is by far the best alternative, it not only autoscales, but makes sure it rolls over connections when instances get killed
  • Phusion Passenger is a strong contender and Serkan has good outcomes with it
  • mupx and cluster can be used, but there’s not much literature around for “autoscaling”, perhaps the digital ocean api can be used to help

I will also check Amazon’s Services if they include Auto Scaling.

8. What about scaling to 50 million users

  • That means your business has picked up and you have a lot of money and dedicated devops engineers as well as a vast array of tech stacks at your disposal

9. What to do if we have a static landing page and we get exposure on hn? Every hit on that landing pagemeans an open websockets connection, what to do? Kill the connection manually?

  • It is not a good idea to do such hacks since the user will require that connection to proceed anyway
  • Use a static web server to serve that landing page, place the app on a sub directory and configure url rewriting on the web server. It may look daunting, but it is the right way

What comes next?

  • We fixed the infrastructure and we now will have full Video Sessions of our Meetups at Youtube (live and ondemand)
  • We will start a Mentoring / Management APP to work on and get practise in Meteor
  • We will have more Q&A Sessions
  • We will try to connect people with other Mentors so they can form a group and we share our infrastructure and learnings.
  • Checkout the Meteor Forum Post to our Group

A big thanks and credits go to Serkan who helped me with his notes to this post and guided us through our first Meteor Mastermind Session.