Need a realtime database solution (for mobile)


I know this is not directly related to AdonisJS. Sorry for that. I just need some thoughts and ideas to get me started with this framework.

I’m making a social network app, and as I was writing the backend in Laravel I realized I might run into performance issues since I’m expecting thousands users (at least) and Laravel might not do the job since I believe It’s not meant for high-demand level purposes.

I was thinking about switching to Nodejs and I heard about AdonisJS and the fact that it’s very similar to Laravel it got me excited. I’m thinking about choosing a database solution and a way to have realtime data sync between my client app and the backend (for things like feeds, posts, notifications, chat, etc…)

Do you have any recommendations and ideas that could help me ? It’s my first time doing a project like this so I will be glad if someone could put me in the right direction, about the technology stack I should be using, and all that.

Thanks in advance.

(Extra details: client is a spa app, and the mobile version will be in cordova platform)



I believe the best way is to use Websockets to push real time data. Now since you are more interested in architecture first, lemme share some simple rules ( I personally follow ) when building real time apps.


Use websockets to push realtime notifications. Also never send too much data from websockets, just use it as a way to notify your client, so that it can ask for data using the normal REST API.

I see lot of people rely on realtime events to exchange data and this is worst thing, so many times, your websockets events can be out of order or may even slow down due to internet issues.

Build a proper REST API to get and set data and think of Websocket as a medium to tell the client on when to ask for new data from the REST API.

How to do this in Adonis?

I am re-writing the websocket layer from scratch, since the existing Websocket module doesn’t allow you to scale horizontally.

It will take around a month to push the final release of AdonisJs with websockets, so please take your decisions accordingly

1 Like


Thanks for the reply !

I heard about and I wonder how does the websocket you mentioned fare against libraries like that? Does it come with the keep-alive/http fallback or other features they talk about on their site or is that something we should implement by ourselves?



Another option is Google Firebase
It has many features for real time database purpose, even it gives us offline capability which is very helpful for our mobile app functionality
I’m working on mobile app using Ionic which also uses push notification, chat, etc.
It is free for certain limits
You can decide it yourself



Another solution is It’s pretty flexible and there are many options for tracking and processing data. I was pleasantly surprised by their NoSQL solution. It can be easily integrated into other services, so I don’t see a problem here at all.



Another option to consider is the meteor framework. It has realtime updates from the database.