title: Back end based on Microservices - concept
body: <p>I plan to build a back end based on microservices. The following picture presents my current idea:</p>
  
  <p><a href="https://i.stack.imgur.com/pFFm8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pFFm8.png" alt="enter image description here"></a></p>
  
  <p>Two important features are:</p>
  
  <ul>
  <li>uploading large text and/or video files</li>
  <li>stream video - display user in web app and native mobile applications</li>
  </ul>
  
  <p>The tech-stack is not finally set, but initially I think about:</p>
  
  <ul>
  <li>web app - ReactJs / Angular</li>
  <li>backend apps - Ruby on Rails</li>
  </ul>
  
  <p>I have following doubts for my current concept:</p>
  
  <ol>
  <li>Should API Gateway work as a router, which redirects requests from users to specific microservices? Or... should it be a dedicated App (eg. Ruby on Rails App) with API?</li>
  <li>How to make Authorization? Should I use separate microservice for this? Let's say that user uploads file and his request should go to third microservice: "Big Data Upload". Where and when I should authorize his access? In that microservice or earlier in API Gateway? Or maybe authentication should be also done in "Authentication microservice"?</li>
  <li>Uploading large files - let's say that user want to transfer a large file (video or compressed text file with raw data) from mobile app to backend via HTTP. His request goes to API Gateway and then it is redirected to "Big Data Upload" microservice. App saves the file to the Object Storage. Is is right path for uploading files? Or I could make some shortcuts to make the file's route shorter?</li>
  <li>Video stream - when user upload video file, I would like to place it into Assets (Object Storage - eg. Amazon S3). Is it enough to present this video to users in web app or mobile app? (Beside the transcoder service and CDN)</li>
  <li>Load Balancing - Is it a reasonable to use load balancing to control flow to instances of microservices (on the picture between API Gateway and green microservices)? Or it's not a good approach because we can lost some information about request/recipient/user or even API Gateway would be more significant "bottleneck"?</li>
  <li>Does this concept of architecture have the good potential for easy scalability, in yours opinion? Of course, an omitting a hardware and software configuration.</li>
  </ol>