2

I don't know much about how Google Chrome or SQLite works, but I know that Chrome makes heavy use of threads (I think a thread per tab). Additionally, I know that SQLite suggests to use a client-server database if parallel access is required. I'm not sure, but I assume Chrome uses SQLite like Firefox does, to save cookies.

Therefore, I think it's quite likely that parallel access to the database happens (because every Tab needs the ability to save cookies).

Therefore, it doesn't make sense to me why Google Chrome uses SQLite.

asked Apr 4, 2016 at 10:22
3
  • 2
    Saving cookies is a rare operation, so the cost of thread synchronization doesn't matter much. Commented Apr 4, 2016 at 10:23
  • 1
    You will normally only use one tab at any given time even if you have opened hundreds. Also there is not that much writing going on and tabs rarely share the same data. So not much risk of conflicts. Commented Apr 4, 2016 at 10:27
  • why the downvote? Commented Apr 4, 2016 at 14:13

1 Answer 1

5

Because SQLite is a simple self-contained library, and because most SQLite databases (on an Android tablet or Google Chrome computer) are very probably accessed by only one (or a few) processes or threads at a time. (Accessing or saving cookies happens rarely in a browser, probably at most on each page reload, and they are probably also cached in the browser).

The alternative would be to require these systems to have an always running DBMS server (e.g. PostGreSQL, MariaDB, MongoDB or something else). This might be a burden, and is adding a new single point of failure and perhaps more security & reliability concerns (a leak or failure in the DBMS server might impact every application; some heavy SQL request might slow down the DBMS so impact other applications; etc...).

At last, there might also be licensing issues (perhaps Google lawyers prefer the SQLite license to the MariaDB one...).

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.