# Elasticsearch to store account information

**URL:** <https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159>\
**Category:** Elasticsearch\
**Created:** [August 14, 2011, 12:22pm UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159 "2011-08-14T12:22:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![moraleslos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moraleslos/32/18527_2.png) [@moraleslos](https://discuss.elastic.co/u/moraleslos)\
**Post date:** [August 14, 2011, 12:22pm UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159/1 "2011-08-14T12:22:56Z")

</div>

Hi,

Just recently found ES when doing research about IR (lucene, etc).  
Seems like ES fits what I would like to do for a new project-- almost  
entirely. Would like to use it solely without the need to use another  
NoSQL DB or even a relational one since almost all of my data will  
have to be indexed and searched via JSON. I do have a question about  
ES though (or advice). Other than searchable data, I will have to  
store somewhere user account information (i.e. username, password,  
first/last name, etc). Now first thing comes to mind is a relational  
DB. But since this data would probably be relatively small and  
performance in terms of storing and retrieving is not a factor, could  
I just store this as is in ES? I mean I probably could but would like  
to know if this is not recommended, if there is a better way of  
handling this, etc. The account information will be tied to the  
searchable data, but that would be "copied" onto the documents  
themselves when indexed. What I'm interested in is the log in data.

Any advice would be appreciated. Thanks.

-los

---

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [August 14, 2011, 1:11pm UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159/2 "2011-08-14T13:11:39Z")

</div>

Your user account data can certainly be stored in ES. It's just another type  
of document that you search for and perform CRUD functions on.

If you use a third-party authentication mechanism in your code, you may have  
to write an extension to access this data as most (all?) do not have an  
extension that will directly access ES for credential data. For example, we  
use Spring Security for all authentication and out-of-the-box it has support  
for authenticating a user's credentials against a database table, LDAP,  
Active Directory, and others. Because many companies have their own way of  
authenticating, all of these third-party products provide a programming  
interface that can be configured with a custom auth implementation.

We wrote our own auth class [https://gist.github.com/1144863](https://gist.github.com/1144863) for Spring  
Security.

-- jim

---

<div class="post-metadata">

**Author:** ![moraleslos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moraleslos/32/18527_2.png) [@moraleslos](https://discuss.elastic.co/u/moraleslos)\
**Post date:** [August 14, 2011, 7:28pm UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159/3 "2011-08-14T19:28:17Z")

</div>

Thanks for the response. Will look into Spring Security integration.  
I'm assuming you're using ES's Java API?

---

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [August 14, 2011, 10:30pm UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159/4 "2011-08-14T22:30:30Z")

</div>

Yes, we use the Java API for most everything, although we do a lot of SSJS,  
so most of our code is a JavaScript facade over the Java API. Since ES uses  
JSON as its document format and all query structures it is probably the most  
ideal coding environment from a syntax and performance standpoint.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:57am UTC](https://discuss.elastic.co/t/elasticsearch-to-store-account-information/5159/5 "2017-07-06T03:57:03Z")

</div>


