Hello,
JoomSEF can handle both way, so you can either:
1. have a JoomSEF extension that provides ANY format of URLs, but it stores them to DB
or
2. have a Joomla-style router for your component, which does not store URLs for the component to DB and transles them automatically back and forth, however, such URLs have a limitations and special conditions, such as they need to include all needed variables (which can be "hidden" if URL is stored to DB), format that can be automatically converted to original non-SEO URL, etc.
The first case creates additional queries to DB which increases the DB load (however, JoomSEF caching on the other hand attepts to descreate that load). The second then take CPU resource at the webserver, needed to do the on-fly translations (so if those are quite complex, it may even be more demanding that the DB query).
So the decision depends on several factors, such as:
1. number of links the component generates
2. complexity of component's links (sometimes these can be largely simplyfied with good component design)
3. need of additional JoomSEF features that only work when DB storage is used, such as custom meta data, page titles, etc.
The basic handling option can be set in the Manage Extensios section of JoomSEF, where you choose among
1. JoomSEF default handler (storing URLs to DB)
2. own component router (automatic on-fly translations, but limited features)
3. none SEF URLs
Now, explicitelly to your questions:
Q: Is that the principle of it’s work, to store everything in db and then just to replace?
A: Yes, that is how extensions for JoomSEF work, so you can use all its functinality, that is not available without storing the data to DB.
Q: Or it’s because I haven’t written custom extention for my component?
A: Exactly so, if a special extension for the component does not exists, JoomSEF will try to suggest the SEF URLs using its default handler, but that is usually not satsfactory for more complex custom extensions. Then a special extension should be created.
I hope this explains how it works and gives answers to your questions.