Really fast search functionality SQLite (Turso)?????

I have a lot (150k cities) in my DB and want to build a instantly fast search (the fastest that is possible with minimal effort) is Turso the right thing to consider or are there other options that are better suited for a search functionality?
15 Replies
Neto
Neto•8mo ago
for sqlite with local reads is fine + indexing you can also use browser indexed data to avoid the roundtrips
Neto
Neto•8mo ago
MDN Web Docs
IndexedDB API - Web APIs | MDN
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solut...
FleetAdmiralJakob 🗕 🗗 🗙
fine? can you name other technologies that would be faster?
Neto
Neto•8mo ago
purpose build solutions idk your data shape
FleetAdmiralJakob 🗕 🗗 🗙
but then I have to send the whole search data to the client. I tried that out for fun and it slowed so much things down it comes from a json file (I use a city dataset from the internet/api and put it into my db)
Neto
Neto•8mo ago
then just indexing is fine but you should benchmark either way
FleetAdmiralJakob 🗕 🗗 🗙
ok, in my benchmark with which I will benchmark the different technologies which ones do you think I should benchmark?
Neto
Neto•8mo ago
local db / external db what % of the total request is the round trip? with sqlite you can get < 1ms requests (kinda but you get the idea) the performance of the query on a avg dataset after you have the two numbers, you can check the one that makes more sense because if with sqlite you get faster requests to the db but slower queries, is it worth to add the external db with faster query?
FleetAdmiralJakob 🗕 🗗 🗙
I'm hosting my Next.js app on Vercel, so I will need to host the db somewhere else Right?
Neto
Neto•8mo ago
yep you cant use the file system on lambdas or edges you need a render source (where the lambda is located) close to the database you can use cloudflare d1 but its too much of a fuckery to be worth it
FleetAdmiralJakob 🗕 🗗 🗙
interesting. sooo?
Neto
Neto•8mo ago
benchmark stuff its boring but you dont have that much options when using vercel
FleetAdmiralJakob 🗕 🗗 🗙
ok, my options are?
Neto
Neto•8mo ago
use a sql database close to where the lambdas are running make sure the queries being executed are fully optimized
Want results from more Discord servers?
Add your server