In my application i need to get all user's Facebook friends list and compare it to with my application users list.
This process should return to the user a list his Facebook friend that are already registered in my application.
My application's server is an Http server which the application query with information and results in return.
My Question is as follow:
What is the best way of doing what i want ?
I can think of 2 approaches but both doesn't fill right:
Since i'm trying not to overload my server - i will write a function in my server that will return all the list of Facebook user's Id which are registered in the application.
In the client side - the client will check which of them are relevant to him.
The pros here is that i'm not overloading my MySql server with queries that will take it long time to process. The cons are that i found this way no "logically elegant".
To right some kind of procedure or function (or just a simple query using the IN element) which will be processed on the server side and will return the user only the relevant Facebook user's Id..
The pros are that it much more elegant, the cons are that i think its not a better option from the resources using point of view, and it might overload my server.
Will be glad for advises or some new ideas
Related
I'm fairly new to programming and I'm studying App development with Ionic and using Laravel as a backend. So far I have created a simple system with sign up and login of users and creation of "events" by the users. I have made the relation between the users and events as the app will need to know which user created an event, and the participants of such event.
Now, I was wondering about adding a messaging system between users and obviously push notifications and stuff and came across Firebase. I've read about it before, but haven't really used it so I'm not quite familiar with it.
My question is, is it possible or even recommended that I use both MySQL and Firebase in my app or should I just stick to one? I've read about Websockets if I stick with Laravel, but on the other hand, Firebase also handles user login and registration in case I want to move to Firebase completely. I'm having some technical questions, such as:
if I'm using both MySQL and Firebase in my app, how would I connect the user that was registered with an ID and a username stored in my MySQL to Firebase, which will need to know which user has sent a message to another one? Can that be done, or recommended?
Should I just stick with just one for my use case (MySQL or Firebase, instead of both)?
I have researched about use cases similar to mine and couldn't find anything, if you guys have come across such situation, could you recommend any materials? It would be much appreciated!
Thanks a lot everyone! I hope my questions were clear, if you need more details, please let me know!
If you decide to use Firebase, it comes with a built-in authentication system so you wouldn't need a MySQL database or your own server.
If you decide to use both anyways (if you have a good reason to do so), you would have to handle all the logic for copying the authenticated user id over to firebase (and validating access) on your own server. If you don't need to do that just keep it simple: Firebase or your own server + MySQL.
I am working on a project and one of the key components is creating customized user profiles. I already have a schema design for the user data that will generate said profile. But I am lost on how the technology works.
I am mostly front-end so it has been sort of overwhelming. The goal is to allow multiple user profile creations and so far I have only seen that this can be achievable via NodeJs or PHP. I have not found any guides.
I am not sure if I am asking the right questions.
Any help is appreciated. Thank you.
Since you mention you already have schema for the user table, I assume you are going to design your own database and backend node.js API to handle user profiles. You may want to build authentication functionalities in the future. If you are not familiar with Node.js yet, I recommend you to start with https://www.tutorialspoint.com/nodejs/index.htm. It's a good tutorial for beginners.
The whole purpose of a back-end node.js API is building numbers of service with specified route. Once a http request is made to a particular path, it takes parameters and execute some script. In you case the scripts will do something in database containing user profile data, for example, add a row in your data table. This operation is equivalent to creating a new user. Then, the API send response to front-end.
Keep in mind maintaining user profile data is nothing special than regular data. You should be able to pick it up with a couple of days training if you know javascriopt. But if you have to build authentication functionality you need more technologies.
I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
In other applications I've written, I've had to add the database specifications (username, password etc) into profiles.clj. Should I create profiles.clj and add the location of my database there? And does this mean I have to update the project.clj as well?
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs.
I apologise if these questions are trivial but after reading the documentation several times I am still a little confused
re-frame is a framework for building client-side web applications. You won't be able to do generic database queries as most databases don't support direct access from a browser.
I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
You probably need to create a middle API tier that accepts REST requests from re-frame, and queries the database, returning JSON back to the client.
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs
Those are probably queries to your API tier? They can live anywhere that you would like.
One thing to clarify: re-frame has an app-db that it uses and refers to. This is a client-side database of local state that lives in your application. It doesn't have a connection to the backend, at least not without you writing more code for it. It sounds like you might be confusing these?
This may be a total shot in the dark, but looking for a service that basically exposes a database model as a restful service which we can query from the front-end (eliminating the need for a middle layer/server).
The idea would be simple enough, create a database with say a products table. This would then be exposed automatically via an API that represents that table. On your front end the user could enter text or choose several options and then via JS you could hit that endpoint (with the user's choices as parameters which inevitably becomes a SELECT and retrieves the data), that returns some JSON back in the form of results and via JS you display it on the front-end.
I have to believe something like this exists and maybe I am not being clear enough, but its basically an auto-created backend. This would be great for rapid prototyping.
Thanks in advance if anyone has ideas!
Hey i need some help here, i am developing a vb.net desktop application using visual Studio 2010 and mysql v5.5 whose database will be located in a main server hence the applications will have to communicate with the the database to get/post information.
My problem however is that, i want my applications to have a real time update of the database content such that if user1 updates the database, it immediately reflects that in user2's application. I have read articles that recommend use of triggers and Stored Procedures in mysql syntax to do this but i have no idea how this will work.
I have a table called 'Store' , when a user enters an item in table store, i'd like the application to know it and update the Item and its contents in a listbox or datagrid.
How do i capture these events in my vb.net code?
I hope i am clear enough, if not please ask. All your suggestions will be highly appreciated!
I think the easiest way to solve the problem would be to periodically get the records from the server and update the local list appropriately. On your client application you could store the last time the list was updated, and send that as a parameter when you do the get and get all the items that were created after that time (that way you only get new items).
Another possible solution would be to have a client register with the server application (so the server keeps track of all the clients) and when you create a new record you send that new record to all the clients, which would be listening for that event.
It's sort of hard to say what the 'best' approach is in your situation. How is your code designed (what's the architecture)? Are connections between the client and server applications persistent? Is there a server application that your client application talks to or is each client directly talking to the database?