Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comsos DB as storage backend #1667

Closed
marius-stanescu-archive360 opened this issue Jul 18, 2019 · 9 comments · Fixed by #1675
Closed

Comsos DB as storage backend #1667

marius-stanescu-archive360 opened this issue Jul 18, 2019 · 9 comments · Fixed by #1675
Labels
area/storage help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@marius-stanescu-archive360

Could you also add Cosmos DB as a storage backend?
Related to #638 and #1105.

@jpkrohling
Copy link
Contributor

We have already Elasticsearch, Cassandra, Badger and in-memory in the main repository. To support other storage backends, we have support for storage plugins (#1461). We might be missing the documentation of how to develop one such plugin, but the PR introducing that feature also added an example:

var configPath string
func main() {
flag.StringVar(&configPath, "config", "", "A path to the plugin's configuration file")
flag.Parse()
if configPath != "" {
viper.SetConfigFile(path.Base(configPath))
viper.AddConfigPath(path.Dir(configPath))
}
v := viper.New()
v.AutomaticEnv()
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
opts := memory.Options{}
opts.InitFromViper(v)
grpc.Serve(&memoryStore{store: memory.NewStore()})
}
type memoryStore struct {
store *memory.Store
}
func (ns *memoryStore) DependencyReader() dependencystore.Reader {
return ns.store
}
func (ns *memoryStore) SpanReader() spanstore.Reader {
return ns.store
}
func (ns *memoryStore) SpanWriter() spanstore.Writer {
return ns.store
}

Right now, we are not hosting plugins in the main repository, but given enough traction, we can certainly host it at this organization.

As such, I'm closing this issue, but do let us know in case you develop a plugin for Cosmos DB!

@omerlh
Copy link

omerlh commented Jul 18, 2019

Hey, @marius-stanescu I started to play a bit with the GRPC plugin API in dotnet, should be pretty simple to write a plugin. Is that something you're interested at?

@yurishkuro
Copy link
Member

I am going to re-open this and link from #638. We can close once we have a clear answer.

I was under impression that CosmosDB has a wire protocol compatible with Cassandra, is it not the case?

@yurishkuro yurishkuro reopened this Jul 18, 2019
@yurishkuro yurishkuro added the help wanted Features that maintainers are willing to accept but do not have cycles to implement label Jul 18, 2019
@yurishkuro
Copy link
Member

yurishkuro commented Jul 18, 2019

There are some discussions about CosmosDB here: #1105 and #1472

@yurishkuro
Copy link
Member

yurishkuro commented Jul 18, 2019

Pining @sagaranand015 @nutharsh @486 @lukasmrtvy who previously commented on issues related to CosmosDB - did anyone get it to work?

@sagaranand015
Copy link
Contributor

@yurishkuro : Checked the cosmosDb connection with cassandra API and as mentioned in #1105, it works by removing the SnappyCompressor in Cassandra connection. Also, the keyspace creation using templates do not work because of the commas(which Cosmos db does not support)

How do you think we should proceed here? A Plugin approach to Cosmos db or a storage backend altogether?

Also, should the compressor be forced or should it be driven by config? (This seems like a change we can make before going to plugin/storage backend development).

@yurishkuro
Copy link
Member

@sagaranand015 these changes sound very minor. I don't think it makes sense to treat it as a new storage backend, just parameterize the existing code to allow to control for these variations.

@sagaranand015
Copy link
Contributor

sagaranand015 commented Jul 21, 2019

@yurishkuro :
So, this boils down to 2 action items:

  1. Make the Cassandra Compressor drive from config. How about adding --cassandra.compression=(True/False) config from flags? Default being SnappyCompressor if --cassandra.compression is true(true by default) (Issue: Do not force cassandra protocol's compressor #1105)
  2. Change the Storage backend documentation to point out the following changes for CosmosDB connection with Cassandra API:
    a. --cassandra.compression flag to be false
    b. change the generated keyspace templates to remove unsupported commas.

If the above sounds good, will raise a PR for the same. Please let me know. Thanks

@yurishkuro
Copy link
Member

@sagaranand015 yes, sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants