Backend tech stack for React/React Native App - node.js

I am planning on building an application that I want to deploy both on web and mobile. I would like the logic of the application to work offline for the mobile app, but when reconnected to the internet it should sync with the database so that it is the same as if they were doing things offline.
The application will have users with data that they can share with other users - changes do not need to be shown in real-time.
Does anyone have recommendations on what database provider would be helpful for this, and what backend tech stack I should use so that the offline syncing works?

I'd go for either RealmDb or firebase. Depends on your needs.

Related

the path of backend service, database and push notification deployment for production

I have been involved lots of companies' production projects but I didn't build myself. I built a react native app. But I am really confused where I should store data, backend service and push notification also. Which platform can be wise chose to use all 3 of them. Backend rest service will be nodejs. Unfortunately, I spend my 1 year azure free trial. I need to first try my app performance and users should use my app also, then should be free for trial to some amount of time.
If you developed your app to be in container you can use k8s as a service from one of the providers.
All of the top cloud providers have a multitude of solutions so its up to your arch and funds to decided where to go with it.
I do not think anyone will be able to give you better answer then yourself as your know the intimate details of your architecture.

What's the best way to deploy a reactnative app?

I created a react native application with expo. and I use nodejs for backend.
my application is ready and works well locally. now i would like to deploy it and i would like to know what are the good methods to deploy it should i use docker kubernetes etc... if or what platforms would you recommend me.
thank you
Welcome to the stackoverflow community!
For frontend I would suggest deploying it to the google play on android, or app store on ios. But you would need to pay a fee of $99 per year to deploy apps to the apple app store.
If you would like to deploy to other platforms, try to deploy to the official stores, because official stores have more traffic and can be trusted by more people. Thus getting more customers or users to your app.
For backend I would use heroku to deploy my backend code, I have many projects on heroku and it works fine, also it has a free plan for hosting your app. But it's not just flowers and roses, heroku is quite hard to deal with and their service is not the best in my experiences. If you are looking for a enterprice way, I suggest google cloud or firebase, It may cost some money however the performance, the service and user interface is way better than heroku.
More information about heroku: https://heroku.com/
More information about google cloud: https://cloud.google.com
More information about firebase: https://firebase.google.com/
More information about how to deploy: https://docs.expo.dev/distribution/app-stores/
More information about Apple app store: https://developer.apple.com/programs/
More information about google play store: https://play.google.com/console/about/guides/releasewithconfidence/
Tutorials that may be useful:
https://www.youtube.com/watch?v=6IPr7oOugTs
https://www.youtube.com/watch?v=4D3X6Xl5c_Y
https://www.youtube.com/watch?v=oWK7kesoCQY
Hope this helps!
NOTE: I'm not sponsored by ANY of the companies above, and I'm just a regular human being on the internet.

Web API & Azure Mobile App, should I keep them separated?

I'm planning a project in which I have a windows service installed in on premise machines (about one hundred of them) which should keep in sync an online azure SQL db with the on premise ones (MS access, third party). That sync happens by calling a Web API.
I then have to build a mobile app which will be used by ~3k users that will access the synced data with Azure mobile app backend.
As for now I've started building a single mobile app backend project which serves both mobile app requests, and webapi2 requests used to sync data.
Furthermore I'll need to add queue/topic section to send realtime notifications from the app to on premise services.
My concern is if is it good practice to keep both "mobile app" and webapi2 in the same project, or should I separate them.
Any suggestion will be greatly appreciated.
Many thanks in advance!
You should, separate them. Based on your description, you should use the microservices architecture, you can read more about it in the links below.
Azure specific:
https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/microservices
https://learn.microsoft.com/en-us/azure/architecture/microservices/
In general:
https://microservices.io/patterns/microservices.html

Web Apps Azure High Traffic

I am using Azure Web Apps to host my website. The website is loaded from a native apps for iOS and Android. During normal days non peak time , the web is operating as expected. However, from time to time , we are going to push out notification via apns or google gcm and that will drive users back to the apps. From there, content will be loaded from the website which is hosted from the Azure Web Apps.
During this peak times where there are thousands of requests coming in, there will be very high degree of fallout which results in errors.
It is shown in the picture below .
Traffic of the web apps after the push notification blasts
I have make sure that the database will not have any bottleneck during the operation. We are using SQL from Azure as well.
From the new portal, we are using service tier 'S1' for the App Services.
Previously, when the apps are developed, Web Apps and Mobile Services are separate service which are now join to become App Services.
Is there anything I could adjust from the azure backend or there is something which I missed out to handle ? Currently , we are also making the instance to be auto scaling.
As in conclusion, during high concurrent requests rushing in, the web apps seems to stop responding.
I would propose to implement the retry logic if there is no such yet and troubleshoot using the different modes.
UPD:
There is a detailed "analyzing performance" official guidance here - https://azure.microsoft.com/en-us/documentation/articles/app-service-web-troubleshoot-performance-degradation/ .
The most simple way to understand (or just mitigate) if the issue if somehow related to the underlying backend (throttling etc) is to change the mode site is working in. In your case, it can be S or even P.
Next step, if we eliminate the possibility of the throttling/etc, is to implement the diagnostics. My favourite tool is Application Insights, there is New Relic and other great tools as well. There are good guidances i saw and used:
http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/building-real-world-cloud-apps-with-windows-azure/monitoring-and-telemetry
https://github.com/mspnp/performance-optimization/blob/master/Assessing-System-Performance-Against-KPI.md#insertlink#
So, there is not silver answer about your question - highload is highload :-) Without access to the sources and website, and load tests results it is difficult to say what component of the project behaves itself bad.
If that is the helpful answer, please mark it as a helpful or as the answer. Thanks!

Azure Mobile App malfunctioning after migration

A couple weeks back our Mobile App was migrated from the old portal to the new one and it hasn't behaved properly since.
Our main issues are:
We cannot access any logs files, the tab for Diagnostics logs stopped working entirely on Wednesday but even before that we never got any useful data out of this. When something goes wrong with our nodejs backend we can't find any clue as to what went wrong like we could in our old portal under the logs tab.
We are unable to access the FTP server entirely, it just won't let us login even though the credentials are correct and have been reset multiple times in attempts to get them working.
The server is throwing errors about not having enough disk space left even though we should have 53Gb to go (we're currently using 1.05Gb out of 55Gb)
Our deployments slots are not working at all, when we push our code to the deployment slot it just doesn't work, every request we make to the deployment slots tells us we're not allowed to do anything.
We are running a standard tier Mobile App server. The backend is in NodeJS, our CMS is in ASP.Net and our app itself is in Xamarin Forms.
The issues started after we migrated the server a couple weeks back from the manage.azure.com portal to portal.azure.com.
What can we do?
Edit:
We got through to Microsoft via the payed support plan which we're getting refunded because these are basic functionalities which don't work as advertised after the migration. I've got a call with them in about three hours to get things sorted, if I learn anything we can do ourselves I will update this post to share the knowledge.
This needs to be a support request to Microsoft.
If you can, open an incident with Microsoft Support. If you can't, post a question in the MSDN Community Forum. (We need to ask about particulars of your site and that isn't an appropriate topic for SO)
As the architecture of Mobile Apps is changed from Mobile Services, now the mobile apps migrate to Azure App Services.
Actually the Mobile Apps backend in Node.js is an expressjs project, and the mobile app sdk for node is a middleware of express. So the way for diagnostics and troubleshooting has changed from before we use Mobile Service. You can refer to https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-node-backend-how-to-use-server-sdk/#Debugging for details about Debugging and troubleshooting for mobile services.
Additionally, we can leverage the Visual Studio Team Services editor as the section How to: Edit code in Visual Studio Team Services shows in the link above, we can monitor the output of the Mobile Apps backend application. E.G:
About your FTP issue, please double check your deployment Username, when we login to FTP server on Azure, we need to input the full FTP user name which is "app\username":
You can refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/#enabling-diagnostic-logs for details.

Resources