I am trying to decide between Firestore and MongoDB as the backend database, I have a doubt:
In Firebase:
Firestore has security rules built so this makes it possible for clients to query data directly from Firestore without cloud functions and still be able to read & write data that he is authorized to do so.
In MongoDb, the same logic of authorization to clients can be ensured with a server like Node.js or ktor application that acts as a mediator between the client and the database.
So my question is can clients query data directly from MongoDb and still ensure they read & write to data that they are authorized to without a server in between?
No, clients cannot query data directly from mongoDB securely. Even firestore cannot do this.
Firestore does have server in between the client and database. It's just provided and managed by Firebase so from our eyes it looks like there is no server. If you want to do something similar with mongoDB, you would pretty much build what firebase has build on your own.
Related
I am trying to read database continuously but I am not finding any way to do it.First of all I am having a doubt that wether Firebase Realtime Database can do this task with out calling api multiple times.As per I researched over internet to accomplish my task I came to know that socket.io package or web sockets can Abel to complete task but I am trying to find the difference between Firebase Realtime Database and socket.io package which is the best approach to read data in database continuously.If I use socket.io package then how should I connect to my server and what is the procedure can any one explain with example
I need to get the current server time/timestamp from AWS dynamodb to my ios swift application.
In firebase db we can write the current timestamp to db and after that we can read it from the app. Any suggestion about this is appreciated.
DynamoDB does not provide any sort of server time—any timestamps must be added by the client. That being said, you can emulate a server time behavior by setting up a Lambda function or an EC2 instance as a write proxy for DynamoDB and have it add a timestamp to anything being written to DynamoDB. But it’s actually even easier than that.
AWS allows you to use API Gateway to act as a proxy to many AWS services. The process is a little long to explain in detail here, but there is an in-depth AWS blog post you can follow for setting up a proxy for DynamoDB. The short version is that you can create a rest endpoint, choose “AWS Service Proxy” as the integration type, and apply a transformation to the request that inserts the time of the request (as seen by API Gateway). The exact request mapping you set up will depend on how you want to define the REST resources and on the tables you are writing to. There is a request context variable that you can use to get the API Gateway server time. It is $context.requestTimeEpoch.
Which way is the most efficient and safe to make changes to mongoDB?
UPD: allow/deny rules on the client VS server method calls
Server side. Else your users can see what database you're using. You don't want that.
Is it possible to access Sql Server instance from Crossrider?
It has doc for local db and i am assuming that is used to store data on the browser's machine.
I have central data that gets constantly updated/read by plugin users and need a way to access external db (preferrably Sql Server but i am flexible).
Thanks
Crossrider does not provide a native way to interact with SQL servers (or any other external database), and you are correct about our local db support.
However, if you have the HTTP URLs for accessing your db, you can use the appAPI.request.get and appAPI.request.post methods to interact with your database.
My app reads data from two sources, a local sqlite file and a remote server which is a clone of the local db but with lots of pictures. I do not write to the server database, but I do need multiple simultaneous fetch operations.
What DBMS should I use for storing information on the server?
It needs to be very easily used from an iPhone app, be reliable, etc.
Talking to a remote server should not be tied to any platform like iOS. If you have control over the remote db server, the best bet IMO is crafting a RESTful API which you express your queries in, the server processes it and sends you the pictures/records using proper content type. If you do NOT have such control over the remote db, you'll have to stick to the API the db hoster provides. There are plenty such "on the cloud" db hosters (including NoSQL solutions) that give you a web-services interface to your db. MongoLabs is one such provider for MongoDB(which is a NOSQL db - meaning no schemas, no bounds on the structure of a "table"). You can continue to stick to SQLite on the client side.
You seem to have two sources of data local storage and a remote server.
This question on SO might help you to decide approaches of storing data on the server.
Once you have downloaded data using something like NSURLConnection class the images could be stored in the filesystem using writeToFile or the likes.
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag method.
You might like to save the rest of the data in sqlite. We used sqlite and the CoreData framework to save data for one of our applications and it worked fine for us. CoreData allowed us to interact with the database without actual SQL queries.
The iPhone client resides on the phone while on the server side we might have a database and a webservice interacting with the db. Webservice itself might be implemented in python or php like scripting language. The client interacts with the webservice that might return data in formats like XML or JSON. Thus there is no direct communication between the client and db. However, the client does implement network communication code to communicate with the webservice.
This page shows how to consume an XML based web service.