Database Reference
In-Depth Information
user_agent : "Mozilla/4.08 [en] (Win98; I ;Nav)"
}
Operations
In this section, we'll describe the various operations you'll need to perform on the logging
system, paying particular attention to the appropriate use of indexes and MongoDB-specific
features.
Inserting a log record
The primary performance concerns for event-logging systems are:
▪ How many inserts per second it can support, which limits the event throughput
▪ How the system will manage the growth of event data, particularly in the case of a growth
in insert activity
In designing our system, we'll primarily focus on optimizing insertion speed, while still ad-
dressing how we manage event data growth. One decision that MongoDB allows you to make
when performing updates (such as event data insertion) is whether you want to trade off data
safety guarantees for increased insertion speed. This section will explore the various options
we can tweak depending on our tolerance for event data loss.
WRITE CONCERN
MongoDB has a configurable write concern . This capability allows you to balance the im-
portance of guaranteeing that all writes are fully recorded in the database with the speed of
the insert.
For example, if you issue writes to MongoDB and do not require that the database issue
any response, the write operations will return very fast (since the application needs to wait
for a response from the database) but you cannot be certain that all writes succeeded. Con-
versely,ifyourequirethatMongoDBacknowledgeeverywriteoperation,thedatabasewill
not return as quickly but you can be certain that every item will be present in the database.
The proper write concern is often an application-specific decision, and depends on the re-
porting requirements and uses of your analytics application.
Search WWH ::




Custom Search