"And there shall in no wise enter into it any thing that defileth, neither whatsoever worketh abomination, or maketh a lie: but they which are written in the Lamb's book of life." (Revelation 21:27)
God does keep books! In fact, when David was pondering the time between his own conception and birth, he said "in thy book all my members were written, which in continuance |that is, as my days continued| were fashioned, when as yet there was none of them" (Psalm 139:16). It seems that God has a book for each person who is conceived, and that all these together constitute the Book of Life, one great volume containing the names and deeds of every one who was ever given biological life by his Maker.
But many, during the course of their lives, will reject (or simply ignore) God's provision that would also give them eternal life. As David prayed in another psalm: "Let them be blotted out of the book of the living, and not be written with the righteous" (Psalm 69:28). Note also Revelation 3:5 and 22:19. And that will be a fearful thing, for "whosoever was not found written in the book of life was cast into the lake of fire" (Revelation 20:15).
Those whose names will not be blotted out of the book, of course, are those who have been redeemed "with the precious blood of Christ, as of a lamb without blemish and without spot" (1 Peter 1:19). Not one person deserves to be retained in God's book, for all have sinned, but they have "beheld," with eyes of thankful faith, "the Lamb of God, which taketh away the sin of the world" (John 1:29), and have therefore been redeemed by the Lamb.
Finally, only these will still have their names written on the rolls of the heavenly city. God's Book of Life will have become "the Lamb's Book of Life" on which are written forever the names of all those redeemed by His blood. HMM