I am working to create POS(Point of sale) application using couchdb with angular. Since i am beginner to NoSQL world. Need guidance to how to design the system.
It should be cloud based application, where login user can create companies and each company has n locations.
In relational database sense, my database design look like this.
- While logging to my application, username & password validated against license db. If they are valid application will connect their own company db.
- Whenever user create new company, new database will be created, all their locations, invoices, payments are in their own db.
- License db responsible for user accounts, payments and their plan and level of security(which screen they can access/edit).
- The application has offline support using PouchDB. where relevant location details are downloaded to user browser, and they synced back to server DB.
Questions:
- Is it ok to create database for each company.
- If user wants offline operation, they can sync own location data only(filtered replication), if they want to access other location data, application should connect cloud DB.Is it possible?
- I want the same code to query/insert data in couchdb & PouchDB. Is it possible?
- Is couchdb map-reduce/mango query support complex reports
- Is Angular+Couchdb is enough, or do I need any server side framework.I don't any third-party authentication right now.
- How the above relational database design should be implemented in couch db
what are the other things i should think about this software design