Coder Social home page Coder Social logo

haukevb / lucene-serverless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arsenyyankovsky/lucene-serverless

0.0 0.0 0.0 120.79 MB

A proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework.

License: MIT License

Java 91.47% Groovy 8.53%

lucene-serverless's Introduction

Lucene Serverless

This project demonstrates a proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework.

✔️ No servers

✔️ No fixed costs

✔️ Low (250-300ms) cold starts

⚠️ Better deletion policy is required. Right now old segment files are not deleted as a simple workaround to handle concurrent reads and writes

ℹ️ Cost can be controlled via several factors:

  • EFS' Elastic throughput mode cost more $$, but scales better up and down
  • Lambda's Provisioned Concurrency provides faster, more consistent first request times but costs more $$
  • Lambda memory is kept ~256mb, tune based on index size and observed speeds. Note: vCPU is allocated proportional to memory.

Please note that the project is not ready for production since I haven't tested it under a prolonged load and to be honest interfaces need to be nicer.

Read the blog post about it here

Prerequisites

Run it

  1. Replace region, vpc id and subnets in the serverless.yml file

  2. Deploy the stack sls deploy

  3. Don't forget to remove it if you're not planning to use it sls remove

Index a document

URL: https://<api-id>.execute-api.<region>.amazonaws.com/dev/index

HTTP method: POST

Example request body:

{
  "indexName": "books",
  "documents": [
    {
      "name": "The Foundation",
      "author": "Isaac Asimov"
    }
  ]
}

Query documents

URL: https://<api-id>.execute-api.<region>.amazonaws.com/dev/query

HTTP method: POST

Example request body:

{
   "indexName": "books",
   "query": "author:isaac"
}

Example response body:

{
  "totalDocuments": "1",
  "documents": [
    {
      "author": "Isaac Asimov",
      "name": "The Foundation"
    }
  ]
}

Build native image

./mvnw clean package

lucene-serverless's People

Contributors

arsenyyankovsky avatar gliptak avatar tombarr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.