Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am creating an app like Snapchat using Swift and PHP as my backend. I am using MSQL is my database. I am currently saving my user information in NSUserDefaults (it is only a couple variables like username, email, id etc). I heard if I am creating a full scale app for more than 100k users I am supposed to use Core Data so I am not sure if I should switch over. As i said it is only a small number of variables is stored, rest is in my database. Will i be noticing any speed differences?
It can't logically follow that the number of users downloading your app has any impact on the viability of using CoreData vs. UserDefaults to save someone's username and email. However, it's plausible that there are advantages one way or the other (independent of scalability). Personally, I use UserDefaults to save that information, but can't imagine it makes much a difference.
However, the fact that you're keeping all other data (user profiles, photos, messages) exclusively in a remote database is quite worrisome. Without any kind of caching, your Snapchat app should probably be marketed toward the older generation, keen to reminisce in the days of Dial-Up with an app crafted to pull any data (other than username/email) repeatedly from a remote database. For this purpose, you ought to use CoreData or a similar alternative (SQLite, etc.). It's absolutely crucial that you have some sort of local database if you want to scale. And please, dear God, do not attempt to save this type of data to UserDefaults.
Unless, of course, you find my facetious proposition appealing.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I have a server with few websites there and its something like in the following picture.
I decided to add some more panel as a new website. Each website had its own structure but I did remove the unnecessary part so I'm just using one single database for all of the websites. Recently I had an issue with high CPU usage of MySQL. I'm not sure if it is because of using one single database or not.
In addition: Is there a way to get data with cronjob less than one minute? I tried sleep() but I guess its not a good idea.
Sharing one database amongst multiple applications has some serious disadvantages:
The more applications use the same database, the more likely it is that you hit performance bottlenecks and that you can't easily scale the load as desired.
Maintenance and development costs can increase: Development is harder if an application needs to use database structures that aren't suited for the task at hand but have to be used as they are already present. It's also likely that adjustments of one application will have side effects on other applications ("why is there such an unecessary trigger??!"/"We don't need that data anymore!"). It's already hard with one database for a single application, when the developers don't/can't know all the use-cases.
Administration becomes harder: Which object belongs to which application? Chaos rising. Where do I have to look for my data? Which user is allowed to interact with which objects? What can I grant whom?
Coming back to your issue on high resource usage, this is ideally caused by multiple applications utilizing the same database which increases needed CPU utilization. I strongly suggest maintaining every application with its own database for increased performance and scaling capabilities.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to build a web Base application for accounting company with large amount of data that doing task like following
1-login page.
2- Inquiry account Details like (Account Owner Name, Account number, Balance, date,..personal information and account information.. etc ) by entering the primary key account number and then display to user some details
3- reports something like this example of Datatable
and these reports should be exported to excel file or PDF file (I don't know if that possible in some way)
Notes
the system is running with oracle data
I want to know if using PHP to enhance the security and ajax technique to enhance the preference of querying data is good way to design my web base application or should I use something better
finally I you don't mind to give me a good explained example for above ideas or
for the suggests ideas specifically example that using liked to oracle database
I searched and found examples that use PHP ajax and jquery or bootstrap with MySQL
I also want to know what the difference between them and which is better in my case
I would do it like this, because I feel comfortable with those languages, this kind of application can be created in a lot of languages, so why not go with those you are good at ->
Backend: PHP, mysql
Frontend: html, css, js, bootstrap
I would use ajax if there is need for posting data and updating elements without refresh.
But this is just me, do it with what you feel comfortable, but prepare everything before u start, create ER model for database based on as much info you can get, create business logic process and procedures before you start coding so you do not end up writing the same code multiple times.
Hope this helps
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
The Problem
I have an app that scrapes data and presents it to the user, directly, because of lack of disk space.
This data is very volatile, it can change within minutes. Much like the stock market.
Since the data changes so often, and it varies from user to user, it is useless to save it in a database.
The question
I need to sort the data presented to the user, compare it, link it etc. A lot of functions that a database provides. Yet I cannot save it in said database because of the above conondrums, what should I do?
What I've Thought of Doing So Far
I've tried organizing the data presented to each user using just PHP but seems troublesome, fragile and inefficient.
Should I just create some sort of virtual table system in MySQL just for data handling? Maybe use a good database engine for that purpose?
Maybe I can save all data for each user but have a cron job remove the old data in the database in a constant fashion? Seems troublesome.
The Answer
I'd like some implementation ideas from folks who have encountered a similar problem. I do not care for "try all of the above and see what is faster" type of answers.
Thanks all for your help.
If the data is of the type you would store in a db and you would benefit from being able to query it in ways that are more difficult in PHP, but you just don't want to keep it, you can still use a database. You can create temporary tables, insert raw data, and query it to get what you want. When you close the db connection, the tables disappear. Even though the script names them the same, the database will actually create a unique set per connection so each user will have unique data. This solution may not perform as well as you need so do some testing to see if it's suitable for your situation.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a website that I've created using PHP, Mysql, and other (HTML, CSS, etc) and I'm looking into converting the website into a native Iphone App for the app store. I know quite a bit of Objective-C and have used X-code for a couple years but I'm confused about one aspect of it. I've never worked with databases from an app. The database that we have set up is just a good old fashion PHP and Mysql that we connect to. It holds all of the site's users and other information.
Therefore, what should I do about accessing this database on the phone? Is there a way to use Mysql or is there something else that I can use that would interact with the database separately? I know there is SQLite but does that work with Mysql or not?
Any tutorials or guides you could point me to also would be great. Thanks.
The simple answer is: don't connect an iOS app directly to the database. Think about it: you'd be embedding a username and password somewhere in the app's code, which some nefarious user will find a way to extract and exploit.
Much better way to do it: create a simple API on your website, then pass requests from mobile users through the API. Then your server handles all database connections, authentication of users, and so on, and you haven't put your database credentials in the hands of lots of unknown individuals.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am developing a php application using CodeIgniter. I am planning to split the single MySQL database to multiple sqlite databases. That is, one database(MySQL/PostgreSQL/SQLite) that handles authentication and one sqlite database per user that holds information related to users. I do not use any joins and it will have more reads than writes.
Is it a good idea to split the database into multiple sqlite databases for speed? Also, will it have problem when scaling to multiple servers? I can use redirection depending on user to point to right server.
Edit:
Decided to use MariaDB as my server for all users.
By splitting data into multiple sqlite databases, instead of speed, you will gain major headache and time sink. Don't do this, unless you know you have to, and can prove it with hard numbers, not hypothetical scenarios.
The advice above applies if the system you're building has some value (will be used commercially, etc.). Of course, if this is just a toy/training project, you're welcome to do whatever you like, and learn from it.