diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
| commit | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch) | |
| tree | 0dd8b084480983cf9f9680e8aedb92782a921b13 /files/he/web/api/indexeddb_api | |
| parent | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff) | |
| download | translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2 translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip | |
initial commit
Diffstat (limited to 'files/he/web/api/indexeddb_api')
| -rw-r--r-- | files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html | 141 | ||||
| -rw-r--r-- | files/he/web/api/indexeddb_api/index.html | 165 |
2 files changed, 306 insertions, 0 deletions
diff --git a/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html b/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html new file mode 100644 index 0000000000..094ee01378 --- /dev/null +++ b/files/he/web/api/indexeddb_api/browser_storage_limits_and_eviction_criteria/index.html @@ -0,0 +1,141 @@ +--- +title: מגבלות האחסנה של הדפדפן וקריטריונים לפינוי +slug: Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria +tags: + - Database + - IndexedDB + - LRU + - אחסנה + - בדיס נתונים + - מגבלה + - פינוי + - צד הלקוח +translation_of: Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria +--- +<div>{{DefaultAPISidebar("IndexedDB")}}</div> + +<div>קיימות מספר טכנולוגיות רשת המאחסנות נתונים מסוג זה או אחר בצד הלקוח (כלומר, על הדיסק המקומי שלך). התהליך בו הדפדפן מחשב כמה מקום להקצות לאחסנת מידע רשת ומה למחוק כאשר מגיעים לגבול אינו פשוט, ונבדל בין דפדפנים.</div> + +<div>מאמר זה מתאר איך דפדפנים מכריעים איזה תוכן מקומי לטהר, ומתי בסדר לשחרר חלל אחסנה מקומי.</div> + +<p class="summary"></p> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: המידע שלהלן אמור להיות מדוייק במידה מספקת עבור רוב הדפדפנים המודרניים, אך פרטי דפדפן נקראים כאשר ידועים. אופרה וכרום צריכים לפעול באותה דרך בכל המקרים, <a href="http://www.opera.com/mobile/mini">Opera Mini</a> (תצוגת צד שרת, שעדיין מבוסס על תגובה מהירה) אינו מאחסן כל נתונים שהם בצד הלדוח.</p> +</div> + +<h2 id="אלו_טכנולוגיות_משתמשות_באחסנת_הנתונים_של_הדפדפן">אלו טכנולוגיות משתמשות באחסנת הנתונים של הדפדפן?</h2> + +<p>בפיירפוקס, הטכנולוגיות הבאות עושות שימוש באחסנת הנתונים של הדפדפן לאחסן נתונים כאשר יש צורך. הגדרנו עבורם את המושג "לקוחות מכסה" בהקשר זה:</p> + +<ul> + <li><a href="/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a></li> + <li>שמירת <a href="http://asmjs.org/">asm.js</a> במטמון</li> + <li><a href="/en-US/docs/Web/API/Cache">Cache API</a></li> + <li>עוגיות</li> +</ul> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: בפיירפוקס, <a href="/en-US/docs/Web/API/Web_Storage_API">אחסנת הרשת</a> בקרוב תתחיל להשתמש גם היא באותם כלי ניהול שטחי אחסון , כמתואר במסמך זה.</p> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: במצב גלישה פרטית, רוב אחסנת המידע אינה נתמכת. נתוני אחסון מקומיים ועוגיות עדיין מאוחסנים, אך הם ארעיים - הנתונים נמחקים כאשר סוגרים את חלון אך הם ארעיים — הנתונים נמחקים עם סגירת חלון הגלישה הפרטית האחרון.</p> +</div> + +<p>"זמן הגישה האחרון" של מקורות מתעדכן כאשר כל אחד מאלה מופעל/מושבת — פינוי מקורות ימח' נתונים עבור כל לקוחות המכסה.</p> + +<p>בכרום/אופרה, ממשק פיתוח היישומים של ניהול המכסות מטפל בניהול עבור <a href="/en-US/docs/Web/HTML/Using_the_application_cache">AppCache</a>, <a href="/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a>, WebSQL, ו-<a href="/en-US/docs/Web/API/File_System_API">File System API</a>.</p> + +<h2 id="טיפוסים_שונים_של_אחסנת_נתונים">טיפוסים שונים של אחסנת נתונים</h2> + +<p>גם באותו הדפדפן, שימוש באותה שיטת אחסון, קיינות מחלקות שונות של אחסנת נתונים להבין. פרק זה ידון במפר מהם שייתכן ויימצאו בדפדפנים שונים.</p> + +<p>אחסנה מופיעה במספר טיפוסים:</p> + +<ul> + <li>קבועה : אלה הנתונים שבכוונתנו לשמור בהישג יד לטווח רחוק. הם יפונו אך ורק על פי בחירת המשתמש/ת (לדוגמה, בפיירפוקס תוכלו לבחור למחוק את כל הנתונים המאוחסנים ממקורות נבחרים על ידי גישה ל"העדפות" ושימוש באפשרויות תחת <em>"פרטיות ואבטחה-> עוגיות ונתוני אתרים"</em>).</li> + <li>זמנית: אלו נתונים שאינם צריכים להישמר לזמן רב כל כך. הם יפונו תחת מדיניות השימוש המאוחר ביותר ({{anch("LRU policy")}}) כאשר כמות הנתונים תגיע ל- {{anch("מגבלות האחסנה")}}.</li> +</ul> + +<p>בפיירפוקס, כשאשר נעשה שימוש באחסנה קבועה,, ניתן למשתמש/ת חלון ממשק משתמש קופץ להתריע לו/ה כי הנתונים יישמרו, ובחלון תישאל השאלה אם המשתמש/ת מסכים/ה לכך. אחסנת נתונים זמנית אינה מעוררת כל פנייה למשתמש/ת.</p> + +<p>כברירת מחדל האחסנה היא זמנית; מפתחים יכולים לבחור להשתמש באחסנה קבועה לאתרים שלהם באמצעות השיטה {{domxref("StorageManager.persist()")}} הזמינה ב-<a href="/en-US/docs/Web/API/Storage_API">Storage API</a>.</p> + +<h2 id="היכן_מאוחסנים_הנתונים">היכן מאוחסנים הנתונים?</h2> + +<p>כל טיפוס אחסנה מייצג מאגר נפרד. להלן המיפוי האקטואלי ל,תיקיות תחת פרופיל הפיירפוקס של המשתמש/ת (דפדפנים אחרים עשויים להיות מעט שונים):</p> + +<ul> + <li><code><profile>/storage</code> — התיקייה הראשית של הרמה הגבוהה ביותר לאחסון מתוחזקת על ידי מנהל המכסות (ראו להלן)</li> + <li><code><profile>/storage/permanent</code> — תיקיית מאגר הנתונים הקבועים</li> + <li><code><profile>/storage/temporary</code> — תיקיית מאגר הנתונים הזמניים</li> + <li><code><profile>/storage/default</code> — מאגר ברירת המחדל של הנתונים</li> +</ul> + +<div> +<div class="note"> +<p><strong>לתשומת לבך</strong>: אחרי שהוצג ה <a href="/en-US/docs/Web/API/Storage_API">Storage API</a>, התיקייה "permanent" יכולה להיחשב מיושנת; התיקייה "permanent" מאחסנת רק את בסיסי הנתונים מהטיפוס הקבוע IndexedDB. לא משנה אם מצב התיבה הוא "best-effort" או "persistent" — נתונים נשמרים תחת <profile>/storage/default.</p> +</div> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: בפיירפוקס , ניתן למצוא את תיקיית הפרופיל שלך על ידי הכנסת <code>about:support</code> בשורת ה- URL , ולחיצה על הכפתור פתיחת ספרייה (למשל <em>Show ב- Finder</em> על Mac OS X) על יד הכותרת <em>Profile Folder</em> .</p> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: אם תחפשו במידע השמור בתיקיית הפרופיל , ייתכן שתמצאו תיקייה רביעית:: <code>persistent</code>. בעיקרות, שמה של התיקייה <code>persistent</code> שונה ל-<code>permanent</code> בשלב מסויים בעבר כדי ששדרוגים/מעברים יהיו פשוטים לביצוע.</p> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: אל למשתמשים להוסיף תיקיות וקבצים משלהם תחת <code><profile>/storage</code>. זה יגרום לאתחולי אחסנה להיכשל; לדוגמא, {{domxref("IDBFactory.open()", "open()")}} יגרום לאירוע שגיאה.</p> +</div> + +<h2 id="מגבלות_האחסנה">מגבלות האחסנה</h2> + +<p>שטח האחסנה המירבי של הדפדפן הוא דינמי — הוא מבוסס על גודל הדיסק הקשיח. <strong>הגבול הגלובלי</strong> מחושב כ-50% מהשטח הפנוי על הדיסק. בפיירפוקס, כלי פנימי של הדפדפן הקרוי Quota Manager כוקב אחרי גודל חלל הדיסק שכל מקור מנצל עד תום, ומוחק נתונים אם יש צורך בכך.</p> + +<p>כך שאם נפח הדיסק הקשיח שלך הוא 500 ג"ב, אזי שטח האחסון לדפדפן הינו 250 ג"ב. במקרה של חריגה, מופעל תהליך בשם <strong>origin eviction</strong>, המוחק את כל שווי הנתונים של המקור עד שכמות הנתונים המאוחסנת חוזרת אל מתחת לגבול. אין כל אפקט של קיצוץ הבא למחוק חלקים של מקורות — מחיקת בסיס נתונים של מקור עלולה ליצור בעיות של חוסר עקביות.</p> + +<p>קיים גם גבול הקרוי <strong>group limit</strong> — הוא מוגדר כ- 20% מהגבול הגלובלי, אך יש לו מינימום של 10 מ"ב ומקסימום של 2 ג"ב. כל מקור הוא חלק מקבוצה (קבוצת מקורות). קיימת קבוצה לכל דומיין eTLD+1. לדוגמה:</p> + +<ul> + <li><code>mozilla.org</code> — group1, origin1</li> + <li><code>www.mozilla.org</code> — group1, origin2</li> + <li><code>joe.blogs.mozilla.org</code> — group1, origin3</li> + <li><code>firefox.com</code> — group2, origin4</li> +</ul> + +<p>בקבוצה זו, <code>mozilla.org</code>, <code>www.mozilla.org</code>, ו-<code>joe.blogs.mozilla.org</code> יכולים במצטבר להשתמש במקסימום 20% מהגבול הגלובלי. <code>ל- firefox.com</code> יש מקסימום בנפרד של 20%.</p> + +<p>שני הגבולות מגיבים בצורה שונה כשמגיעים לגבול:</p> + +<ul> + <li>לגבול הקבוצתי קוראים גם "גבול קשה": הוא אינו גורם לפינוי מקורות.</li> + <li>הגבול הגלובלי הוא "גבול רך" מכיוון שאין סיכוי ששטח כלשהו ישוחרר והפעולה יכולה להימשך,</li> +</ul> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: הגבול הקבוצתי אינו יכול להיות יותר מהגבול הגלובלי, , למרות מינימום הגבול הקבוצתי הנזכר לעיל . אם הינך במצב של מעט זיכרון באמת כשנניח שהגבול הגלובלי הוא, 8 מ"ב, אז גם הגבול הקבוצתי יהיה 8 מ"ב.</p> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: כאשר חורגים מהגבול הקבוצתי, או אם פינוי המקור אינו יכול לשחרר מספיק שטח, הדפדפן יצא עם החריגה <code>QuotaExceededError</code>.</p> +</div> + +<div class="note"> +<p><strong>לתשומת לבך</strong>: בכרום מכסת האחסנה הרכה והקשה השתנתה מאז <strong>M66</strong>. מידע נוסף ניתן למצוא <a href="https://chromium.googlesource.com/chromium/src/+/refs/heads/master/storage/browser/quota/quota_settings.cc#68">כאן.</a></p> +</div> + +<h2 id="מדיניותLRU">מדיניותLRU</h2> + +<p>כאשר שטח הדיסק מתמלא עד תום, מנהל המכסות מתחיל לנקות נתונים בהתבסס על מדיניות LRU — המקור בו נעשה שימוש רחוק ביותר מלאחרונה ימחק קודם, ואחר כך זה הבא אחריו, עד שהדפדפן כבר אינו חורג מהגבול.</p> + +<p>אנו עוקבים אחרי "זמן הגישה האחרון" עבור כל מקור באמצעות אחסנה זמנית. כאשר מושג הגבול הגלובלי עבור אחסנה זמנית (עוד אודות הגבול מאוחר יותר), אנו מנסים למצוא את כל המקורות שלא היו בשימוש (iכלומר אלה ללא לשוניות.ישומים פתוחים הממשיכים לשמור מאגרי מידע פתוחים). אלה ממויינים בשלב זה על פי "זמן הגישה האחרון". המקור שהיה בשימוש הכי רחוק מלאחרונה נמחקים בשלב זה עד שיש מספיק מקום להגשים את הבקשה שגרמה לפינוי המקור.</p> + +<h2 id="ראו_גם">ראו גם</h2> + +<ul> + <li><a href="http://www.html5rocks.com/en/tutorials/offline/quota-research/">Working with quota on mobile browsers</a>, by<a href="http://blog.agektmr.com" title="Eiji Kitamura"> Eiji Kitamura.</a> A detailed analysis of client-side storage on mobile browsers.</li> + <li><a href="https://developers.google.com/web/updates/2011/11/Quota-Management-API-Fast-Facts">Quota Management API: Fast Facts</a>, by<a href="http://blog.agektmr.com" title="Eiji Kitamura"> Eiji Kitamura.</a> A look at the Quota Management API in Chrome/Blink (which should include Opera, too).</li> +</ul> diff --git a/files/he/web/api/indexeddb_api/index.html b/files/he/web/api/indexeddb_api/index.html new file mode 100644 index 0000000000..957b6f96c5 --- /dev/null +++ b/files/he/web/api/indexeddb_api/index.html @@ -0,0 +1,165 @@ +--- +title: IndexedDB API +slug: Web/API/IndexedDB_API +tags: + - API + - Advanced + - Database + - IndexedDB + - Landing + - NeedsTranslation + - Reference + - Storage + - TopicStub +translation_of: Web/API/IndexedDB_API +--- +<div>{{DefaultAPISidebar("IndexedDB")}}</div> + +<p>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 <a href="/en-US/docs/Web/API/Web_Storage_API">Web Storage</a> is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution. This is the main landing page for MDN's IndexedDB coverage — here we provide links to the full API reference and usage guides, browser support details, and some explanation of key concepts.</p> + +<p>{{AvailableInWorkers}}</p> + +<div class="note"> +<p><strong>Note</strong>: IndexedDB API is powerful, but may seem too complicated for simple cases. If you'd prefer a simple API, try libraries such as <a href="https://localforage.github.io/localForage/">localForage</a>, <a href="https://dexie.org/">dexie.js</a>, <a href="https://github.com/erikolson186/zangodb">ZangoDB</a>, <a href="https://pouchdb.com/">PouchDB</a>, <a href="https://www.npmjs.com/package/idb">idb</a>, <a href="https://www.npmjs.com/package/idb-keyval">idb-keyval</a>, <a href="https://jsstore.net/">JsStore</a> and <a href="https://github.com/google/lovefield">lovefield</a> that make IndexedDB more programmer-friendly.</p> +</div> + +<h2 id="Key_concepts_and_usage">Key concepts and usage</h2> + +<p>IndexedDB is a transactional database system, like an SQL-based RDBMS. However, unlike SQL-based RDBMSes, which use fixed-column tables, IndexedDB is a JavaScript-based object-oriented database. IndexedDB lets you store and retrieve objects that are indexed with a <strong>key</strong>; any objects supported by the <a href="/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm">structured clone algorithm</a> can be stored. You need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of <strong>transactions</strong>.</p> + +<ul> + <li>Read more about the <a href="/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB">Concepts behind IndexedDB</a>.</li> + <li>Learn to use IndexedDB asynchronously from first principles with our <a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB">Using IndexedDB</a> guide.</li> + <li>Combine IndexedDB for storing data offline with Service Workers for storing assets offline, as outlined in <a href="/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers">Making PWAs work offline with Service workers</a>.</li> +</ul> + +<div class="note"> +<p><strong>Note</strong>: Like most web storage solutions, IndexedDB follows a <a class="external" href="https://www.w3.org/Security/wiki/Same_Origin_Policy">same-origin policy</a>. So while you can access stored data within a domain, you cannot access data across different domains.</p> +</div> + +<h3 id="Synchronous_and_asynchronous">Synchronous and asynchronous</h3> + +<p>Operations performed using IndexedDB are done asynchronously, so as not to block applications. IndexedDB originally included both synchronous and asynchronous APIs. The synchronous API was intended for use only with <a href="/en-US/docs/Web/Guide/Performance/Using_web_workers">Web Workers</a> but was removed from the spec because it was unclear whether it was needed. However, the synchronous API may be reintroduced if there is enough demand from web developers.</p> + +<h3 id="Storage_limits_and_eviction_criteria">Storage limits and eviction criteria</h3> + +<p>There are a number of web technologies that store data of one kind or another on the client side (i.e. on your local disk). IndexedDB is most commonly talked about. The process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. <a href="/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria">Browser storage limits and eviction criteria</a> attempts to explain how this works, at least in the case of Firefox.</p> + +<h2 id="Interfaces">Interfaces</h2> + +<p>To get access to a database, call <a href="/en-US/docs/Web/API/IDBFactory.open"><code>open()</code></a> on the <a href="/en-US/docs/Web/API/IDBEnvironment.indexedDB"><code>indexedDB</code></a> attribute of a <a href="/en-US/docs/DOM/window">window</a> object. This method returns an {{domxref("IDBRequest")}} object; asynchronous operations communicate to the calling application by firing events on {{domxref("IDBRequest")}} objects.</p> + +<h3 id="Connecting_to_a_database">Connecting to a database</h3> + +<dl> + <dt>{{domxref("IDBEnvironment")}}</dt> + <dd>Provides access to IndexedDB functionality. It is implemented by the {{domxref("window")}} and {{domxref("worker")}} objects. This interface isn't part of the 2.0 specification.</dd> + <dt>{{domxref("IDBFactory")}}</dt> + <dd>Provides access to a database. This is the interface implemented by the global object {{domxref("WindowOrWorkerGlobalScope/indexedDB", "indexedDB")}} and is therefore the entry point for the API.</dd> + <dt>{{domxref("IDBOpenDBRequest")}}</dt> + <dd>Represents a request to open a database.</dd> + <dt>{{domxref("IDBDatabase")}}</dt> + <dd>Represents a connection to a database. It's the only way to get a transaction on the database.</dd> +</dl> + +<h3 id="Retrieving_and_modifying_data">Retrieving and modifying data</h3> + +<dl> + <dt>{{domxref("IDBTransaction")}}</dt> + <dd>Represents a transaction. You create a transaction on a database, specify the scope (such as which object stores you want to access), and determine the kind of access (read only or readwrite) that you want.</dd> + <dt>{{domxref("IDBRequest")}}</dt> + <dd>Generic interface that handles database requests and provides access to results.</dd> + <dt>{{domxref("IDBObjectStore")}}</dt> + <dd>Represents an object store that allows access to a set of data in an IndexedDB database, looked up via primary key.</dd> + <dt>{{domxref("IDBIndex")}}</dt> + <dd>Also allows access to a subset of data in an IndexedDB database, but uses an index to retrieve the record(s) rather than the primary key. This is sometimes faster than using {{domxref("IDBObjectStore")}}.</dd> + <dt>{{domxref("IDBCursor")}}</dt> + <dd>Iterates over object stores and indexes.</dd> + <dt>{{domxref("IDBCursorWithValue")}}</dt> + <dd>Iterates over object stores and indexes and returns the cursor's current value.</dd> + <dt>{{domxref("IDBKeyRange")}}</dt> + <dd>Defines a key range that can be used to retrieve data from a database in a certain range.</dd> + <dt>{{domxref("IDBLocaleAwareKeyRange")}} {{Non-standard_inline}}</dt> + <dd>Defines a key range that can be used to retrieve data from a database in a certain range, sorted according to the rules of the locale specified for a certain index (see <a href="/en-US/docs/Web/API/IDBObjectStore/createIndex#Parameters"><code>createIndex()</code>'s optionalParameters</a>.). This interface isn't part of the 2.0 specification.</dd> +</dl> + +<h3 id="Custom_event_interfaces">Custom event interfaces</h3> + +<p>This specification fires events with the following custom interface:</p> + +<dl> + <dt>{{domxref("IDBVersionChangeEvent")}}</dt> + <dd>The <code>IDBVersionChangeEvent</code> interface indicates that the version of the database has changed, as the result of an {{domxref("IDBOpenDBRequest.onupgradeneeded")}} event handler function.</dd> +</dl> + +<h3 id="Obsolete_interfaces">Obsolete interfaces</h3> + +<p>An early version of the specification also defined the following, now removed, interfaces. They are still documented in case you need to update previously written code:</p> + +<dl> + <dt>{{domxref("IDBVersionChangeRequest")}} {{obsolete_inline}}</dt> + <dd>Represents a request to change the version of a database. The way to change the version of the database has since changed (by calling {{domxref("IDBFactory.open")}} without also calling {{domxref("IDBDatabase.setVersion")}}), and the interface {{domxref("IDBOpenDBRequest")}} now has the functionality of the removed {{domxref("IDBVersionChangeRequest")}}.</dd> + <dt>{{domxref("IDBDatabaseException")}} {{obsolete_inline}}</dt> + <dd>Represents exception conditions that can be encountered while performing database operations.</dd> + <dt>{{domxref("IDBTransactionSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBTransaction")}}.</dd> + <dt>{{domxref("IDBObjectStoreSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBObjectStore")}}.</dd> + <dt>{{domxref("IDBIndexSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBIndex")}}.</dd> + <dt>{{domxref("IDBFactorySync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBFactory")}}.</dd> + <dt>{{domxref("IDBEnvironmentSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBEnvironment")}}.</dd> + <dt>{{domxref("IDBDatabaseSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBDatabase")}}.</dd> + <dt>{{domxref("IDBCursorSync")}} {{obsolete_inline}}</dt> + <dd>Sync version of {{domxref("IDBCursor")}}.</dd> +</dl> + +<h2 id="Examples">Examples</h2> + +<ul> + <li><a class="external" href="https://marco-c.github.io/eLibri/">eLibri:</a> A powerful library and eBook reader application, written by Marco Castelluccio, winner of the IndexedDB Mozilla DevDerby.</li> + <li><a class="external" href="https://github.com/chrisdavidmills/to-do-notifications/tree/gh-pages">To-do Notifications</a> (<a class="external" href="https://mdn.github.io/to-do-notifications/">view example live</a>): The reference application for the examples in the reference docs.</li> + <li><a class="external" href="https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/">Storing images and files in IndexedDB</a></li> +</ul> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("IndexedDB 2")}}</td> + <td>{{Spec2("IndexedDB 2")}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('IndexedDB')}}</td> + <td>{{Spec2('IndexedDB')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a class="external" href="https://localforage.github.io/localForage/">localForage</a>: A Polyfill providing a simple name:value syntax for client-side data storage, which uses IndexedDB in the background, but falls back to WebSQL and then localStorage in browsers that don't support IndexedDB.</li> + <li><a class="external" href="https://www.dexie.org/">Dexie.js</a>: A wrapper for IndexedDB that allows much faster code development via nice, simple syntax.</li> + <li><a href="https://github.com/erikolson186/zangodb">ZangoDB</a>: A MongoDB-like interface for IndexedDB that supports most of the familiar filtering, projection, sorting, updating and aggregation features of MongoDB.</li> + <li><a href="https://jsstore.net/">JsStore</a>: An IndexedDB wrapper with SQL like syntax.</li> + <li><a href="https://github.com/mWater/minimongo">MiniMongo</a>: A client-side in-memory mongodb backed by localstorage with server sync over http. MiniMongo is used by MeteorJS.</li> + <li><a href="https://pouchdb.com">PouchDB</a>: A client-side implementation of CouchDB in the browser using IndexedDB</li> + <li><a href="https://www.npmjs.com/package/idb">idb</a>: A tiny (~1.15k) library that mostly mirrors the IndexedDB API, but with small improvements that make a big difference to usability.</li> + <li><a href="https://www.npmjs.com/package/idb-keyval">idb-keyval</a>: A super-simple-small (~600B) promise-based keyval store implemented with IndexedDB</li> + <li><a href="https://www.npmjs.com/package/@sifrr/storage">sifrr-storage:</a> A small (~2kB) promise based library for client side key-value storage. Works with IndexedDB, localStorage, WebSQL, Cookies. Can automatically use supported storage available based on priority.</li> + <li><a href="https://github.com/google/lovefield">lovefield</a>: <span class="mr-2 text-gray-dark">Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.</span></li> +</ul> |
