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
Browsing official available clients for Redis (https://redis.io/clients) it seems that there is no current client for JavaScript/TypeScript client library.
Am I right?
Is such a client simply missing or there is a reason why it cannot/should not exist?
There's a Redis binding for Node.js on Github:
http://github.com/fictorial/redis-node-client
and you can try node.js without any need for persistence.
If you have questions, right now it's best to show up on Freenode #node.js or the mailing list on Google Groups.
Unfortunately javascript can only communicate via HTTP or Websockets.
Here's an idea:
Embed a .swf in your page and write javascript callbacks for an actionscript redis client.
https://github.com/claus/as3redis
This would have less network overhead than implementing something like http://webd.is/ or any other server-side redis client.
You should be reducing network overhead everywhere possible. While the following may be fast, we may still be able to do better.
step 1 ajax call -> php -> redis
step 2 redis -> php -> ajax return
....that's at least two separate tcp connections if your redis server is not on the same server as your backend application.
Why not cut out the middle-man and write javascript callbacks to actionscript redis calls?
Here's why:
-You may not want to expose your redis server to the internet.
-A client-side dependency on flash for your data retrieval may not be the best solution in terms of robustness.
I'd like to code this up someday and see how it performs. Let me know if you try it out!
I see http://github.com/fictorial/redis-node-client has been abandoned, rather use this
http://github.com/mranney/node_redis, it's got good documentation, if combined with the redis commands http://redis.io/commands.
Related
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 have a html form with some fields that are linked to a database row that have to be modified at the same time by different users.
Every time one of the users edit an input field it may call a javascript onchange (or similar) function to update the specific column in the row, but the other users that have the same page opened don't see the change until they refresh the page.
What should I use to get it changed on all devices that are looking the page?
The backend is in PHP/MySQL.
Thank you
You have a way to send pushes to your backend server but now you need to get pulls from your server.
For this purpose, you need to maintain a constant communication channel between your client and server to get real time updates from your server. There are multiple options for this:
Websockets: A TCP websocket can be used for real time communication between server and client. See this thread to get more information about websocket support in PHP.
Polling (very dirty way): you can do frequent poll from your client to your server to see if there has been any updates or not. This way of implementation is really inefficient and not recommended at all but still, since some applications already have polls in their system, if your system is already doing frequent polls, you can attach the query to get form status with that poll.
There are a couple of possible approaches.
Have an ajax request in the client periodically poll the web server to retrieve the data. Though depending on how this is implemented, there could be some performance ramifications.
You could benefit from using WebSockets. Since you're using PHP and MySQL you might look into something like Ratchet. Depending on how far along the code base is you could potentially implement something with socket.io using node.
When you look for some already existing tools, this might something for you:
https://fusion-tables-api-samples.googlecode.com/svn/trunk/FusionTablesFormSync/docs/reference.html
When you do not find anything that matches your needs, you can write it on your own. Therefore you need Ajax (To transfer a change to the server), it is more easy to use in combination with jQuery.
http://www.w3schools.com/jquery/jquery_ajax_intro.asp
And you can also fetch the data from the server with ajax, but you have to do requests all the time, which is not very nice. An alternative would be websocket, but this need a lot of knowledge.
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 7 years ago.
Improve this question
Hello this is very unique question... we have requirement for web app which has some features related to phone... Like We want to make calls to customer via our computer (webapp in browser).. and computer can be connected to simple mobile phone or other thing and we have to insert details of call start and call end with customer details in our databse....
Anyway to achive this in php/javascript or any other way to achieve this type of thing or thing similar to it.. Or any alternative to achieve same type of thing in some other way ....
We need to store details in Database
Yes i know about twillow.com ... but if any open source technology then it will be awesme..
Well there is a couple of ways of doing this. There is first no way of getting PHP to call up without a SIP server or something like that. You can of course get a local SIP Server that has an API that can be used to call out and if we should help you with setting that up then this post would be very long.
Look into Asterisk or a already made service with api like twilio or a local provider depending on where you stay. I know that Grandstream and some other providers have small SIP servers that is really easy to setup. For me I use Twilio but sure it cost some more per minute but it will give you peace of mind.
However on getting the call data that has been made then if we for instance use twilio then you store the call id and then request it for length after 30 min or even 15 minutes and scans all calls for the duration.
Check the: https://www.twilio.com/voice/api
If you want to save some money and have SIP connection then I would use the https://www.twilio.com/docs/api/rest/making-calls-sip to use Twilio SIP.
In one of my companies they are using a provider that has an API to get the call logs. One thing you should look into.
Hope this answer helps you in the quest.
you have to use a SIP library to establish a SIP server natively to support calling. then use a php sip libray and use it directly or use a libray natively and access it using shel_exec(). but you need to have high amount of security and implementing and running a sip server is very difficult
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 7 years ago.
Improve this question
Can anybody explain me what is the difference between LAMPP and METEOR js framework?
Thanks in advance.
There is quite a big difference between the two.
LAMP:
This is a stack that originally (and still largely) stands for Linux Apache MySQL and PHP
The alternative of windows is called WAMP.
The linux part is the system the stack is running on; Apache is a server system where you can store and access your websites and apps; MySQL is the type of database(Relational Database); PHP is the server-side language you use to create these dynamic sites (you can also use python or perl).
The community is much larger and you can get support everywhere as it has been around longer than Meteor
If you run a linux os, you can literally download the apache server and host it on your computer see: http://httpd.apache.org/
Meteorjs
Meteor is a full stack platform that allows you to write all your code in Javascript. This means you can write the front end in Javascript, then turn around and also write the server/backend using the same JavaScript! Literally write once, run everywhere
Meteor allows you to write an app in very short amount of time as you are using just javascript.
-What really makes Meteor stand out is their "realtime" way of doing things. With mete0r, everything is reactive. When a change happens in the server, it is immediately reflected on the front-end without refresh or waiting at all!
Meteor apps come with Mongodb (NoSQL) already set up as your database system as opposed to MySQL used by LAMP. Meteor goes the extra mile by also creating a small database in the front end of your app and whatever changes you make are performed in this mini-mongo database which automagically synchronizes with the server and updates it. METEOR DOES ALL THIS FOR YOU.
-Learn more at https://www.meteor.com/ and this https://www.youtube.com/watch?v=RpQTPWvD6HA offers a great intro.
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 8 years ago.
Improve this question
If you don't want to read what im trying to do just skip to the "My question" part :)
My goal:
developing an application that saves as much server performance as possible.
There is no such thing as 100% secure, the app of course should be as secure as its coded.
However the founder of http://lavabit.com/ actually managed to take his security as far as making it NSA-safe (which obviously is the reason he had to shut it down).
My Progress:
I already discovered the BackboneJS Framework, which has saved me a lot of server-side coding,
using javascript templating, routing, input validation,client communication using websockets.
My Question:
since installing node or php on the server is a security risk in itself (which is the reason security issues need to be patched on newer versions.).I would like to know if there is a way to authenticate users without being forced to install nodeJs or PHP.
If you're able to use HTTPS then perhaps you could look at just using Basic access authentication? The web server itself would do the authentication - more information on Basic Auth in Apache can be found here.
I really think the experience you get from using a server-side language and cookies etc. is far richer and offers a much nicer user-experience. I'm not sure I understand the security risk[s] which you allude to. Alternatively if security is something which you are hesitant about, and feel that it will slow your app down, then perhaps you should consider designing your programme in such a way that security is not an issue.
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 9 years ago.
Improve this question
Coming from python world, we heavily used tastypie or Django-Rest-framework to create Rest API.
Reading through Convincing the boss from Felix Geisendörfer, i noted the following statement:
Building light-weight REST / JSON api's is something where node.js really shines. Its non-blocking I/O model combined with JavaScript make it a great choice for wrapping other data sources such as databases or web services and exposing them via a JSON interface.
When I try to learn Node.js and find the best way to implement a REST API using existing and reliable modules (like tastypie for Django); I just can't find a node.js module which handle those actions (GET,PUT,POST,DELETE,PATCH) based on a model automaticaly.
You will find a lot of tutorials saying how to implement a basic rest api, but I didn't find module ready to be use in a large production app. (i found Restify , mers ...)
What do you guys are using? Existing modules or you prefer developing your own controllers to handle those tasks and creating your own routes manually?
Check a list of Node.js frameworks, here for example. A lot of them provide REST out of the box.
Take a look at Sails.js, for example. With this one you can create a model and get a REST API within seconds.
As for the production-ready thing, it somewhat depends indeed on your own criteria and the requirements you are imposing.