0

In one of our apps we need to introduce a feature of users being able to choose friends, see friends activity, etc. So far we use CosmosDb container with SQL API (for things app does beside this social network aspect).

I am wondering is there a reason not to model it with SQL API but to go strictly with Gremlin?

I’ve seen examples on Microsoft site about modeling basic social network done with ordinary SQL API but i am not sure if i am missing something that would bite me down the road in a case not going with Gremlin?

dee zg
  • 13,793
  • 10
  • 42
  • 82

1 Answers1

1

You should be safe in choosing either. From docs:

Each API operates independently, except the Gremlin and SQL API, which are interoperable.

The stored data is JSON in both cases.

More on choosing an API.

Noah Stahl
  • 6,905
  • 5
  • 25
  • 36
  • does that mean i could use both SDKs from my application against the same container regardless of the fact how the container was initially created (SQL API or Gremlin)? – dee zg Oct 01 '20 at 16:55
  • I think you'd want to create as Gremlin then use the SQL endpoint when running a SQL SDK client. See comment here: https://stackoverflow.com/questions/51779501/how-do-you-connect-to-a-cosmos-db-primarily-updated-via-sql-api-using-gremlin – Noah Stahl Oct 01 '20 at 17:09
  • Thanks for the link! hm...that's pretty much exactly what we want to avoid since we already have an existing application for which we want to introduce social network functions. i don't get it from that link, is it just a recommendation or is it a must to create container with Gremlin API first? and, if one doesn't do it that way, what are the consequences? what are the problems with going SQL API first? – dee zg Oct 01 '20 at 17:15
  • I'm not sure, having not tried this. Probably best to try both ways if just to get familiar with differences. – Noah Stahl Oct 01 '20 at 17:21