mudasobwa

mudasobwa

Creator of Cure

Camarero is a ready-to-use solution to add some JSON API functionality to the existing application or to implement the read-only JSON API from the scratch when more sophisticated (read: heavy) solutions are not desirable. Below is the typical picture of how Camarero is supposed to be plugged in.

It is blazingly fast.

Blogpost with details: https://dev.to/mudasobwa/plug-in-json-api-readonly-webserver-17b4
Hexdocs: Camarero.Catering — camarero v1.0.3

Showing Posts 1 to 7

asummers

asummers

Very neat. We use JSONAPI at work and have a familiar yet different solution! Going to look around the code and see if we can borrow any of the ideas.

mudasobwa

mudasobwa OP

Creator of Cure

Feel free to ask questions if any. The main advantage is statically generated routes and an ability to expose literally any existing storage implementing an Access behaviour.

asummers

asummers

We do dynamic route lookup by matching on the path and finding a resource that has a route corresponding to that name, to get around the static route generation problem. On a sufficiently large resource graph you get thousands and thousands of routes, whereas in our solution you get the 10 or so JSON API routes for GET, PUT, POST, DELETE + the relationship analogs which makes looking at the route definitions more reasonable.

I like the idea of the Access behaviour though, I have to think if that would clean up anything on our end!

dimitarvp

dimitarvp

Even after reading your blog post I still cannot understand what exactly is this library about.

Can you give a more detailed example to demonstrate its strengths? Say you have an app that is mostly server-side rendering Phoenix modules and the team is looking for a cheap way to expose those as a read-only JSON API. Can Camarero help with that? And how exactly?

Maybe I am stupid for not getting it. :smiley:

mudasobwa

mudasobwa OP

Creator of Cure

It’s read-write since v0.4.0 btw :slight_smile:

Well, if there is already Phoenix I honestly do not see any reason to use the library. It’s more about microservices.

You might think about it as about cheap inplace KV-store. In our ecosystem many microservices expose some data. The data is being updated by some internal business rules. At any time it might be queried—here Camarero rocks.

Imagine Redis that might execute code on it’s own—this would be another analogue.

Example from real life: we collect currency rates from many different sources, make some internal computations (check the validness, cross-compute those not exposed by our providers etc.) Camarero serves the up-to-date rates for currency pairs. It’s faster, easier and to some extent more reliable than Redis. The main advantage is we were able to plug it into existing microservice in literally 10 minutes: one simply adds use Camarero to the existing Agent—and voilà. Or, safer and generally better, produces 3 LoCs module that wraps the existing Agent.

dimitarvp

dimitarvp

So it’s adding a JSON layer on top of a very minimal app that doesn’t use higher-level libraries like Phoenix or Absinthe? And it’s more like JSON-API-enabling a K/V store shaped data inside the said minimal app?

If so, your title here is confusing. :confused:

mudasobwa

mudasobwa OP

Creator of Cure

True, save for the app is not required to be minimal by any mean. Not everything in the world deals with user in any way. There are huge applications running on their own and serving billions of requests. They do not need Phoenix ( I doubt I understand how Absinth is ever connected here.)

I will think about how to make the title less confusing.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews