Meteor updating/removing/inserting documents. Client or server side? - mongodb

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.

Related

Query data from MongoDb without a server

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.

Is MongoDB able to handle this architecture: 300 collections on client sites and 1 "primary" server available to everyone?

The architecture I'd like to have is something like that:
We have a "primary" server on the internet that holds all the collections and each of the client(customer) has his collection on his own site.
We can't guarantee the connection between the client and the primary server (quality, availability) but the collection on the client site must always be available (read and write)(I mean, even if he has no internet connection)
The "primary" server must also be able to write things into the collection (if connection available) and always be able to read it. (have a local replication of the collection)
I've put primary between quotes since, it's not primary in the mongodb way (since, it's mostly the collections on the client site that are written).
So what I need is bidirectional replication of collections with resync when internet connection was unavailable and writes were done, on both sides.
Sounds to me impossible but, I still want to be sure MongoDB is not the right tool to do it. Or is it a way mixing sharding and replication to achieve that ?
Since you're after two-way writes, perhaps it's best to think of each server as a stand-alone app (with whatever database back-end). You would have all of your custom requirements logic in the app.
I think you'll have a tough time finding software that does everything you need right out of the box. Please post here if you find it.

How do i query data from SQL Server 2005/2008 databases to iPhone

I am trying to figure out how to utilize exisiting SQL Databases with my iPhone apps.
What i am trying to do, is have a search function. The user inputs a keyword, i would then query my SQL database dependant on the user input and return the results from a database.
How do i do this with the iPhone?
EDIT: I mean SQL Server 2005/2008 databases which are hosted online (remote).
Thanks,
-Mike
You need to write a PROXY PROGRAM to do that. You can't connect directly to SQLServer from iOS.
By proxy I mean a program using some kind of server side technology (IIS, ASP.NET, Java, C#) to connect to SQLServer, and implementing a TCP/IP based protocol (could be HTTP also).
On the iOS side, you need a TCP/IP (or HTTP) client to perform requests to the PROXY PROGRAM. Those request will have the SQL query you want to do in some form of internal encoding you can invent. When PROXY PROGRAM receives a request, it process the SQL query and returns and send results based, again, encoded in some form iOS could decode and process the information.
You should give iSql SDK a try.

GWT Client and Server

I believe that GWT achieves RIA through initial throwing of
objects and files to the client side initially. but what I do not
understand is that is it possible to control the amount of information
being thrown to the client side? cos this is because I do not want
sensitive information to be cache at the client side. these
information shall only be retrieved from server when requested.
these information should only be sent to the client only when
requested and should not be cached at the client side. does anyone
know if it is possible to control the amount of information being sent
to the client? can anyone enlighten me? would appreciate your help
sincerely.
See if you dont want to expose particular information on client side then keep it on server side and whenever you want that information then using RPC call you can get it on server side.And gwt cache things like images etc that on client side information only.It is not caching your information which is present in lets say database or server side.So you dont need to worry about it.And if you want more security then you can use encryption and decryption algorithms.And if you follow design patterns like mvc then that will be very good programming practice.I created one sample application so if you want you can take checkout from here

Accessing Microsoft SQL Server from iPhone app

How do I go about doing this?
You shouldn't.
Instead, you should make a web service that securely exposes the data you need.
(Do not write an ExecuteSQL method!)
If you really want to connect directly to SQL Server from an iPhone, you'll need to write a TDS client; it will involve a lot of work.
By exposing the data through a web service, you add a layer of abstraction between the database and the client app, allowing you to change the database without breaking the app.
Also, exposing SQL Server directly to the internet is never a good idea.
Finally, remember that port 1433 might be blocked at a firewall.