Azure Mobile Services - Connect to Existing Database - azure-mobile-services

I'd like to create a Azure Mobile Service (.NET) that reads / writes from an existing database that is being used by an MVC 5 app. I've been trying, without luck, for the better part of a day to make this happen through the few examples that exist on the internet.
I've just now come across this SO post where Carlos Figueira says that a mobile service creates a new schema with the same name as the service name and all access is done via that schema and the user that has permission to that schema. If this is the case, how will I be able to have my mobile service connect to an existing table, if it always creates new tables in the new schema?
Also, I'm getting the impression that mobile services using .NET is much happier if I don't attempt to connect to an existing DB. Is this the case?

Azure Mobile Services will only work with tables in the new schema (with the service name). In order to work with an existing database, you need to transfer the tables to this schema, and then you will need to rename all your PK columns to "id" (lowercase). Once you have done that, the tables still don't show up in the Data tab in the management interface, but you can 'add' them and then it will connect and you can work with your existing data.
See this link for full walkthrough: http://www.strathweb.com/2012/12/using-existing-database-with-azure-mobile-services/

Related

What is the convention for creating applications users in MongoDB?

I am trying to create a users model for my application sign in with Mongoose / MongoDB. Based on how I see it when I deploy to Atlas or Mlab, it auto generates a users collection but for the purpose of database authentication - like this user has read access, write access, admin, etc. What is the convention for creating application users? Do I also use the same users collection but add additional schema properties or do I make a different one altogether like app_users. Thanks!
Are you using the test or admin database? You should create a new database for your application. When you create a new database it will not come with any predefined collections or such, so you can start blank (which is what I assume you want?).
You don't need to explicitly create a new database. Just point your driver to a database name you want for your app. Or in the mongo CLI type use myAppDb and you can start adding collections there.
More details here https://docs.mongodb.com/manual/mongo/#working-with-the-mongo-shell

How to synchronize odoo database with another odoo database?

I have two databases in my postgesql, one for the client and another one for the administration, we have these legal texts created in the administration database. What I need to do is to create a button "synchronize" in the client side to allow him to add new legal texts (if there is new legal texts) to his database. I don't know how to do it, or how to access another database from the current one.
you may want to take a look at this page Web service api odoo provid you with a couple of webservice allow you to performe search or read data or create or update almost everything you need in here so if you want to create some record in the other odoo instance use xml-rpc and you can create or update anything you want if you have acces rights.
https://www.odoo.com/documentation/9.0/api_integration.html
read it carefully it's so easy to understand and the example works fine in the online version you need it

How do I handle webapp users in PostgreSQL?

Previously I was using databases from BaaS (Backend as a Service) - Parse, Backendless, Firebase - this services has everything I need to manage users of my webapps: tokens handling, owner policies etc.
How do I manage webapp users in own database? (PostgreSQL 9.4)
Is it suppose to be just a regular table, which will contain columns "login", "password" etc. or there are specific tools to implement that?
How should I handle tokens? Should I store it somehow in database, or tokens suppose to be stored in my server and are not bind to database at all?
How do I implement owner policies? Are there some specific tools in Postgres for this, or I should simply create the column "ownerId" in each table and use it as Foreign Key?
If you know good articles on this topic - please, post a links - it will be very helpful!
I would search for it in google, but I've found nothing but articles about database users handling. I assume, this is not what I'm looking for.
Regular table or postgrsql ROLE system
Usually tokens are on application side
Postgres 9.5 have row security policies but you can implement owner policy by yourself. Hard to say what database features you have to use without
assumptions of the project.

Can I still update or create items in a table that has Azure mobile services EntityData with entity framework or SQL?

I have an azure mobile services and all the tables inherit from EntityData (to enable offline sync), which means they have system columns created automatically such as:
CreatedAt UpdatedAt Deleted
If I try to update or insert to this tables, can I still do it with just entity framework or plain SQL, or do I now have to do it all through the mobile service.
I'm somehow confused with the whole purpose of the EntityData and what it means. Cause I want an application that would be able to use offline sync, but still access data from a webpage.
The Azure Mobile Services SDK makes it very easy to perform CRUD operations on your tables but that doesn't mean you can't still access the tables using entity framework or just plain SQL.
Remember the Azure Mobile Services SDK supports both offline and online operations, but if you need to use the same Azure mobile services database with another client application, then you would have to get the SQL database connection string and connection information from the Azure Mobile services dashboard. With both information, your client app can use Entity framework or plain SQL queries to interact with the tables.

Multi tenant application in grails with shared DB Separate schema can any one provide any demo app or any good reference for that

I have to make a web application multi-tenant enabled using Shared database separate schema approach. Application is built using Grails and PostgreSQL .
I need to have one single app server using a shared database with multiple schema, each schema per client.
What is the best implementation approach to achieve this? - What needs to be done at the middle tier(app-server) level? - Do I need to have multiple host headers each per client? - How can I connect to the correct schema dynamically based on the client who is accessing the application?
Any links or pointers would be helpful.