简体   繁体   中英

android message app architecture hardware requirement

I am developing an android app ( and later an iPhone equivalent ) text processing app. Like all messaging apps, my app sends and receives messages. I have created a basic app with Eclipse and ADT. I have posted the architecture below. I am a novice guy when it comes to JAVA.

This app works well with an emulator and with my device. But I don't know how to make this app scalable. What I do is establish a connection when the message hits the web server and write the info into the mongoDB and close the DB connection. When I need to send a message to a mobile, I establish a connection, get the data from mongodb and send it to the mobile app,close the DB connection

I mean in an actual production env, if 100 or 10000 devices send a message to the server running the services, I am not sure how to handle this request with the servlet. I am not sure whether to establish a DB connection for every post and get request. I believe there is a better way to do this.

I wish to set a private cloud with the rest api handling 1000's of request at the same time.

Could any one give me some idea how to accomplish this. Is the technology stack which I am using is correct or Am I missing something?. Please let me know.

Thanks for your time and suggestions.

Your best option is to write a performance test to emulate the scenarios you're talking about (100 - 10 000 devices sending messages) and see what the results are like. You want to think about the things you want to test, for example

  • Response time (eg does the response time increase with an increased number of connections)
  • Server load (does the CPU or other hardware start to creak when you make more connections)
  • Throughput (is the amount of data you can transfer compromised when you have more connections)

You should not test all of these in a single test, but figure out which is important to you and write an appropriate test (or series of appropriate tests)

The results you get will be dependent upon the hardware that you use during testing, but you should be able to get an idea of whether your architecture will handle the sorts of load you're expecting, or whether you need to redesign it.

I did a quick google for both "Writing Java Performance Tests" and "Designing REST Performance tests" and there are lots of articles, webinars and training on this sort of thing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM