Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Choosing a proper database for mobile messenger app

Choosing a proper database for mobile messenger app

Scheduled Pinned Locked Moved Database
javascriptdatabasemongodbsqlitequestion
11 Posts 5 Posters 31 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Dunlop
    wrote on last edited by
    #1

    I'm wokring on a mobile messenger app using Flutter. I'd write backend code in Node.js. My app will have a list of users and each user can send request to other users to get paired with them. Each user can reject/accept other users' requests. If two users get paired, they can send message to each other or make a voice/video call. All messages transfered between users will be registered on the database for further analysis or detecting any criminal materials or misuses. I'd have about 2000 users, meaning the maximum online users are about 2000 people. The overal nature of the backend model is relational. I need to choose a proper database for this app. My options are MongoDb and Sqlite. Which one is good for this project? Can Sqlite handle this project with that amount of users?

    J L 3 Replies Last reply
    0
    • A Alex Dunlop

      I'm wokring on a mobile messenger app using Flutter. I'd write backend code in Node.js. My app will have a list of users and each user can send request to other users to get paired with them. Each user can reject/accept other users' requests. If two users get paired, they can send message to each other or make a voice/video call. All messages transfered between users will be registered on the database for further analysis or detecting any criminal materials or misuses. I'd have about 2000 users, meaning the maximum online users are about 2000 people. The overal nature of the backend model is relational. I need to choose a proper database for this app. My options are MongoDb and Sqlite. Which one is good for this project? Can Sqlite handle this project with that amount of users?

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      You can size it like the following 2000 users 100 messages a day Total = 200,000 message a day Messages per year = 400 * 200,000 = 80,000,000 Why 400? Because precision is not needed. All of the numbers are just guesses to give a goal. Then further what is the average message size? 100 bytes or 1,000,000. Obviously the second is going to be because they are transferring files and not just messages. So do you keep the files also. One thing I don't see in your post is growth rate. Are you starting with 200 users and only expect them to grow to 2000? Or the market that you are targeting, at best, only has about 2000 users? You also do not document retention rates. How long do you keep the messages? 1 year? 7 years (often sufficient for most legal/business reasons)? 20 years? So what database do you need? Any really. Nothing you posted suggests a need for 'speed'. All you are doing is keeping it for future analysis. You could even just write it to files. You also do not mention personal security. Presumably, excluding the analysis, the messages are not subject to random poking around by operations personnel so how do you secure that?

      A 1 Reply Last reply
      0
      • J jschell

        You can size it like the following 2000 users 100 messages a day Total = 200,000 message a day Messages per year = 400 * 200,000 = 80,000,000 Why 400? Because precision is not needed. All of the numbers are just guesses to give a goal. Then further what is the average message size? 100 bytes or 1,000,000. Obviously the second is going to be because they are transferring files and not just messages. So do you keep the files also. One thing I don't see in your post is growth rate. Are you starting with 200 users and only expect them to grow to 2000? Or the market that you are targeting, at best, only has about 2000 users? You also do not document retention rates. How long do you keep the messages? 1 year? 7 years (often sufficient for most legal/business reasons)? 20 years? So what database do you need? Any really. Nothing you posted suggests a need for 'speed'. All you are doing is keeping it for future analysis. You could even just write it to files. You also do not mention personal security. Presumably, excluding the analysis, the messages are not subject to random poking around by operations personnel so how do you secure that?

        A Offline
        A Offline
        Alex Dunlop
        wrote on last edited by
        #3

        My main problem is concurrent database read/write capability. I'll delete "seen" messages every month. I think Sqlite is not good for this project. What about SQL Server? Or Mongodb?

        M J 2 Replies Last reply
        0
        • A Alex Dunlop

          My main problem is concurrent database read/write capability. I'll delete "seen" messages every month. I think Sqlite is not good for this project. What about SQL Server? Or Mongodb?

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          They are 2 quite different databases, SQL Server (which will certainly meet you needs) is relational and Mongo DB is a document database, a different beast altogether.MongoDB vs SQL Server: Which is Better? [10 Critical Differences] - Learn | Hevo[^]

          Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

          1 Reply Last reply
          0
          • A Alex Dunlop

            I'm wokring on a mobile messenger app using Flutter. I'd write backend code in Node.js. My app will have a list of users and each user can send request to other users to get paired with them. Each user can reject/accept other users' requests. If two users get paired, they can send message to each other or make a voice/video call. All messages transfered between users will be registered on the database for further analysis or detecting any criminal materials or misuses. I'd have about 2000 users, meaning the maximum online users are about 2000 people. The overal nature of the backend model is relational. I need to choose a proper database for this app. My options are MongoDb and Sqlite. Which one is good for this project? Can Sqlite handle this project with that amount of users?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Sqlite is meant as a single-user database. MongoDb is for documents.

            Alex Dunlop wrote:

            users will be registered on the database for further analysis or detecting any criminal materials or misuses.

            The answer is a clear no. You might want to consult a lawyer, not a software-dev.

            Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

            J 1 Reply Last reply
            0
            • A Alex Dunlop

              I'm wokring on a mobile messenger app using Flutter. I'd write backend code in Node.js. My app will have a list of users and each user can send request to other users to get paired with them. Each user can reject/accept other users' requests. If two users get paired, they can send message to each other or make a voice/video call. All messages transfered between users will be registered on the database for further analysis or detecting any criminal materials or misuses. I'd have about 2000 users, meaning the maximum online users are about 2000 people. The overal nature of the backend model is relational. I need to choose a proper database for this app. My options are MongoDb and Sqlite. Which one is good for this project? Can Sqlite handle this project with that amount of users?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Assuming the database will be controlled by some hosted system that is only accessed by your backend system, then SQLite would be a resonable choice. See Implementation Limits For SQLite[^] for guidance on sizing.

              C 1 Reply Last reply
              0
              • L Lost User

                Assuming the database will be controlled by some hosted system that is only accessed by your backend system, then SQLite would be a resonable choice. See Implementation Limits For SQLite[^] for guidance on sizing.

                C Offline
                C Offline
                Code4Ever
                wrote on last edited by
                #7

                If the SQLite database is accessed only by the backend, could it handle 500 read/write requests which are sent to the beckend at the same time?

                L J 2 Replies Last reply
                0
                • C Code4Ever

                  If the SQLite database is accessed only by the backend, could it handle 500 read/write requests which are sent to the beckend at the same time?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  That is impossible to answer as it depends on many factors. If you need specific performance levels then you would need to do some testing of your own.

                  1 Reply Last reply
                  0
                  • A Alex Dunlop

                    My main problem is concurrent database read/write capability. I'll delete "seen" messages every month. I think Sqlite is not good for this project. What about SQL Server? Or Mongodb?

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #9

                    Alex Dunlop wrote:

                    My main problem is concurrent database read/write capability

                    Nothing in what you posted suggests that is a concern. Each new message is just a new record regardless of how you store it. Even if you allow edits you should handle that as a new message rather than replacing the previous one.

                    Alex Dunlop wrote:

                    What about SQL Server? Or Mongodb?

                    Not a matter of whether those would work but rather if they are overkill. When I looked up the transactions per second speed for Sqlite I did not see anything that concerned me for the sizing I previously posted.

                    1 Reply Last reply
                    0
                    • L Lost User

                      Sqlite is meant as a single-user database. MongoDb is for documents.

                      Alex Dunlop wrote:

                      users will be registered on the database for further analysis or detecting any criminal materials or misuses.

                      The answer is a clear no. You might want to consult a lawyer, not a software-dev.

                      Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                      J Offline
                      J Offline
                      jschell
                      wrote on last edited by
                      #10

                      Eddy Vluggen wrote:

                      You might want to consult a lawyer, not a software-dev.

                      At least in the US and presuming a single company then users can have no expectation of privacy for company resources. Notifications to company employees are nothing more than a courtesy. Although perhaps also that they should keep the personal stuff off the company sites.

                      1 Reply Last reply
                      0
                      • C Code4Ever

                        If the SQLite database is accessed only by the backend, could it handle 500 read/write requests which are sent to the beckend at the same time?

                        J Offline
                        J Offline
                        jschell
                        wrote on last edited by
                        #11

                        Code4Ever wrote:

                        could it handle 500 read/write requests

                        No sorry that is not a valid question based on your original post. Exactly how are 2000 users supposed to generate that many messages at one time?

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups