# 웹용 SQL의 미래

> Clean Markdown view of GeekNews topic #4808. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=4808](https://news.hada.io/topic?id=4808)
- GeekNews Markdown: [https://news.hada.io/topic/4808.md](https://news.hada.io/topic/4808.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-08-13T09:58:49+09:00
- Updated: 2021-08-13T09:58:49+09:00
- Original source: [jlongster.com](https://jlongster.com/future-sql-web)
- Points: 11
- Comments: 2

## Topic Body

- absurd-sql : SQL.js(SQLite)로 IndexedDB에서 데이터를 조금씩 읽고 쓰는 형태

ㅤ→ DB데이터를 다른DB에 저장하는 황당한 방식이라 absurd

ㅤ→ IndexedDB는 느리고 기능도 별로 없으나, 이 방식으로는 10배 이상 빠름

- sql.js를 후킹해서 IndexedDB에 데이터를 저장

ㅤ→ 아직 SQLite 네이티브 보다는 50~100x 느림

ㅤ→ 이건 IndexedDB를 이용했지만, Storage Foundation API도 이용 가능할 듯(테스트 예정)

- 장/단점

ㅤ→ 유일한 단점은 gzip된 WASM(SQL.js) 파일을 다운받아서 사용한다는 것

ㅤ→ SQLite의 모든 기능 활용 가능 : 트랜잭션, 완전한 Query 시스템, View, CTE, 트리거, Full-text Search, 캐슁 등

## Comments



### Comment 6306

- Author: xguru
- Created: 2021-08-13T09:59:01+09:00
- Points: 1

제목은 원 저자의 "A future for SQL on the web" 을 그대로 가져왔습니다.

sql.js-httpvfs - GitHub Pages에서 SQLite DB 호스팅 하기 https://news.hada.io/topic?id=4226

이 글이 다양한 영감을 주고 있네요.

편법이지만, W3C가 웹에서는 SQL이 맞지 않다며 중단해버린 WebSQL의 귀환이네요. 사실 개발자한테는 훨씬 편할듯.

### Comment 6324

- Author: kbumsik
- Created: 2021-08-13T21:07:34+09:00
- Points: 1
- Parent comment: 6306
- Depth: 1

특히 일렉트론의 존재때문에 더 그런거 같아요.

웹버전과 똑같이 IndexedDB 쓰다가 일렉트론 버전에서는 SQLite 로 갈아타서 훨씬 살만해졌다는 Notion의 후기도 있더라고요.

https://www.notion.so/blog/faster-page-load-navigation

이런 경험이 웹으로 역수출되는 것 같기도 하고 그러네요.
