Solved

How to: PHP Session distributed management (i.e. cloud) with MySQL or NoSQL (Reddis, MongoDB)

Posted on 2014-11-15
6
398 Views
Last Modified: 2016-02-10
Hi,

I'm wondering what are the best practices for setting up a PHP session distributed system (for Login Authentication and Authorization) using MySQL or perhaps NoSQL (maybe Reddis or MongoDB). Should I use Node.js with a NoSQL? If so, what are some good thorough books or online tutorials where I can learn more. I don't know much about NoSQL and I'm just learning Node.js but know Javascript.

I'm reading this whitepaper:
http://www.mysql.com/why-mysql/white-papers/unlocking-new-value-from-web-session-management/

and it gives some overview but I'm wondering how other professionals are tackling the issues too.

Can you give me some good books to read or links please? =)

I'll be using PHP Laravel for the backend framework so I have to learn how to implement all of this or at least get going in the right direction.

Thanks. Father God bless you<>< =)
0
Comment
Question by:Victor Kimura
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40444795
How many servers are you trying to manage and controls logins on?
0
 

Author Comment

by:Victor Kimura
ID: 40444819
Maybe just two to start.
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 333 total points
ID: 40444926
I'll ask a different way.  How many are you planning on having?  If you are not going to have more than two then there is little point in using a 'distributed' login method.

Do you have any 'regular' PHP login methods running?  That would be the place to start.  All my login methods use MySQL but they are only for one computer or site.  If I was going to do this, I would be looking at a method using MySQL where the current login could be verified from two different computers.  If you get that working, you can expand on that.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 167 total points
ID: 40444984
Have a look at built-in Laravel session management.
http://laravel.com/docs/4.2/session

My guess is that MemcacheD would give the best performance.
0
 

Author Comment

by:Victor Kimura
ID: 40445114
@Dave, Oh, I see. Yeah, I can see that working. I was reading on MySQL cluster and we want redundancy in case one server goes down. We have people filling out like different pages of a registration form for creating a legal doc stuff. And so I'm thinking there will be other fields that need to be managed with two different MySQL servers - maybe three servers situated in disparate geo locations for speed and when one or the other server goes down. I'd like to start with two to keep it simple. I am looking at cloud services like Amazon but really don't know much about it right now. Oh, perhaps just two VPS servers.

So I'm trying to find out what people think is the best strategy. I'm thinking using Node.js and MongoDB and then sync the MongoDB with the two MySQL servers. Not sure if that could work. Do I need MySQL cluster? Is it easier to manage with it? Not sure how everything really fits together though.

Hopefully, this clarifies what I'm trying to achieve or do. What do you fellas think?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 333 total points
ID: 40445130
sync the MongoDB with the two MySQL servers.
I'm sure that you can reasonably do that.  MongoDB and MySQL are like completely different animals.  You are also suggesting at least two different programming languages.  I'm not fond of that idea either.

And fail-over redundancy appears to be a difficult thing to do on the web with separate locations.

I suggest you start small with the obvious methods and build something  that works on a small scale.  Then you'll have something to refer to when you want to expand it.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question