litestack 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52b25ab2fd70ef40c8199c431e07638853915a131036abb52d1fef267a70cb13
4
- data.tar.gz: 8f2bcf6c6fbc6d50e18664f74235b4242c79faa65317b1dcd7263ed0aa928161
3
+ metadata.gz: c34bfdfaaa6a2472e132e05b1f80494a76d2311026c764b312a463f4f5cb2ee0
4
+ data.tar.gz: c27e887802afe1ee2f5c7e2c67aeb390fde3ef62adb6cec610e9e3f7af697753
5
5
  SHA512:
6
- metadata.gz: 1fa0edf72ea893a29f71f7398f685954243dd2cbd61080624ff91f49f389bf067c76cac491520f91c7f2470f568444d37eff0b72787d5f8418d6abbc869fd7c8
7
- data.tar.gz: 75be276d72526cc1f68e204929822c8ba846b1d476d2d429de5c5e2e298df748b62de9d5c804912384ddec515505e6a42e0d9e09e4f27a3d27ff942f423a904c
6
+ metadata.gz: abd6ae7cd31c4988b911f147bcdd00f947fdda537993f854250b3d5c8b91bbb2d702faf0f73e07e6b54f4603253d90dd89ef80c41baab61cb313ccb9420d8e54
7
+ data.tar.gz: 58e3f6d9b443afc614d4254ace16c7ff3bd5bdfa1dbbfcfabf9e2eb8f69f57b7b1b15153ac59a7de91e303a305987b9aa92701f204140eea4e5ba4108a05725b
data/BENCHMARKS.md CHANGED
@@ -11,9 +11,12 @@ These are not real life scenarios and I hope I will be able to produce some inte
11
11
  Post.find(id) #ActiveRecord
12
12
  Post[id] #Sequel
13
13
  ```
14
- This maps to "SELECT * FROM posts WHERE id = ?"
14
+ This produces
15
+ ```sql
16
+ SELECT * FROM posts WHERE id = ?
17
+ ```
15
18
 
16
- |Prcoess Count|ActiveRecord:PostgreSQL|ActiveRecord:litedb|Sequel:PostgreSQL|Sequel:litedb|
19
+ |Prcoesses|AR:PG|AR:litedb|Sequel:PG|Sequel:litedb|
17
20
  |-:|-:|-:|-:|-:|
18
21
  |1|1.3K q/s|6.5K q/s|1.8K q/s|17.4K q/s|
19
22
  |2|2.6K q/s|13.9K q/s|3.5K q/s|33.2K q/s|
@@ -25,9 +28,12 @@ This maps to "SELECT * FROM posts WHERE id = ?"
25
28
  ```ruby
26
29
  Post.where(user_id: id).limit(5) # ActiveRecord and Sequel
27
30
  ```
28
- This maps to "SELECT * FROM posts WHERE user_id = ? LIMIT 5"
31
+ This produces
32
+ ```sql
33
+ SELECT * FROM posts WHERE user_id = ? LIMIT 5
34
+ ```
29
35
 
30
- |Prcoess Count|ActiveRecord:PostgreSQL|ActiveRecord:litedb|Sequel:PostgreSQL|Sequel:litedb|
36
+ |Prcoesses|AR:PG|AR:litedb|Sequel:PG|Sequel:litedb|
31
37
  |-:|-:|-:|-:|-:|
32
38
  |1|345 q/s|482 q/s|937 q/s|1.1K q/s|
33
39
  |2|751 q/s|848 q/s|1.3K q/s|2.3K q/s|
@@ -40,16 +46,19 @@ This maps to "SELECT * FROM posts WHERE user_id = ? LIMIT 5"
40
46
  Post.update(id, {updated_at: updated_at} # ActiveRecord
41
47
  Post[id].update({updated_at: updated_at}) # Sequel
42
48
  ```
43
- This maps to "Update posts SET updated_at = ? WHERE id = ?"
49
+ This produces
50
+ ```sql
51
+ Update posts SET updated_at = ? WHERE id = ?
52
+ ```
44
53
 
45
- |Prcoess Count|ActiveRecord:PostgreSQL|ActiveRecord:litedb|Sequel:PostgreSQL|Sequel:litedb|
54
+ |Prcoesses|AR:PG|AR:litedb|Sequel:PG|Sequel:litedb|
46
55
  |-:|-:|-:|-:|-:|
47
56
  |1|125 q/s|484 q/s|129 q/s|2.1K q/s|
48
57
  |2|265 q/s|576 q/s|333 q/s|2.5K q/s|
49
58
  |4|481 q/s|693 q/s|704 q/s|2.3K q/s|
50
59
  |8|898 q/s|748 q/s|1.2K q/s|2.4K q/s|
51
60
 
52
- It is clear the Litedb enjoys a clear advantage for reads and is very competitive for updates until many processes are relentlessly trying to write at the same time non stop.
61
+ It is clear the Litedb enjoys a significant advantage for reads and is very competitive for updates until many processes are relentlessly trying to write at the same time non stop.
53
62
  For most applications, even with higher level of concurrency, Litedb will scale super well for reads and provide a very good baseline for writes.
54
63
 
55
64
  > ![litecache](https://github.com/oldmoe/litestack/blob/master/assets/litecache_logo_teal.png?raw=true)
data/README.md CHANGED
@@ -53,7 +53,7 @@ litestack currently offers three main components
53
53
 
54
54
  > ![litedb](https://github.com/oldmoe/litestack/blob/master/assets/litedb_logo_teal.png?raw=true)
55
55
 
56
- litedb is a wrapper around SQLite3, offering a better default configuration that is tuned for concurrency and performance. Out of the box, litedb works seamlessly between multiple processes without database locking errors. lite db can be used in multiple ways, including:
56
+ litedb is a wrapper around SQLite3, offering a better default configuration that is tuned for concurrency and performance. Out of the box, litedb works seamlessly between multiple processes without database locking errors. litedb can be used in multiple ways, including:
57
57
 
58
58
  #### Direct litedb usage
59
59
 
@@ -69,7 +69,7 @@ db.get_first_value("select count(*) from users") # => 1
69
69
 
70
70
  #### ActiveRecord
71
71
 
72
- litesd provides tight Rails/ActiveRecord integration and can be configured as follows
72
+ litedb provides tight Rails/ActiveRecord integration and can be configured as follows
73
73
 
74
74
  In database.yml
75
75
 
@@ -162,7 +162,7 @@ The queues need to include a name and a priority (a number between 1 and 10) and
162
162
 
163
163
  ## Contributing
164
164
 
165
- Bug reports aree welcome on GitHub at https://github.com/oldmoe/litestack. Please note that this is not an open contribution project and that we don't accept pull requests.
165
+ Bug reports are welcome on GitHub at https://github.com/oldmoe/litestack. Please note that this is not an open contribution project and that we don't accept pull requests.
166
166
 
167
167
  ## License
168
168
 
@@ -228,6 +228,8 @@ class Litecache
228
228
  end
229
229
  @stmts[:pruner].execute!
230
230
  end
231
+ rescue SQLite3::BusyException
232
+ retry
231
233
  rescue SQLite3::FullException
232
234
  @stmts[:extra_pruner].execute!(0.2)
233
235
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Litestack
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litestack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohamed Hassan
@@ -65,9 +65,6 @@ files:
65
65
  - bench/bench_queue.rb
66
66
  - bench/bench_rails.rb
67
67
  - bench/bench_raw.rb
68
- - bench/queue.db
69
- - bench/queue.db-shm
70
- - bench/queue.db-wal
71
68
  - bench/rails_job.rb
72
69
  - bench/skjob.rb
73
70
  - bench/uljob.rb
data/bench/queue.db DELETED
Binary file
data/bench/queue.db-shm DELETED
Binary file
data/bench/queue.db-wal DELETED
Binary file