미분류

The Couchbase Java SDK 2.1.0 arrived!

5 분 읽기

On behalf of the whole team I’m happy to report that we’ve finally released the 2.1.0 version of the Couchbase Java SDK. Compared to the 2.0 branch it brings lots of new features as well as a myriad of smaller enhancements and bug fixes. It is the result of the incredible valuable feedback that we received from more and more users that are upgrading their applications as well as new users exploring reactive data access patterns.

In this blog post we’ll be focussing on the new features. If you want to check out the full list of changes, please refer to the Release Notes. If you have questions you can ask them on the 포럼 and if you think you’ve hit an issue, please file it on our JIRA.

Oh and by the way, we’ve also pushed some changes that should improve the performance under certain workloads. Even if there are no benchmarks in this blog post, there is a good chance that you’ll see improved latency and throughput compared to 2.0.3.

Getting the SDK

As always, we are distributing the GA release from Maven Central and as an archive.

N1QL DP4 Support

This release brings official (yet still experimental) support for N1QL DP4. It is not backwards compatible with DP3 because the underlying streaming responses have changed quite a bit. Highlights include:

  • Simple, parametrized and prepared Statements.
  • Extended query options like timeouts and scan consistency.
  • Enhanced synchronous and asynchronous QueryResults for more flexible error handling.

Simon wrote a great blog post two weeks ago, so if you want to learn more you should check it out here.

Spatial View Query Support

In addition to regular View query support, we’ve added support for spatial View queries. Note that spatial query support is still experimental in Couchbase Server 3.0.2, but will soon be officially supported. Also, the implementation in 2.1.0 is not compatible with older Couchbase Server releases because the response format has slightly changed.

As a quick example, imagine you are storing shop information:

Based on this data format you can define a spatial view which will not only index the latitude and longitude, but also its opening hours:

You can then query it in all three dimensions, by providing a bounding box for the location and also a time range when the shop should be open:

You can expect to see more blog posts and examples coming in the near future as we approach a fully supported version on the server side.

Idle Socket Heartbeats/Keepalive

When there is no load going through the client to a specific socket, there is a chance that a firewall (or something else) is cutting off the connection because it thinks it is stale. In order to prevent this, the SDK now sends a heartbeat message every 30 seconds over idle sockets. These messages are of course not sent if regular traffic is flowing in this interval.

You can change the interval on the environment and if you want to disable it just set it to 0.

Pluggable Retry Strategies

A heavily requested feature was to provide ways to fail fast if the request cannot be dispatched immediately. For example the time between a node fails and it is failed over in the cluster a subset of the documents cannot be written (all that target the specific partitions on this node). By default, the SDK will retry the operation a bit later and eventually it will time out on the caller side.

The new fail fast mode instead would immediately cancel the request, providing faster feedback loops to the caller who then can determine if the request should be retried or not. This new strategy can be enabled on the environment like this:

In addition, we made the retry strategy pluggable so you can even define your own. Since this is quite advanced it is not covered in this blog post, but you can expect more information soon in the documentation on that topic. In the meantime if you are curious, just check out the (quite simple) strategies that ship with the SDK.

Finally, a configurable “maximum request lifetime” has been added to the environment which is utilized by the default “best effort” strategy to determine if the request should still be retried or is cancelled instead. This is needed in order to avoid requests circling around for a very long time and take up precious slots in the RingBuffers.

Subscribable Event Bus

A generic event bus has been added to the environment which is utilized by the core and the client to publish events to potential application subscribers. Currently, only Bucket open/close and Node connect/disconnect events are published, but in the future we plan to greatly extend this by also collecting and publishing performance metrics and other types of events and warnings.

It is very easy to subscribe and react to those kind of events, thanks to RxJava and the streaming nature of our Observables:

DNS SRV Bootstrap

It is now possible to fetch the list of bootstrap nodes through a DNS SRV record. This allows system administrators to centralize their bootstrap node list config in a very easy manner. It needs to be enabled on the environment to make it work. You can find more information 여기.

What’s next?

While we already have many ideas for a 2.2 release, we are now taking a step back and are planning to further stabilize this branch with bugfix releases as needed. In addition, we are shifting the focus to enhanced framework and “up the stack” integration – so stay tuned in the next couple of weeks for blog posts and announcements!

이 기사 공유하기

작가

마이켈 니칭거(Michael Nitschinger)는 카우치베이스(Couchbase)의 수석 소프트웨어 엔지니어입니다. 그는 JVM에서 최초의 완전한 리액티브 데이터베이스 드라이버 중 하나인 카우치베이스 자바 SDK의 아키텍트이자 메인테이너입니다. 또한 카우치베이스 스파크 커넥터를 저술하고 유지 관리하고 있습니다. 마이켈은 오픈 소스 커뮤니티에서 활발히 활동하고 있으며, RxJava 및 Netty와 같은 다양한 다른 프로젝트에도 기여하고 있습니다.

댓글 남기기

카우치베이스 카펠라를 시작할 준비가 되셨나요?

개발 시작하기

NoSQL을 탐색하고, 리소스를 찾아보고, 튜토리얼을 시작하려면 개발자 포털을 확인하세요.

카펠라 프리 사용하기

단 몇 번의 클릭으로 카우치베이스(Couchbase)를 직접 체험해 보세요. Capella DBaaS는 시작하기 가장 쉽고 빠른 방법입니다.

연락해

Couchbase 제품군에 대해 더 알고 싶으신가요? 저희가 도와드리겠습니다.