Comments (6)
Hmmm ... Maybe I just need to chat with you sometime. I think theses username are the session generated ones so probably can ignore my rant.
from superlogin.
CouchDB databases are very cheap. I never contemplated a compelling use case where there would be an advantage to mixing other types of docs into the sl_users
database. Any custom object that has a 1:1 relationship with a user, you can safely put inside the user doc.
If you have a use case where there is a huge advantage to mix other documents into sl_users
tell me about it, and I'll see what we can do to accommodate.
from superlogin.
If you want to chat, I am in #SuperLogin on the PouchDB Slack. Afternoon California time works best. Let me know when and we can set a time.
from superlogin.
Yes I understand disk space cost is very small (16k for an empty db). I understand the security model reasons for having per user dbs. I've spent the last 10 months studying everything I can find about CouchDb and PouchDb.
In my case I need to create view(s) that emit/reduce user and group objects (many to many) in the one view so these object types must share the same database. My users also have different roles per group and may eventually have additional attributes on this M:M relation. I will likely use "per user" databases as well but groups and many other shared data objects of my schema won't fit here. I will need to support replication of these and many other shared object types to other couch servers (not pouch) and having multiple replications that don't preserve object insert sequence order would be painful. I also want to be able to perform single updates with multiple doc types using bulk_update (like a transaction) which I can't do if the db is split into multiple dbs. I may also need to watch changes to these shared objects in a single change feed. I also want to only create a single validation doc in this db to manage the schema (not split it up into "per object type" databases).
So in short there are many reasons to use a single couch db for shared data. I'm sure other devs will hit the same issues. This generally means you need to use _id prefixes to avoid key collisions and ensure efficient per type queries using startkey/endkey based of the prefix which avoids overheads of maintaining a view index for each object type.
Cheers,
Tony
On 26 Apr 2016, at 4:52 pm, Colin Skow [email protected] wrote:
CouchDB databases are very cheap. I never contemplated a compelling use case where there would be an advantage to mixing other types of docs into the sl_users database. Any custom object that has a 1:1 relationship with a user, you can safely put inside the user doc.
If you have a use case where there is a huge advantage to mix other documents into sl_users tell me about it, and I'll see what we can do to accommodate.
—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
from superlogin.
To summarize our Slack discussion, I am going to check for type === 'user'
in the CouchDB views, and we will add an optional prefix to the user _id
. We will also provide a conversion script to prefix the users in the database.
from superlogin.
Thanks Colin.
from superlogin.
Related Issues (20)
- How can I remove confirmPassword requirement?
- Validation failed HOT 8
- Validation failed HOT 1
- Calling /auth/session with authorization header is returning unauthorized HOT 1
- Use template-literal instead of EJS
- user-db-added event doesn't get emitted HOT 1
- New release? HOT 13
- Validation Failed HOT 1
- Register vaildation failed HOT 18
- Mandatory Migration from Cloudant to BlueMix not compatible with Superlogin HOT 1
- Superlogin with CouchDB crypto.pbkdf2 "digest" argument required HOT 1
- how to add profile data with registration?
- removeUser not working
- Live demo isn't working HOT 1
- Forgot Password function
- TypeError: Cannot read property 'valid' of undefined at Function.PouchDB.parseAdapter
- Howto: use superlogin with current nodejs HOT 6
- Set a Doc create limit per user
- super login spaming console with errors
- Graphql
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superlogin.