Deploy
Description
One of the great things about this library is that it can be deployed to serverless environments. It's super small footprint makes it lightning fast to load, even on cold starts.
The basic use case is simple: we simply need to forward request from some API to our read/write models.
Let's give it a shot using Express:
Or we can use GraphQL, which works really nicely with our setup. Mutations map directly to the write model and Queries to the read model.
We're really not doing very much in either of these examples, we simply forward requests from the API to our read or write model. In the case of GraphQL, it's a bit more explicit.
Serverless Framwork
Now replace the contents of serverless.yml
with this:
The AWS Free Tier covers most of these services, but running an ElasticSearch instance on AWS can be expensive. Make sure to run serverless remove
once you're done.
Now let's modify the example above to have it work on AWS Lambda
Examples
Last updated
Was this helpful?