I am trying to understand how to use the multi-model api for an individual cosmosdb deployment.
I launched one instance (ref attached image). I got back this url: gccosmosdb.documents.azure.com. The connection string is only for Mongodb.
Q. I need Table & Mongodb api for this db deployment. How can i get connection string for table api also within this db. Please kindly if someone could advise on how to get two api models working side by side that would eliminate 50% of my container workloads.
Today when you create a DB you are asked to choose one of the API and then all the collections in that db will follow the api. That's is true for the portal UI.
However, using the SDK (TableSDK, Mongo SDK) you can create two collections which hold different data models. So, if you have two collections say one with mongo data and other with documents or table. Then these two collections can be accessed independently using Mongo or Document/Table API respectively.
For Mongo you get the connection string from the portal. However for table connection string is as follows:
DefaultEndpointsProtocol=https;AccountName=MYSTORAGEACCOUNT;AccountKey=AUTHKEY;TableEndpoint=https://COSMOSDB.documents.azure.com
Hope this help.
Related
How to list all containers here? I wanna use it in the "lookup" activity of Azure Data Factory.
#Kyaka, It is not possible to list the containers using Lookup activity in Azure Data Factory as CosmosDB linked service needs a collection name to be passed. You may try to call the REST endpoint - https://{databaseaccount}.documents.azure.com/dbs/{db-id}/colls from an Azure Function and use Azure Function Activity to get collections list.
You can also check for other alternatives of calling REST API from ADF like Web Activity based on your requirements.
Please refer to the documentation List Collections for details.
Thanks
https://learn.microsoft.com/en-us/azure/search/search-howto-index-cosmosdb
This page states that you would need to use REST (REST API version 2019-05-06-Preview) to accomplish adding data from Cosmos DB when using the Mongo DB API. Where can I find an updated walk through of this? Or has anyone successfully done this?
Around halfway down that page there's a section called Use REST APIs. This section is an up-to-date walkthrough on how to use the REST API to index data in Cosmos DB. Since you're using the MongoDB API for Cosmos DB, make sure when creating the data source to add ApiKind=MongoDb to the connection string.
I'm planning a web application that requires user auth, plus the ability to display data for the users that is stored in a database. No interaction between the users is needed (yet), however the users should be able create objects and query their "own" objects. For example I list 10 book names (10 book objects), and User A should be able to pick a book and create a new object, call it userNoteObject that contains the name of a choosen book and a short note (that he/she writes).
With a basic pseudo code one book object would look like this:
bookObj = {"id": 1, "name": "book name"}
And the user's note object would be something like this:
userNoteObject = {
"id": 1,
"book_name": "random book name",
"owner_userid": "a1b2c3d",
"note": "some random string"
}
With MySQL I would create three tables, one for the users and one for the userNoteObject-s and another for the bookObj-s. Everytime an user saves a note, I would add it to the table that lists the saved notes. Then I can simply query the notes that belongs to X user based on the user's owner_userid. It's a quite simple functionality.
After reading about the possibilities I've made a decision to go with Firebase Auth (because in the future I might need Android and iOS compatibility) + Google Cloud Datastore or Firebase Realtime Database. However I'm a little bit scared about the Realtime Database of Firebase since I've never worked any DB like it. I also like to be able to modify records manually with something like PhpMyAdmin and I assume Cloud Datastore has a visual interface like that.
I'm familiar with JSON handling and creating JSON files, however the JSON based database is strange for me at the moment. Therefore I'm thinking about that maybe the other option would be a better choice. It's very important that I don't need realtime db features. I would load X number of entries into the table that holds the bookObj-s and sometimes update them. I assume when the user creates an userNoteObject it would be saved quickly with both and after deleting an userNoteObject I could refresh the page close to realtime with Datastore. But the table that holds the book objects must be able to store millions of entries easily.
So the important things:
One db table should be able to handle millions of records easily
Easy as possible querying
Visual interface for the DB (if it's possible)
I don't need realtime features like dynamic game score display/saving
Other info:
I would like to use Angular.js
I'm familiar with Python if it can help in something
So my question is that which database would be better for my needs? At the moment I say Datastore, but I'm totally new with these services so I'm not really against the Realtime Database, but Datastore looks more suitable since it has a visual interface. However I'm also not sure that how would work Datastore with Firebase. If there is a third option like combining both, Realtime Database for the objects save by the user and the static objects for Datastore for example, I would love to hear about it too. My overall goal is to be able to write and query the db easy and fast as it's possible and easily use it with Firebase auth.
UPDATE: I just discovered Firebase's Cloud Firestore, so if it can be more useful I could use it.
If you are going to use Firebase I would recommend you use Cloud Firestore instead of either Cloud Datastore or Firebase realtime database. You get the benefits of a real-time database plus a true document based JSON data store. The one downside is that you don`t have a UI to interact with the data. Datastore has one but its not as robust as say PHPMyAdmin. And since these are NoSQL datastores SQL support is pretty limited.
If you really want a true relational back-end you could try Cloud SQL which is basically MySQL running on Google Servers.
For the Firestore console/UI, see https://firebase.google.com/docs/firestore/using-console. Is that the kind of thing you're looking for?
I'm interested in using the Azure CosmosDB for it's Graph capability.
Looking through the docs i saw that it sores graph vertices and edges as JSON documents (with an agreed schema) and so it can be accessed as a plain old DocumentDB.
Taking this into consideration what is the meaning of the API selection you need to make when creating a new instance (link)?
eg :
what am i losing if i create the DB as SQL (DocumentDB) and
manipulating data via the graph part of the client (eg CreateGremlinQuery)
what am i losing if i create the DB as Graph and
manipulating data via the DocumentDB part of the client (eg CreateDocumentAsync)
UPDATE : I am aware of the portal difference (as described below by Jesse Carter). I am interested if this switch drives anything else under the hood in the specific scenario of choosing between SQL(Document DB) vs Graph
There is no functional difference from the perspective of interacting with your Cosmos Collection through either SQL or Graph APIs regardless of which API you choose at creation time.
HOWEVER, there is a difference from the perspective of the Azure portal when navigating your resources. Collections created specifically using the Graph API will get tagged as such and enable additional UI features in the portal for executing Gremlin queries and basic graph visualization.
If you don't care about those querying abilities in the Azure portal, then you're fine to create the collection with either option.
API selection is to avoid confusion for users who are only familier with gremlin and don’t want to learn documentDB.
If you are an advanced user, using both graph and documentDB will give you more power.
Note that we are committed to making the gremlin and documentDB SQL integration even more seamless.
Please drop us a note askcosmosdbgraphapi#microsoft.com, if you want to lean more or set up a time to talk to us.
Jayanta
I would like to know how to send a data to a specific collection into running Solr instance (actually into running SolrCloud instance).
I've started a SolrCloud instance with a bunch of hand-made collections (using SolrCloud Collections REST API) and hence wanted to send some data to a specific collection in order to easily distinct one sort of data from another. Unfortunately I didn't find a way to do that..
It it possible? If it is than how?
The collection is part of the URL you're using when querying any server, usually located under http://localhost:8983/solr/<collection name>/. If you're querying the products collection to retrieve all documents, the url would be http://localhost:8983/solr/products/select?q=*:*. The same goes for updating a collection, POST your content to http://localhost:8983/solr/products/update.
Replace localhost:8983 with one of your own server host/port combinations.
You can also see further examples in the Getting Started with Solr Cloud tutorial.