Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
activerecord_idnamecache
Advanced tools
Use Mysql AUTO_INCREMENT to support key value cache, which should be combined by an integer and string. It means to reduce the database storage size, and improve query performance.
All cache will store in process memory, and will never be expired, until the process dies, so the less kvs you use, the better performance you will get. BTW, 100,000 general strings use 10MB memory.
Some relatived articles: http://en.wikipedia.org/wiki/Correlation_database
create_table :kv_browser_names, :options => 'ENGINE=MyISAM DEFAULT CHARSET=utf8' do |t|
t.string :name
t.timestamps
end
class KvBrowserName < ActiveRecord::Base
include IdNameCache
end
or
create_table :common_tag, :options => 'ENGINE=MyISAM DEFAULT CHARSET=utf8' do |t|
t.integer :tagid
t.string :tagname
end
class CommonTag < ActiveRecord::Base
self.table_name = :common_tag
self.primary_key = :tagid
include IdNameCache; set_key_value :tagid, :tagname
# include IdNameCache; set_key_value_without_create :tagid, :tagname # if you dont want create it automately
end
ruby-1.9.3-rc1 :001 > QuizTag[1]
QuizTag Load (0.3ms) SELECT `common_tag`.* FROM `common_tag` WHERE `common_tag`.`tagid` = 1 LIMIT 1
=> "Android"
ruby-1.9.3-rc1 :002 > QuizTag[1]
=> "Android"
ruby-1.9.3-rc1 :003 > QuizTag['Android']
QuizTag Load (0.5ms) SELECT `common_tag`.* FROM `common_tag` WHERE `common_tag`.`tagname` = 'Android' LIMIT 1
=> 1
ruby-1.9.3-rc1 :004 > QuizTag['Android']
=> 1
== Copyright MIT, David Chen at eoe.cn
FAQs
Unknown package
We found that activerecord_idnamecache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.