Redis and MongDB data sharing, redismongdb

Source: Internet
Author: User
Tags oauth

Redis and MongDB data sharing, redismongdb

Refer:

Http://blog.nosqlfan.com/html/3537.html redis Data Summary

Http://blog.nosqlfan.com/html/3548.html mongDB Data Summary


Problems with session sharing in redis

How did you create a JedisPool?

JedisPoolConfig config = new JedisPoolConfig (); // configure
Config. setMaxActive (iMaxActive );
Config. setMaxIdle (iMaxIdle );
Config. setMaxWait (lMaxWait );
Config. setTestOnBorrow (true );
JedisPool objJedisPool = new JedisPool (config, ip, port number, timeout );

I use this method, but it is okay in linux.
Check that configuration information such as IP address cannot be obtained before JedisPool is created.
If an exception occurs, paste the exception information.
 
Java: is it feasible to use redis for single-point logon? Let's take a look at my methods.

First, you need to understand that most of the session implementations are through cookies, so cross-domain sessions are impossible.
However, cross-origin authentication can still be implemented using methods such as OAuth. However, it is not recommended that the OAuth project be completed.

Second, although cross-origin is a little difficult, different projects in the same domain can share sessions, CAS is not complex, you can search for the redis-session project on github, there is only one source code file, which provides a nodejs Implementation of redis session, that is, setting redis timeout to simulate session Timeout.

Again, cross-origin is also possible, that is, using iframe, while logging on, write cookies under multiple domains at the same time, pay attention to browser differences.

In summary, your ideas are completely feasible.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.