DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How to Automate Restful APIs Using Jayway Library
  • Developing REST APIs
  • How to Develop an ASP.NET Web Service Application with WCF Service
  • Be the BEST at Your REST API!

Trending

  • Building AI Applications With Java and Gradle
  • Time Series Analysis: VAR-Model-As-A-Service Using Flask and MinIO
  • JWT Token Revocation: Centralized Control vs. Distributed Kafka Handling
  • Unleashing the Power of Microservices With Spring Cloud
  1. DZone
  2. Data Engineering
  3. Data
  4. RavenDB Multi GET support

RavenDB Multi GET support

Oren Eini user avatar by
Oren Eini
·
Aug. 20, 11 · News
Like (0)
Save
Tweet
Share
3.53K Views

Join the DZone community and get the full member experience.

Join For Free

one of the annoyances of http is that it is not really possible to make complex queries easily. to be rather more exact, you can make a complex query fairly easily, but at some point you’ll reach the uri limit, and worse, there is no easy way to make multiple queries in a single round trip.

i have been thinking about this a lot lately, because it is a stumbling block for a feature that is near and dear to my heart, the future queries feature that is so useful when using nhibernate.

the problem was that i couldn’t think of a good way of doing this. well, i could think of how to do this quite easily, to be truthful. i just couldn’t think of a good way to make this work nicely with the other features of ravendb.

in particular, it was hard to figure out how to deal with caching. one of the really nice things about ravendb’s restful nature is that caching is about as easy as it can be. but since we need to tunnel requests through another medium for it to work, i couldn’t figure out how to make this work in a nice fashion. and then i remembered that rest didn’t actually have anything to do with http itself, you can do rest on top of any transport protocol.

let us look at how requests are handled in ravendb over the wire:

get http://localhost:8080/docs/bobs_address

http/1.1 200 ok

{
  "firstname": "bob",
  "lastname": "smith",
  "address": "5 elm st."
}

get http://localhost:8080/docs/users/ayende

http/1.1 404 not found

as you can see, we have 2 request / reply calls.

what we did in order to make ravendb support multiple requests in a single round trip is to build on top of this exact nature using:

post http://localhost:8080/multi_get

[
   { "url": "http://localhsot:8080/docs/bobs_address", "headers": {} },
   { "url": "http://localhsot:8080/docs/users/ayende", "headers": {} },
]

http/1.1 200 ok

[
  { "status": 200, "result": { "firstname": "bob", "lastname": "smith", "address": "5 elm st." }},
  { "status": 404 "result": null },
]

using this approach, we can handle multiple requests in a single round trip.

you might not be surprised to learn that it was actually very easy to do, we just needed to add an endpoint and have a way of executing the request pipeline internally. all very easy.

the really hard part was with the client, but i’ll touch on that in my next post.

Requests Database Trip (search engine) Cache (computing) Pipeline (software) Protocol (object-oriented programming) REST POST (HTTP) Build (game engine) Web Protocols

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Automate Restful APIs Using Jayway Library
  • Developing REST APIs
  • How to Develop an ASP.NET Web Service Application with WCF Service
  • Be the BEST at Your REST API!

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: