-
Notifications
You must be signed in to change notification settings - Fork 1
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
Is the couchbase adapter gone? #1
Comments
Telepat started with Couchbase (and Redis came in after, but Redis is irreplaceable at the moment and it's only used for storing more volatile things). When I started working on the database adapters we picked ElasticSearch as it was more suited for our needs (more specifically, complex queries). We used to run ES and CB at the same time (with XDCR), ES for more complex subscription filters but the XDCR plugin from ES wasn't doing so great and we ultimately decided to stick with ES for a while replacing CB. At the moment we only have developed the ElasticSearch adapter. Couchbase has the "query" part we need, but at the time when we started Telepat it was still in Developer Preview (or RC, I don't remember). We will eventually take a look at it later. |
Hi @gebrits, Just a little more info on this. Starting with 0.2.4, we've implemented the adapter model, where Elasticsearch can be swapped out for any other DB, depending on needs on workload type. Previously, both Couchbase and Elasticsearch were used with overlapping functionality. This was both tough to manage and confusing. We chosen to create the Elasticsearch adapter first, as we felt it was the best multipurpose system to support. In time, we plan to add Couchbase, MongoDB and other adapters. Any thoughts / contributions on this are really appreciated! |
@andreimarinescu If I understand correctly, the idea is to have 1 adapter or the other? Could I persuade you guys to consider having multiple adapters at the same time? IMO one of the big positives of a CQRS setup that Telepat uses, involving Kafka as an event broker, etc. is the ability to have multiple Kafka consumers (i.e.: the stores/adapters) be updated from a single stream of updates served by Kafka. Essentially, a polyglot architecture, where you as a user could choose to go with, say:
Sure, with the above config there's overlap of the type of queries that can be served, but all have a different cost/performance tradeoff. I.e.: multiGet on elasticsearch is an 1 or 2 orders of magnitude slower than couchbase, etc. Then on the query side, you would need to have some configurable reverse proxy / level of indirection to declare that all (multi)gets go to Couchbase, while other queries go to Elasticsearch, etc. This doesn't seem too difficult though. Please tell me I'm not chasing a pipedream here :) P.s.: As I understand it Redis in the current architecture isn't an adapter in the above sense but is treated as special in some way. Care to elaborate on the why? |
@gebrits I'll answer to some of your questions/suggestions, the rest will be covered by @andreimarinescu. Redis in the current architecture is used for "a part" of our database, mainly the database that's the most volatile: user subscriptions, user devices and operation deltas (objects that represent changes in the persistent database, written by aggregation workers, read/removed by write workers). We need this component to be as fast as possible and we thought keeping it on Redis would suffice, instead of allowing too much liberty in choosing another NoSQL which could potentially degrade performance since this component is very sensitive to changes. Another reason why we chose Redis is because it has data structures which are extremely useful for us and very suited for our data model. There are 3 types of databases used in Telepat:
|
@Mayhem93 Thanks for clearing up Redis' role. Makes sense. |
@andreimarinescu : friendly ping |
Actually, this kind of setup is exactly what we wanted to do in the first place, @gebrits, it's really nice to see that we're not alone in looking to build such an architecture. One of the main issues that we've encountered in this approach is keeping everything in sync. The thing I liked about Couchbase was its XDCR capabilities, that should have, in theory, supported things like replicating from CB to Elasticsearch. In practice, we've found the link to be very buggy and unstable and this was the driver that brought us to this single-database adapter approach (while keeping the possibility of switching out an adapter for another). The only way I can think of right now of keeping all persistence engines in sync, irrespective of the actual underlying system (elastic, mongo, couchbase or any other db) was doing writes on all adapters and doing reads selectively depending on purpose. What are your thoughts on this? |
@andreimarinescu: great to know this is still on the radar! I don't believe syncing the various databases (ES, Couchbase, etc.) is a big problem. After all, in a distributed ES or CB setup results are only eventually consistent anyhow (both choose A and P over C in CAP). Therefore, being 'in-sync' can never beat that upper threshold. In other words, the total system as a whole will be eventually consistent, with a 'consistency lag' that's equal to the ability of the slowest adapter (being either ES or CB) to get in a consistent state. For sake of clarify let me try to describe how I see the different roles of the system: First a diagram by Martin Kleppmann (as part of reference 6, explained more later) that says it all:
I hope this post didn't come of as too pedantic. I'm just pretty excited with the possibilities. I really believe this is a great architecture. I've just never came around to building it myself. I'd be over the moon if you guys consider picking this up. More than happy to discuss more.
|
hi @andreimarinescu. Just checking in if you've seen above. Thanks |
Hi, Geert, Apologies for the delayed responses. The reason for this is that we've been I've been delaying this discussion until then, as the results of our work First of all, a big thank you for your detailed post. These kinds of Thanks again!
|
Great to hear @andreimarinescu. Looking forward to said blogpost (and later reply to this issue.). This could become awesome! |
hi @andreimarinescu: any updates already? |
If I remember correctly Telepat used to have adapters for both Couchbase and Elasticsearch. Where can I find the Couchbase adapter?
The text was updated successfully, but these errors were encountered: